r247912 - [CMake] Add install-clang target to install just the clang executable

Chris Bieneman via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 17 11:30:20 PDT 2015


Author: cbieneman
Date: Thu Sep 17 13:30:20 2015
New Revision: 247912

URL: http://llvm.org/viewvc/llvm-project?rev=247912&view=rev
Log:
[CMake] Add install-clang target to install just the clang executable

For the llvm-tools we're generating install-${tool} targets which are very useful. We should have one for clang too.

Modified:
    cfe/trunk/tools/driver/CMakeLists.txt

Modified: cfe/trunk/tools/driver/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/CMakeLists.txt?rev=247912&r1=247911&r2=247912&view=diff
==============================================================================
--- cfe/trunk/tools/driver/CMakeLists.txt (original)
+++ cfe/trunk/tools/driver/CMakeLists.txt Thu Sep 17 13:30:20 2015
@@ -79,7 +79,13 @@ set_property(DIRECTORY APPEND
   PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${clang_cl})
 
 install(TARGETS clang
-  RUNTIME DESTINATION bin)
+  RUNTIME DESTINATION bin
+  COMPONENT clang)
+add_custom_target(install-clang
+  DEPENDS clang
+  COMMAND "${CMAKE_COMMAND}"
+          -DCMAKE_INSTALL_COMPONENT=clang
+          -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
 
 # Create the clang++ and clang-cl symlinks at installation time.
 install(SCRIPT clang_symlink.cmake -DCMAKE_INSTALL_PREFIX=\"${CMAKE_INSTALL_PREFIX}\")




More information about the cfe-commits mailing list