aboutsummaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorOscar Fuentes <ofv@wanadoo.es>2010-08-11 00:51:32 +0000
committerOscar Fuentes <ofv@wanadoo.es>2010-08-11 00:51:32 +0000
commite1fadb1dc66cf2105a56990134dd245db1eed3e4 (patch)
treeacd6052fca743d341631619f05373d5da495e884 /cmake
parent38ae997e63e3e1bb2c8679e01ea74cf8fd0be893 (diff)
downloadexternal_llvm-e1fadb1dc66cf2105a56990134dd245db1eed3e4.zip
external_llvm-e1fadb1dc66cf2105a56990134dd245db1eed3e4.tar.gz
external_llvm-e1fadb1dc66cf2105a56990134dd245db1eed3e4.tar.bz2
CMake: corrections on LLVM.cmake external services.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110763 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/CMakeLists.txt3
-rw-r--r--cmake/modules/LLVM.cmake14
-rwxr-xr-xcmake/modules/LLVMConfig.cmake2
3 files changed, 15 insertions, 4 deletions
diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt
index 03b1e83..416d7f4 100644
--- a/cmake/modules/CMakeLists.txt
+++ b/cmake/modules/CMakeLists.txt
@@ -2,7 +2,8 @@ set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/share/llvm/cmake")
configure_file(
LLVM.cmake
- ${llvm_cmake_builddir}/LLVM.cmake)
+ ${llvm_cmake_builddir}/LLVM.cmake
+ @ONLY)
install(FILES
${llvm_cmake_builddir}/LLVM.cmake
diff --git a/cmake/modules/LLVM.cmake b/cmake/modules/LLVM.cmake
index b055d83..9621454 100644
--- a/cmake/modules/LLVM.cmake
+++ b/cmake/modules/LLVM.cmake
@@ -1,3 +1,5 @@
+# This file provides information and services to the final user.
+
set(LLVM_COMMON_DEPENDS @LLVM_COMMON_DEPENDS@)
set(llvm_libs @llvm_libs@)
@@ -10,10 +12,18 @@ set(LLVM_TOOLS_BINARY_DIR @LLVM_TOOLS_BINARY_DIR@)
set(LLVM_ENABLE_THREADS @LLVM_ENABLE_THREADS@)
-if( NOT EXISTS LLVMConfig.cmake )
+set(LLVM_NATIVE_ARCH @LLVM_NATIVE_ARCH@)
+
+# 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( LLVMConfig 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( LLVMConfig )
endif()
-include( LLVMConfig )
diff --git a/cmake/modules/LLVMConfig.cmake b/cmake/modules/LLVMConfig.cmake
index c623bfa..328aebf 100755
--- a/cmake/modules/LLVMConfig.cmake
+++ b/cmake/modules/LLVMConfig.cmake
@@ -53,7 +53,7 @@ endfunction(explicit_llvm_config)
function(llvm_map_components_to_libraries OUT_VAR)
explicit_map_components_to_libraries(result ${ARGN})
get_system_libs(sys_result)
- set( ${OUT_VAR} ${result} ${sys_result} )
+ set( ${OUT_VAR} ${result} ${sys_result} PARENT_SCOPE )
endfunction(llvm_map_components_to_libraries)