]> granicus.if.org Git - clang/commitdiff
[CMake] Add install-clang target to install just the clang executable
authorChris Bieneman <beanz@apple.com>
Thu, 17 Sep 2015 18:30:20 +0000 (18:30 +0000)
committerChris Bieneman <beanz@apple.com>
Thu, 17 Sep 2015 18:30:20 +0000 (18:30 +0000)
For the llvm-tools we're generating install-${tool} targets which are very useful. We should have one for clang too.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247912 91177308-0d34-0410-b5e6-96231b3b80d8

tools/driver/CMakeLists.txt

index 708813c9de5c8308f3fd5f5167c342a0548d9592..c966b0b6c53b5b5e340b316be53941c5f55677cc 100644 (file)
@@ -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}\")