[llvm] r280380 - [CMake] Revive LLVM_*_DIRS variables
Chris Bieneman via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 1 09:43:40 PDT 2016
Author: cbieneman
Date: Thu Sep 1 11:43:39 2016
New Revision: 280380
URL: http://llvm.org/viewvc/llvm-project?rev=280380&view=rev
Log:
[CMake] Revive LLVM_*_DIRS variables
This is a partial revert of r280013. Brad King pointed out these variable names are matching CMake conventions, so we should preserve them.
I've also added a direct mapping of the LLVM_*_DIR variables which we need to make projects support building in and out of tree.
Modified:
llvm/trunk/cmake/modules/LLVMConfig.cmake.in
llvm/trunk/docs/CMake.rst
Modified: llvm/trunk/cmake/modules/LLVMConfig.cmake.in
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/LLVMConfig.cmake.in?rev=280380&r1=280379&r2=280380&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/LLVMConfig.cmake.in (original)
+++ llvm/trunk/cmake/modules/LLVMConfig.cmake.in Thu Sep 1 11:43:39 2016
@@ -52,8 +52,15 @@ set(LLVM_ON_WIN32 @LLVM_ON_WIN32@)
set(LLVM_LIBDIR_SUFFIX @LLVM_LIBDIR_SUFFIX@)
+set(LLVM_INCLUDE_DIRS "@LLVM_CONFIG_INCLUDE_DIRS@")
+set(LLVM_LIBRARY_DIRS "@LLVM_CONFIG_LIBRARY_DIRS@")
+
+# These variables are duplicated, but they must match the LLVM variables of the
+# same name. The variables ending in "S" could some day become lists, and are
+# preserved for convention and compatibility.
set(LLVM_INCLUDE_DIR "@LLVM_CONFIG_INCLUDE_DIRS@")
set(LLVM_LIBRARY_DIR "@LLVM_CONFIG_LIBRARY_DIRS@")
+
set(LLVM_DEFINITIONS "@LLVM_DEFINITIONS@")
set(LLVM_CMAKE_DIR "@LLVM_CONFIG_CMAKE_DIR@")
set(LLVM_BINARY_DIR "@LLVM_CONFIG_BINARY_DIR@")
Modified: llvm/trunk/docs/CMake.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CMake.rst?rev=280380&r1=280379&r2=280380&view=diff
==============================================================================
--- llvm/trunk/docs/CMake.rst (original)
+++ llvm/trunk/docs/CMake.rst Thu Sep 1 11:43:39 2016
@@ -579,7 +579,7 @@ and uses them to build a simple applicat
# you will need to enable C++11 support
# for your compiler.
- include_directories(${LLVM_INCLUDE_DIR})
+ include_directories(${LLVM_INCLUDE_DIRS})
add_definitions(${LLVM_DEFINITIONS})
# Now build our tools
@@ -636,8 +636,8 @@ include
This is set to ON if LLVM was built with run time type information (RTTI),
otherwise OFF.
-``LLVM_INCLUDE_DIR``
- Path to the root directory containing LLVM header files.
+``LLVM_INCLUDE_DIRS``
+ A list of include paths to directories containing LLVM header files.
``LLVM_PACKAGE_VERSION``
The LLVM version. This string can be used with CMake conditionals, e.g., ``if
@@ -681,7 +681,7 @@ Contents of ``<project dir>/CMakeLists.t
find_package(LLVM REQUIRED CONFIG)
add_definitions(${LLVM_DEFINITIONS})
- include_directories(${LLVM_INCLUDE_DIR})
+ include_directories(${LLVM_INCLUDE_DIRS})
add_subdirectory(<pass name>)
More information about the llvm-commits
mailing list