r238593 - [CMake] Bug 19462 - Use the INSTALL(EXPORT ...) to export CMake definitions
Chris Bieneman
beanz at apple.com
Fri May 29 11:36:20 PDT 2015
Author: cbieneman
Date: Fri May 29 13:36:20 2015
New Revision: 238593
URL: http://llvm.org/viewvc/llvm-project?rev=238593&view=rev
Log:
[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
Modified:
cfe/trunk/CMakeLists.txt
Modified: cfe/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CMakeLists.txt?rev=238593&r1=238592&r2=238593&view=diff
==============================================================================
--- cfe/trunk/CMakeLists.txt (original)
+++ cfe/trunk/CMakeLists.txt Fri May 29 13:36:20 2015
@@ -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
More information about the cfe-commits
mailing list