]> granicus.if.org Git - clang/commitdiff
[clang] Add CMake target for installing clang's CMake exports
authorShoaib Meenai <smeenai@fb.com>
Wed, 20 Feb 2019 23:16:15 +0000 (23:16 +0000)
committerShoaib Meenai <smeenai@fb.com>
Wed, 20 Feb 2019 23:16:15 +0000 (23:16 +0000)
This mirrors LLVM's install-cmake-exports target.

Differential Revision: https://reviews.llvm.org/D58480

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354527 91177308-0d34-0410-b5e6-96231b3b80d8

cmake/modules/CMakeLists.txt

index be6d1d7257bc106ca3fd3abe653710b1081cf7a4..d233f552f01f987c1664a4fb9582d80641935dd6 100644 (file)
@@ -55,10 +55,19 @@ set(CLANG_CONFIG_EXPORTS_FILE)
 if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
   get_property(clang_has_exports GLOBAL PROPERTY CLANG_HAS_EXPORTS)
   if(clang_has_exports)
-    install(EXPORT ClangTargets DESTINATION ${CLANG_INSTALL_PACKAGE_DIR})
+    install(EXPORT ClangTargets DESTINATION ${CLANG_INSTALL_PACKAGE_DIR}
+            COMPONENT clang-cmake-exports)
   endif()
 
   install(FILES
     ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/ClangConfig.cmake
-    DESTINATION ${CLANG_INSTALL_PACKAGE_DIR})
+    DESTINATION ${CLANG_INSTALL_PACKAGE_DIR}
+    COMPONENT clang-cmake-exports)
+
+  if(NOT LLVM_ENABLE_IDE)
+    # Add a dummy target so this can be used with LLVM_DISTRIBUTION_COMPONENTS
+    add_custom_target(clang-cmake-exports)
+    add_llvm_install_targets(install-clang-cmake-exports
+                             COMPONENT clang-cmake-exports)
+  endif()
 endif()