summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2014-02-09 16:36:03 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2014-02-09 16:36:03 +0000
commitef97607126c4eb1d75e085cc9da5d5ad3d105325 (patch)
tree45bdf408a8ba605fb8c19d2d0e025db844d14099
parent43d6384c3810e89823b11c7c751eb2856e780914 (diff)
downloadbcm5719-llvm-ef97607126c4eb1d75e085cc9da5d5ad3d105325.tar.gz
bcm5719-llvm-ef97607126c4eb1d75e085cc9da5d5ad3d105325.zip
Export lib and exe build target names from install tree
Use the install(TARGETS) command EXPORT option for every library and executable that we install with LLVM. Then use the install(EXPORT) command to provide a "LLVMExports.cmake" file that exports logical targets for import into applications from our install tree. The "LLVMExports.cmake" file is not meant for direct inclusion by application code but should be included by "LLVMConfig.cmake" in a future change. Contributed by Brad King. llvm-svn: 201049
-rw-r--r--llvm/cmake/modules/AddLLVM.cmake6
-rw-r--r--llvm/cmake/modules/CMakeLists.txt2
-rw-r--r--llvm/cmake/modules/TableGen.cmake4
3 files changed, 10 insertions, 2 deletions
diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
index e925632aa9f..63e04619dc3 100644
--- a/llvm/cmake/modules/AddLLVM.cmake
+++ b/llvm/cmake/modules/AddLLVM.cmake
@@ -195,6 +195,7 @@ macro(add_llvm_library name)
else()
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "LTO")
install(TARGETS ${name}
+ EXPORT LLVMExports
LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
endif()
@@ -246,6 +247,7 @@ ${name} ignored.")
else()
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
install(TARGETS ${name}
+ EXPORT LLVMExports
LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
endif()
@@ -294,7 +296,9 @@ macro(add_llvm_tool name)
list(FIND LLVM_TOOLCHAIN_TOOLS ${name} LLVM_IS_${name}_TOOLCHAIN_TOOL)
if (LLVM_IS_${name}_TOOLCHAIN_TOOL GREATER -1 OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
if( LLVM_BUILD_TOOLS )
- install(TARGETS ${name} RUNTIME DESTINATION bin)
+ install(TARGETS ${name}
+ EXPORT LLVMExports
+ RUNTIME DESTINATION bin)
endif()
endif()
set_target_properties(${name} PROPERTIES FOLDER "Tools")
diff --git a/llvm/cmake/modules/CMakeLists.txt b/llvm/cmake/modules/CMakeLists.txt
index 4992be0e2f6..0620ae87c14 100644
--- a/llvm/cmake/modules/CMakeLists.txt
+++ b/llvm/cmake/modules/CMakeLists.txt
@@ -67,6 +67,8 @@ configure_file(
${llvm_cmake_builddir}/LLVMConfigVersion.cmake
@ONLY)
+install(EXPORT LLVMExports DESTINATION ${LLVM_INSTALL_PACKAGE_DIR})
+
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/LLVMConfig.cmake
diff --git a/llvm/cmake/modules/TableGen.cmake b/llvm/cmake/modules/TableGen.cmake
index b1e15492471..35f1422cc53 100644
--- a/llvm/cmake/modules/TableGen.cmake
+++ b/llvm/cmake/modules/TableGen.cmake
@@ -127,6 +127,8 @@ macro(add_tablegen target project)
endif()
if (${project} STREQUAL LLVM AND NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
- install(TARGETS ${target} RUNTIME DESTINATION bin)
+ install(TARGETS ${target}
+ EXPORT LLVMExports
+ RUNTIME DESTINATION bin)
endif()
endmacro()
OpenPOWER on IntegriCloud