Browse Source

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 years ago
parent
commit
0d7086e3da
1 changed files with 3 additions and 1 deletions
  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