summaryrefslogtreecommitdiff
path: root/Modules/FetchContent.cmake
diff options
context:
space:
mode:
authorAlex Turbov <i.zaufi@gmail.com>2019-12-08 02:39:02 +0200
committerAlex Turbov <i.zaufi@gmail.com>2019-12-10 16:43:27 +0200
commit24fdd51f4503ccee33c07881cc8dd487cdc8b347 (patch)
treeff07504a0782e3a79fb996594d9fcbcabf98ecf0 /Modules/FetchContent.cmake
parent90e3e2a7778dc0ec5b421e9657ec49936a3cf174 (diff)
downloadcmake-24fdd51f4503ccee33c07881cc8dd487cdc8b347.tar.gz
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 5716b0112f..f3e1b51ff9 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} .