[llvm-commits] [llvm] r110763 - in /llvm/trunk/cmake/modules: CMakeLists.txt LLVM.cmake LLVMConfig.cmake

Oscar Fuentes ofv at wanadoo.es
Tue Aug 10 17:51:32 PDT 2010


Author: ofv
Date: Tue Aug 10 19:51:32 2010
New Revision: 110763

URL: http://llvm.org/viewvc/llvm-project?rev=110763&view=rev
Log:
CMake: corrections on LLVM.cmake external services.

Modified:
    llvm/trunk/cmake/modules/CMakeLists.txt
    llvm/trunk/cmake/modules/LLVM.cmake
    llvm/trunk/cmake/modules/LLVMConfig.cmake

Modified: llvm/trunk/cmake/modules/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/CMakeLists.txt?rev=110763&r1=110762&r2=110763&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/CMakeLists.txt (original)
+++ llvm/trunk/cmake/modules/CMakeLists.txt Tue Aug 10 19:51:32 2010
@@ -2,7 +2,8 @@
 
 configure_file(
   LLVM.cmake
-  ${llvm_cmake_builddir}/LLVM.cmake)
+  ${llvm_cmake_builddir}/LLVM.cmake
+  @ONLY)
 
 install(FILES
   ${llvm_cmake_builddir}/LLVM.cmake

Modified: llvm/trunk/cmake/modules/LLVM.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/LLVM.cmake?rev=110763&r1=110762&r2=110763&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/LLVM.cmake (original)
+++ llvm/trunk/cmake/modules/LLVM.cmake Tue Aug 10 19:51:32 2010
@@ -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_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 )

Modified: llvm/trunk/cmake/modules/LLVMConfig.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/LLVMConfig.cmake?rev=110763&r1=110762&r2=110763&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/LLVMConfig.cmake (original)
+++ llvm/trunk/cmake/modules/LLVMConfig.cmake Tue Aug 10 19:51:32 2010
@@ -53,7 +53,7 @@
 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)
 
 





More information about the llvm-commits mailing list