aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2015-05-29 18:36:20 +0000
committerChris Bieneman <beanz@apple.com>2015-05-29 18:36:20 +0000
commit8eb2fc8c4a60445c84d996e2f369001106d309d9 (patch)
treedf249f26d43f78788afef988fe610a19db78f5c3
parent7c445dd6c7dd356fe36889ab0b0f03295e328283 (diff)
downloadllvm-8eb2fc8c4a60445c84d996e2f369001106d309d9.zip
llvm-8eb2fc8c4a60445c84d996e2f369001106d309d9.tar.gz
llvm-8eb2fc8c4a60445c84d996e2f369001106d309d9.tar.bz2
[CMake] Bug 19462 - Use the INSTALL(EXPORT ...) to export CMake definitions
Summary: This patch moves all the clang library targets into a ClangTargets export list, and installs it using the CMake install(EXPORT...) command. Reviewers: rnk Reviewed By: rnk Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D7623 llvm-svn: 238593
-rw-r--r--clang/CMakeLists.txt4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
index 628428a..e6d8fdc 100644
--- a/clang/CMakeLists.txt
+++ b/clang/CMakeLists.txt
@@ -365,6 +365,7 @@ macro(add_clang_library name)
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "libclang")
install(TARGETS ${name}
+ EXPORT ClangTargets
LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
RUNTIME DESTINATION bin)
@@ -524,9 +525,10 @@ if (CLANG_BUILT_STANDALONE)
# Install a <prefix>/share/clang/cmake/ClangConfig.cmake file so that
# find_package(Clang) works. Install the target list with it.
+ install(EXPORT ClangTargets DESTINATION ${LLVM_INSTALL_PACKAGE_DIR})
+
install(FILES
${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/ClangConfig.cmake
- ${CLANG_BINARY_DIR}/share/clang/cmake/ClangTargets.cmake
DESTINATION share/clang/cmake)
# Also copy ClangConfig.cmake to the build directory so that dependent projects