OSDN Git Service

[llvm] [cmake] Use current directory in GenerateVersionFromVCS
authorMichal Gorny <mgorny@gentoo.org>
Mon, 11 Feb 2019 09:07:07 +0000 (09:07 +0000)
committerMichal Gorny <mgorny@gentoo.org>
Mon, 11 Feb 2019 09:07:07 +0000 (09:07 +0000)
Find dependent scripts of GenerateVersionFromVCS in current directory
rather than ../../cmake/modules.  I do not see any reason why the former
would not work and The latter is incorrect when GenerateVersionFromVCS
is used from install directory (i.e. in stand-alone builds).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353674 91177308-0d34-0410-b5e6-96231b3b80d8

cmake/modules/GenerateVersionFromVCS.cmake

index a38480c..d8ec54d 100644 (file)
@@ -9,11 +9,9 @@
 # where "<NAME>" is substituted with the names specified in the input variables,
 # for each of the <NAME>_SOURCE_DIR given.
 
-get_filename_component(LLVM_DIR "${CMAKE_SCRIPT_MODE_FILE}" PATH)
-get_filename_component(LLVM_DIR "${LLVM_DIR}" PATH)
-get_filename_component(LLVM_DIR "${LLVM_DIR}" PATH)
+get_filename_component(LLVM_CMAKE_DIR "${CMAKE_SCRIPT_MODE_FILE}" PATH)
 
-list(APPEND CMAKE_MODULE_PATH "${LLVM_DIR}/cmake/modules")
+list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
 
 include(VersionFromVCS)