diff options
author | Craig Scott <craig.scott@crascit.com> | 2020-05-29 11:14:47 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-05-29 16:10:32 (GMT) |
commit | 1236590507c38ae85847257e41776d0a9935024b (patch) | |
tree | d68454a5353651539c4b5e88c7e0473fb3cab0ca /Modules | |
parent | e71c2807ba173f80df5b1fceb0d84a0bda4e5e88 (diff) | |
download | CMake-1236590507c38ae85847257e41776d0a9935024b.zip CMake-1236590507c38ae85847257e41776d0a9935024b.tar.gz CMake-1236590507c38ae85847257e41776d0a9935024b.tar.bz2 |
FetchContent: Pass through CMAKE_EP_GIT_REMOTE_UPDATE_STRATEGY if set
This was missed when the initial support was added in
commit 0aea435aa1 (ExternalProject: Provide choice of
git update strategies, 2020-02-12)
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FetchContent.cmake | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/Modules/FetchContent.cmake b/Modules/FetchContent.cmake index 69f2513..e05ca96 100644 --- a/Modules/FetchContent.cmake +++ b/Modules/FetchContent.cmake @@ -930,16 +930,16 @@ ExternalProject_Add_Step(${contentName}-populate copyfile endif() if(CMAKE_GENERATOR) - set(generatorOpts "-G${CMAKE_GENERATOR}") + set(subCMakeOpts "-G${CMAKE_GENERATOR}") if(CMAKE_GENERATOR_PLATFORM) - list(APPEND generatorOpts "-A${CMAKE_GENERATOR_PLATFORM}") + list(APPEND subCMakeOpts "-A${CMAKE_GENERATOR_PLATFORM}") endif() if(CMAKE_GENERATOR_TOOLSET) - list(APPEND generatorOpts "-T${CMAKE_GENERATOR_TOOLSET}") + list(APPEND subCMakeOpts "-T${CMAKE_GENERATOR_TOOLSET}") endif() if(CMAKE_MAKE_PROGRAM) - list(APPEND generatorOpts "-DCMAKE_MAKE_PROGRAM:FILEPATH=${CMAKE_MAKE_PROGRAM}") + list(APPEND subCMakeOpts "-DCMAKE_MAKE_PROGRAM:FILEPATH=${CMAKE_MAKE_PROGRAM}") endif() else() @@ -947,7 +947,12 @@ ExternalProject_Add_Step(${contentName}-populate copyfile # generator is set (and hence CMAKE_MAKE_PROGRAM could not be # trusted even if provided). We will have to rely on being # able to find the default generator and build tool. - unset(generatorOpts) + unset(subCMakeOpts) + endif() + + if(DEFINED CMAKE_EP_GIT_REMOTE_UPDATE_STRATEGY) + list(APPEND subCMakeOpts + "-DCMAKE_EP_GIT_REMOTE_UPDATE_STRATEGY=${CMAKE_EP_GIT_REMOTE_UPDATE_STRATEGY}") endif() # Create and build a separate CMake project to carry out the population. @@ -958,7 +963,7 @@ ExternalProject_Add_Step(${contentName}-populate copyfile configure_file("${CMAKE_CURRENT_FUNCTION_LIST_DIR}/FetchContent/CMakeLists.cmake.in" "${ARG_SUBBUILD_DIR}/CMakeLists.txt") execute_process( - COMMAND ${CMAKE_COMMAND} ${generatorOpts} . + COMMAND ${CMAKE_COMMAND} ${subCMakeOpts} . RESULT_VARIABLE result ${outputOptions} WORKING_DIRECTORY "${ARG_SUBBUILD_DIR}" |