From 43d6384c3810e89823b11c7c751eb2856e780914 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Sun, 9 Feb 2014 16:35:51 +0000 Subject: Provide LLVMConfig in both build and install tree Create separate package configuration files "LLVMConfig.cmake" for the LLVM build and install trees so that each can have information specific to its tree. Configure each with the corresponding include, lib, and cmake directories. Include the "LLVM-Config" API modules directly from the configured cmake modules directory. In the install tree, compute the installation prefix relative to the file location. In the build tree, provide information specific to the build tree for use by tools like Clang that can build externally against the LLVM build tree. Prefix such values in "LLVM_BUILD_" and comment them as such. Contributed by Brad King. llvm-svn: 201048 --- llvm/cmake/modules/LLVMConfig.cmake.in | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'llvm/cmake/modules/LLVMConfig.cmake.in') diff --git a/llvm/cmake/modules/LLVMConfig.cmake.in b/llvm/cmake/modules/LLVMConfig.cmake.in index 224a26352d3..4687838a1e8 100644 --- a/llvm/cmake/modules/LLVMConfig.cmake.in +++ b/llvm/cmake/modules/LLVMConfig.cmake.in @@ -1,5 +1,7 @@ # This file provides information and services to the final user. +@LLVM_CONFIG_CODE@ + set(LLVM_VERSION_MAJOR @LLVM_VERSION_MAJOR@) set(LLVM_VERSION_MINOR @LLVM_VERSION_MINOR@) set(LLVM_PACKAGE_VERSION @PACKAGE_VERSION@) @@ -36,11 +38,9 @@ set(HAVE_LIBZ @HAVE_LIBZ@) set(LLVM_ON_UNIX @LLVM_ON_UNIX@) set(LLVM_ON_WIN32 @LLVM_ON_WIN32@) -set(LLVM_INSTALL_PREFIX "@LLVM_INSTALL_PREFIX@") -set(LLVM_INCLUDE_DIRS ${LLVM_INSTALL_PREFIX}/include) -set(LLVM_LIBRARY_DIRS ${LLVM_INSTALL_PREFIX}/lib) +set(LLVM_INCLUDE_DIRS "@LLVM_CONFIG_INCLUDE_DIRS@") +set(LLVM_LIBRARY_DIRS "@LLVM_CONFIG_LIBRARY_DIRS@") set(LLVM_DEFINITIONS "-D__STDC_LIMIT_MACROS" "-D__STDC_CONSTANT_MACROS") +set(LLVM_CMAKE_DIR "@LLVM_CONFIG_CMAKE_DIR@") -get_filename_component(_SELF_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) -include(${_SELF_DIR}/LLVM-Config.cmake) -unset(_SELF_DIR) +include(${LLVM_CMAKE_DIR}/LLVM-Config.cmake) -- cgit v1.2.3