Преглед изворни кода

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 година
родитељ
комит
0d7086e3da
1 измењених фајлова са 3 додато и 1 уклоњено
  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}")
     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