diff flang/cmake/modules/CMakeLists.txt @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900 (2021-06-07)
parents 0572611fdcc8
children c4bab56944e8
line wrap: on
line diff
--- a/flang/cmake/modules/CMakeLists.txt	Mon May 25 11:55:54 2020 +0900
+++ b/flang/cmake/modules/CMakeLists.txt	Tue Jun 08 06:07:14 2021 +0900
@@ -14,7 +14,7 @@
 # Generate FlangConfig.cmake for the build tree.
 set(FLANG_CONFIG_CMAKE_DIR "${flang_cmake_builddir}")
 set(FLANG_CONFIG_LLVM_CMAKE_DIR "${llvm_cmake_builddir}")
-set(FLANG_CONFIG_EXPORTS_FILE "${flang_cmake_builddir}/FlangTargets.cmake")
+set(FLANG_CONFIG_INCLUDE_EXPORTS "include(\"${flang_cmake_builddir}/FlangTargets.cmake\")")
 set(FLANG_CONFIG_INCLUDE_DIRS
   "${FLANG_SOURCE_DIR}/include"
   "${FLANG_BINARY_DIR}/include"
@@ -25,7 +25,6 @@
   @ONLY)
 set(FLANG_CONFIG_CMAKE_DIR)
 set(FLANG_CONFIG_LLVM_CMAKE_DIR)
-set(FLANG_CONFIG_EXPORTS_FILE)
 
 # Generate FlangConfig.cmake for the install tree.
 set(FLANG_CONFIG_CODE "
@@ -41,7 +40,7 @@
 
 set(FLANG_CONFIG_CMAKE_DIR "\${FLANG_INSTALL_PREFIX}/${FLANG_INSTALL_PACKAGE_DIR}")
 set(FLANG_CONFIG_LLVM_CMAKE_DIR "\${FLANG_INSTALL_PREFIX}/${LLVM_INSTALL_PACKAGE_DIR}")
-set(FLANG_CONFIG_EXPORTS_FILE "\${FLANG_CMAKE_DIR}/FlangTargets.cmake")
+get_config_exports_includes(Flang FLANG_CONFIG_INCLUDE_EXPORTS)
 set(FLANG_CONFIG_INCLUDE_DIRS "\${FLANG_INSTALL_PREFIX}/include")
 
 configure_file(
@@ -54,11 +53,7 @@
 set(FLANG_CONFIG_EXPORTS_FILE)
 
 if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
-  get_property(flang_has_exports GLOBAL PROPERTY FLANG_HAS_EXPORTS)
-  if(flang_has_exports)
-    install(EXPORT FlangTargets DESTINATION ${FLANG_INSTALL_PACKAGE_DIR}
-            COMPONENT flang-cmake-exports)
-  endif()
+  install_distribution_exports(Flang)
 
   install(FILES
     ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/FlangConfig.cmake