Sfoglia il codice sorgente

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

Co-authored-by: Craig Scott <[email protected]>
Co-authored-by: Brad King <[email protected]>
Jean-Christophe Fillion-Robin 8 anni fa
parent
commit
b551beb6fa
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 3 1
      Modules/FetchContent.cmake

+ 3 - 1
Modules/FetchContent.cmake

@@ -754,7 +754,9 @@ function(__FetchContent_directPopulate contentName)
       list(APPEND generatorOpts "-T${CMAKE_GENERATOR_TOOLSET}")
       list(APPEND generatorOpts "-T${CMAKE_GENERATOR_TOOLSET}")
     endif()
     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()
   else()
     # Likely we've been invoked via CMake's script mode where no
     # Likely we've been invoked via CMake's script mode where no