1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

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.

llvm-svn: 110560
This commit is contained in:
Oscar Fuentes 2010-08-09 03:26:43 +00:00
parent d8b4e8da0f
commit d45ea50baa
4 changed files with 39 additions and 0 deletions

View File

@ -361,6 +361,8 @@ add_subdirectory(tools)
option(LLVM_BUILD_EXAMPLES "Build LLVM example programs." OFF)
add_subdirectory(examples)
add_subdirectory(cmake/modules)
install(DIRECTORY include/
DESTINATION include
FILES_MATCHING

View File

@ -0,0 +1,11 @@
set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/share/llvm/cmake")
configure_file(
LLVM.cmake
${llvm_cmake_builddir}/LLVM.cmake)
install(FILES
${llvm_cmake_builddir}/LLVM.cmake
LLVMConfig.cmake
LLVMLibDeps.cmake
DESTINATION share/llvm/cmake)

19
cmake/modules/LLVM.cmake Normal file
View File

@ -0,0 +1,19 @@
set(LLVM_COMMON_DEPENDS @LLVM_COMMON_DEPENDS@)
set(llvm_libs @llvm_libs@)
set(llvm_lib_targets @llvm_lib_targets@)
set(LLVM_TARGETS_TO_BUILD @LLVM_TARGETS_TO_BUILD@)
set(LLVM_TOOLS_BINARY_DIR @LLVM_TOOLS_BINARY_DIR@)
set(HAVE_LLVM_CONFIG @HAVE_LLVM_CONFIG@)
if( NOT EXISTS LLVMConfig.cmake )
set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
"@LLVM_SOURCE_DIR@/cmake/modules")
endif()
include( LLVMConfig )

View File

@ -49,6 +49,13 @@ function(explicit_llvm_config executable)
endfunction(explicit_llvm_config)
# This is a variant intended for the final user:
function(llvm_map_components_to_libraries OUT_VAR)
explicit_map_components_to_libraries(result ${ARGN})
set( ${OUT_VAR} ${result} )
endfunction(llvm_map_components_to_libraries)
function(explicit_map_components_to_libraries out_libs)
set( link_components ${ARGN} )
foreach(c ${link_components})