summaryrefslogtreecommitdiffstats
path: root/llvm/cmake/modules
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2015-02-18 19:25:47 +0000
committerChris Bieneman <beanz@apple.com>2015-02-18 19:25:47 +0000
commit0d9289daa1e69b6f0ecef751cbe12e7e55fbc084 (patch)
tree5f859bfcb5b0a1695ddfa4f9ee8f2a714dae9883 /llvm/cmake/modules
parenta16d4707bcad70b952e3e274da4c236526a6d38f (diff)
downloadbcm5719-llvm-0d9289daa1e69b6f0ecef751cbe12e7e55fbc084.tar.gz
bcm5719-llvm-0d9289daa1e69b6f0ecef751cbe12e7e55fbc084.zip
Adding install targets for individual LLVM tools and libraries.
Summary: * add_llvm_tool and add_llvm_library now add install-${name} targets to install specific components * added installhdrs target to install just the LLVM headers * The above changes only apply for single-configuration generators (Ninja, Makefiles...), not for multi-configuration generators (Visual Studio, Xcode...) Reviewers: pete Reviewed By: pete Subscribers: pete, llvm-commits Differential Revision: http://reviews.llvm.org/D7619 llvm-svn: 229727
Diffstat (limited to 'llvm/cmake/modules')
-rw-r--r--llvm/cmake/modules/AddLLVM.cmake22
1 files changed, 20 insertions, 2 deletions
diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
index af47690a187..4d081bd8651 100644
--- a/llvm/cmake/modules/AddLLVM.cmake
+++ b/llvm/cmake/modules/AddLLVM.cmake
@@ -413,7 +413,16 @@ macro(add_llvm_library name)
EXPORT LLVMExports
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
+ ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
+ COMPONENT ${name})
+
+ if (NOT CMAKE_CONFIGURATION_TYPES)
+ add_custom_target(install-${name}
+ DEPENDS ${name}
+ COMMAND "${CMAKE_COMMAND}"
+ -DCMAKE_INSTALL_COMPONENT=${name}
+ -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
+ endif()
endif()
set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name})
endif()
@@ -494,7 +503,16 @@ macro(add_llvm_tool name)
if( LLVM_BUILD_TOOLS )
install(TARGETS ${name}
EXPORT LLVMExports
- RUNTIME DESTINATION bin)
+ RUNTIME DESTINATION bin
+ COMPONENT ${name})
+
+ if (NOT CMAKE_CONFIGURATION_TYPES)
+ add_custom_target(install-${name}
+ DEPENDS ${name}
+ COMMAND "${CMAKE_COMMAND}"
+ -DCMAKE_INSTALL_COMPONENT=${name}
+ -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
+ endif()
endif()
endif()
if( LLVM_BUILD_TOOLS )
OpenPOWER on IntegriCloud