+# This file provides information and services to the final user.
+
set(LLVM_COMMON_DEPENDS @LLVM_COMMON_DEPENDS@)
set(llvm_libs @llvm_libs@)
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 )
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)