summaryrefslogtreecommitdiffstats
path: root/Modules/FetchContent.cmake
diff options
context:
space:
mode:
authorAlex Turbov <i.zaufi@gmail.com>2019-12-08 00:39:02 (GMT)
committerAlex Turbov <i.zaufi@gmail.com>2019-12-10 14:43:27 (GMT)
commit24fdd51f4503ccee33c07881cc8dd487cdc8b347 (patch)
treeff07504a0782e3a79fb996594d9fcbcabf98ecf0 /Modules/FetchContent.cmake
parent90e3e2a7778dc0ec5b421e9657ec49936a3cf174 (diff)
downloadCMake-24fdd51f4503ccee33c07881cc8dd487cdc8b347.zip
CMake-24fdd51f4503ccee33c07881cc8dd487cdc8b347.tar.gz
CMake-24fdd51f4503ccee33c07881cc8dd487cdc8b347.tar.bz2
Refactor: Replace CMAKE_CURRENT_LIST_DIR with CMAKE_CURRENT_FUNCTION_LIST_DIR
Some modules define an intermediate global scope visible variables to access "resource" files from functions. Now these variables could be eliminated.
Diffstat (limited to 'Modules/FetchContent.cmake')
-rw-r--r--Modules/FetchContent.cmake5
1 files changed, 1 insertions, 4 deletions
diff --git a/Modules/FetchContent.cmake b/Modules/FetchContent.cmake
index 5716b01..f3e1b51 100644
--- a/Modules/FetchContent.cmake
+++ b/Modules/FetchContent.cmake
@@ -596,9 +596,6 @@ current working directory.
#]=======================================================================]
-
-set(__FetchContent_privateDir "${CMAKE_CURRENT_LIST_DIR}/FetchContent")
-
#=======================================================================
# Recording and retrieving content details for later population
#=======================================================================
@@ -888,7 +885,7 @@ function(__FetchContent_directPopulate contentName)
# anything to be updated, so extra rebuilds of the project won't occur.
# Make sure to pass through CMAKE_MAKE_PROGRAM in case the main project
# has this set to something not findable on the PATH.
- configure_file("${__FetchContent_privateDir}/CMakeLists.cmake.in"
+ configure_file("${CMAKE_CURRENT_FUNCTION_LIST_DIR}/FetchContent/CMakeLists.cmake.in"
"${ARG_SUBBUILD_DIR}/CMakeLists.txt")
execute_process(
COMMAND ${CMAKE_COMMAND} ${generatorOpts} .