瀏覽代碼

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 年之前
父節點
當前提交
b551beb6fa
共有 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