1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

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.

llvm-svn: 285030
This commit is contained in:
Justin Bogner 2016-10-24 21:40:15 +00:00
parent 7fbfea2c1c
commit 1773e2c387

View File

@ -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()