FetchContent: Support use of the module before "project()" command

Co-authored-by: Craig Scott <craig.scott@crascit.com>
Co-authored-by: Brad King <brad.king@kitware.com>
This commit is contained in:
Jean-Christophe Fillion-Robin
2017-11-07 09:50:02 -05:00
parent 277994eb43
commit b551beb6fa

View File

@@ -754,7 +754,9 @@ function(__FetchContent_directPopulate contentName)
list(APPEND generatorOpts "-T${CMAKE_GENERATOR_TOOLSET}")
endif()
list(APPEND generatorOpts "-DCMAKE_MAKE_PROGRAM:FILE=${CMAKE_MAKE_PROGRAM}")
if(CMAKE_MAKE_PROGRAM)
list(APPEND generatorOpts "-DCMAKE_MAKE_PROGRAM:FILEPATH=${CMAKE_MAKE_PROGRAM}")
endif()
else()
# Likely we've been invoked via CMake's script mode where no