From b551beb6facee72d1c1af455a9e4e8ecc7be959f Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Tue, 7 Nov 2017 09:50:02 -0500 Subject: FetchContent: Support use of the module before "project()" command Co-authored-by: Craig Scott Co-authored-by: Brad King --- Modules/FetchContent.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Modules/FetchContent.cmake b/Modules/FetchContent.cmake index 132354f..98cdf6c 100644 --- a/Modules/FetchContent.cmake +++ b/Modules/FetchContent.cmake @@ -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 -- cgit v0.12