[llvm] r201051 - Load exported lib and exe targets from LLVMConfig
NAKAMURA Takumi
geek4civic at gmail.com
Sun Feb 9 08:36:28 PST 2014
Author: chapuni
Date: Sun Feb 9 10:36:28 2014
New Revision: 201051
URL: http://llvm.org/viewvc/llvm-project?rev=201051&view=rev
Log:
Load exported lib and exe targets from LLVMConfig
Teach each package configuration file to load the LLVMExports file for
its corresponding tree. This will allow application CMake code to use
logical library and executable target names from LLVM as if they were in
our own build process (e.g. LLVMSupport). CMake will have enough
information to propagate LLVM library link dependencies automatically
while configuring applications.
Contributed by Brad King.
Modified:
llvm/trunk/cmake/modules/CMakeLists.txt
llvm/trunk/cmake/modules/LLVMConfig.cmake.in
Modified: llvm/trunk/cmake/modules/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/CMakeLists.txt?rev=201051&r1=201050&r2=201051&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/CMakeLists.txt (original)
+++ llvm/trunk/cmake/modules/CMakeLists.txt Sun Feb 9 10:36:28 2014
@@ -31,6 +31,7 @@ set(LLVM_CONFIG_LIBRARY_DIRS
"${LLVM_LIBRARY_DIR}"
)
set(LLVM_CONFIG_CMAKE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
+set(LLVM_CONFIG_EXPORTS_FILE "${llvm_cmake_builddir}/LLVMExports.cmake")
configure_file(
LLVMConfig.cmake.in
${llvm_cmake_builddir}/LLVMConfig.cmake
@@ -60,6 +61,7 @@ endforeach(p)
set(LLVM_CONFIG_INCLUDE_DIRS "\${LLVM_INSTALL_PREFIX}/include")
set(LLVM_CONFIG_LIBRARY_DIRS "\${LLVM_INSTALL_PREFIX}/lib")
set(LLVM_CONFIG_CMAKE_DIR "\${LLVM_INSTALL_PREFIX}/${LLVM_INSTALL_PACKAGE_DIR}")
+set(LLVM_CONFIG_EXPORTS_FILE "\${LLVM_CMAKE_DIR}/LLVMExports.cmake")
configure_file(
LLVMConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/LLVMConfig.cmake
Modified: llvm/trunk/cmake/modules/LLVMConfig.cmake.in
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/LLVMConfig.cmake.in?rev=201051&r1=201050&r2=201051&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/LLVMConfig.cmake.in (original)
+++ llvm/trunk/cmake/modules/LLVMConfig.cmake.in Sun Feb 9 10:36:28 2014
@@ -43,4 +43,8 @@ set(LLVM_LIBRARY_DIRS "@LLVM_CONFIG_LIBR
set(LLVM_DEFINITIONS "-D__STDC_LIMIT_MACROS" "-D__STDC_CONSTANT_MACROS")
set(LLVM_CMAKE_DIR "@LLVM_CONFIG_CMAKE_DIR@")
+if(NOT TARGET LLVMSupport)
+ include("@LLVM_CONFIG_EXPORTS_FILE@")
+endif()
+
include(${LLVM_CMAKE_DIR}/LLVM-Config.cmake)
More information about the llvm-commits
mailing list