llvm.org GIT mirror llvm / 6252e98
CMake: system for providing llvm-config-like features to the user. The user can use a cmake function for obtaining the LLVM libraries corresponding to a list of LLVM components. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110560 91177308-0d34-0410-b5e6-96231b3b80d8 Oscar Fuentes 9 years ago
4 changed file(s) with 39 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
360360 option(LLVM_BUILD_EXAMPLES "Build LLVM example programs." OFF)
361361 add_subdirectory(examples)
362362
363 add_subdirectory(cmake/modules)
364
363365 install(DIRECTORY include/
364366 DESTINATION include
365367 FILES_MATCHING
0 set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/share/llvm/cmake")
1
2 configure_file(
3 LLVM.cmake
4 ${llvm_cmake_builddir}/LLVM.cmake)
5
6 install(FILES
7 ${llvm_cmake_builddir}/LLVM.cmake
8 LLVMConfig.cmake
9 LLVMLibDeps.cmake
10 DESTINATION share/llvm/cmake)
0 set(LLVM_COMMON_DEPENDS @LLVM_COMMON_DEPENDS@)
1
2 set(llvm_libs @llvm_libs@)
3
4 set(llvm_lib_targets @llvm_lib_targets@)
5
6 set(LLVM_TARGETS_TO_BUILD @LLVM_TARGETS_TO_BUILD@)
7
8 set(LLVM_TOOLS_BINARY_DIR @LLVM_TOOLS_BINARY_DIR@)
9
10 set(HAVE_LLVM_CONFIG @HAVE_LLVM_CONFIG@)
11
12 if( NOT EXISTS LLVMConfig.cmake )
13 set(CMAKE_MODULE_PATH
14 ${CMAKE_MODULE_PATH}
15 "@LLVM_SOURCE_DIR@/cmake/modules")
16 endif()
17
18 include( LLVMConfig )
4646 explicit_map_components_to_libraries(LIBRARIES ${link_components})
4747 target_link_libraries(${executable} ${LIBRARIES})
4848 endfunction(explicit_llvm_config)
49
50
51 # This is a variant intended for the final user:
52 function(llvm_map_components_to_libraries OUT_VAR)
53 explicit_map_components_to_libraries(result ${ARGN})
54 set( ${OUT_VAR} ${result} )
55 endfunction(llvm_map_components_to_libraries)
4956
5057
5158 function(explicit_map_components_to_libraries out_libs)