1
0
Эх сурвалжийг харах

Merge topic 'fetchcontent-support-use-before-project-command'

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

Acked-by: Kitware Robot <[email protected]>
Merge-request: !1448
Craig Scott 8 жил өмнө
parent
commit
0d7086e3da

+ 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