[cmake] Declare LLVM_CMAKE_PATH for use in subprojects
authorMichal Gorny <mgorny@gentoo.org>
Wed, 19 Oct 2016 12:18:34 +0000 (12:18 +0000)
committerMichal Gorny <mgorny@gentoo.org>
Wed, 19 Oct 2016 12:18:34 +0000 (12:18 +0000)
commite22b7f5aead4a4dd0afa2f5d6d13986d5f000de5
treeb61ad09b880f2e4975548b889b9c2d89932469a9
parentfbfd173447b64d9d73c44cf47bafeb68e8139e5a
[cmake] Declare LLVM_CMAKE_PATH for use in subprojects

Declare the LLVM_CMAKE_PATH to the source directory location of CMake
files, in order to make it possible to easily use them in subprojects.
Such a variable is already declared in most of LLVM projects
(and inconsistently mixed with direct source tree references), including
Clang, LLDB, compiler-rt, libcxx... Declaring it inside main LLVM tree
makes it possible to avoid having to declare fallback values or use
conditionals in those projects.

It should be noted that in some of the subprojects LLVM_CMAKE_PATH is
used to reference generated LLVMConfig.cmake file. However, these
references are conditional to stand-alone builds and explicitly
including this file is unnecessary in combined builds.

Differential Revision: https://reviews.llvm.org/D25724

llvm-svn: 284581
llvm/CMakeLists.txt
llvm/lib/LTO/CMakeLists.txt