[llvm] r285030 - cmake: Make /usr/share/cmake installable with LLVM_DISTRIBUTION_COMPONENTS
Justin Bogner via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 24 14:40:15 PDT 2016
Author: bogner
Date: Mon Oct 24 16:40:15 2016
New Revision: 285030
URL: http://llvm.org/viewvc/llvm-project?rev=285030&view=rev
Log:
cmake: Make /usr/share/cmake installable with LLVM_DISTRIBUTION_COMPONENTS
Add a cmake-exports install component and appropriate targets for
LLVM_DISTRIBUTION_COMPONENTS to work with.
Modified:
llvm/trunk/cmake/modules/CMakeLists.txt
Modified: llvm/trunk/cmake/modules/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/CMakeLists.txt?rev=285030&r1=285029&r2=285030&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/CMakeLists.txt (original)
+++ llvm/trunk/cmake/modules/CMakeLists.txt Mon Oct 24 16:40:15 2016
@@ -103,20 +103,32 @@ configure_file(
@ONLY)
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
- install(EXPORT LLVMExports DESTINATION ${LLVM_INSTALL_PACKAGE_DIR})
+ install(EXPORT LLVMExports DESTINATION ${LLVM_INSTALL_PACKAGE_DIR}
+ COMPONENT cmake-exports)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/LLVMConfig.cmake
${llvm_cmake_builddir}/LLVMConfigVersion.cmake
LLVM-Config.cmake
- DESTINATION ${LLVM_INSTALL_PACKAGE_DIR})
+ DESTINATION ${LLVM_INSTALL_PACKAGE_DIR}
+ COMPONENT cmake-exports)
install(DIRECTORY .
DESTINATION ${LLVM_INSTALL_PACKAGE_DIR}
+ COMPONENT cmake-exports
FILES_MATCHING PATTERN *.cmake
PATTERN .svn EXCLUDE
PATTERN LLVMConfig.cmake EXCLUDE
PATTERN LLVMConfigVersion.cmake EXCLUDE
PATTERN LLVM-Config.cmake EXCLUDE
PATTERN GetHostTriple.cmake EXCLUDE)
+
+ if (NOT CMAKE_CONFIGURATION_TYPES)
+ # Add a dummy target so this can be used with LLVM_DISTRIBUTION_COMPONENTS
+ add_custom_target(cmake-exports)
+ add_custom_target(install-cmake-exports
+ COMMAND "${CMAKE_COMMAND}"
+ -DCMAKE_INSTALL_COMPONENT=cmake-exports
+ -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
+ endif()
endif()
More information about the llvm-commits
mailing list