summaryrefslogtreecommitdiffstats
path: root/llvm/cmake/modules/LLVMConfig.cmake.in
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2014-02-09 16:35:40 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2014-02-09 16:35:40 +0000
commit81b580b455426dd885fe4858e5bd3e2f22c00f5f (patch)
tree5c0e0e2eb5b3be52ad9ad02f479e6813c1cc6798 /llvm/cmake/modules/LLVMConfig.cmake.in
parent3097cdc97d134df09cb13190837dbc082b915c93 (diff)
downloadbcm5719-llvm-81b580b455426dd885fe4858e5bd3e2f22c00f5f.tar.gz
bcm5719-llvm-81b580b455426dd885fe4858e5bd3e2f22c00f5f.zip
Teach LLVMConfig to avoid modifying CMAKE_MODULE_PATH
Do not modify this value on the application's behalf and just ensure API modules are always available next to the LLVMConfig module. This is already the case in the install tree so use file(COPY) to make it so in the build tree. Include the LLVM-Config API module from next to the LLVMConfig location. Contributed by Brad King. llvm-svn: 201047
Diffstat (limited to 'llvm/cmake/modules/LLVMConfig.cmake.in')
-rw-r--r--llvm/cmake/modules/LLVMConfig.cmake.in16
1 files changed, 3 insertions, 13 deletions
diff --git a/llvm/cmake/modules/LLVMConfig.cmake.in b/llvm/cmake/modules/LLVMConfig.cmake.in
index 5e38d82f599..224a26352d3 100644
--- a/llvm/cmake/modules/LLVMConfig.cmake.in
+++ b/llvm/cmake/modules/LLVMConfig.cmake.in
@@ -41,16 +41,6 @@ set(LLVM_INCLUDE_DIRS ${LLVM_INSTALL_PREFIX}/include)
set(LLVM_LIBRARY_DIRS ${LLVM_INSTALL_PREFIX}/lib)
set(LLVM_DEFINITIONS "-D__STDC_LIMIT_MACROS" "-D__STDC_CONSTANT_MACROS")
-# We try to include using the current setting of CMAKE_MODULE_PATH,
-# which suppossedly was filled by the user with the directory where
-# this file was installed:
-include( LLVM-Config OPTIONAL RESULT_VARIABLE LLVMCONFIG_INCLUDED )
-
-# If failed, we assume that this is an un-installed build:
-if( NOT LLVMCONFIG_INCLUDED )
- set(CMAKE_MODULE_PATH
- ${CMAKE_MODULE_PATH}
- "@LLVM_SOURCE_DIR@/cmake/modules")
- include( LLVM-Config )
-endif()
-
+get_filename_component(_SELF_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
+include(${_SELF_DIR}/LLVM-Config.cmake)
+unset(_SELF_DIR)
OpenPOWER on IntegriCloud