ExternalProject: Use $(MAKE) whenever possible.

ExternalProject_Add calls that did not explicitly request a
CMAKE_GENERATOR would not get recursive parallel make behavior.
This commit fixes that issue.
This commit is contained in:
David Cole 2010-07-23 13:51:37 -04:00
parent 0c084dd899
commit b62fe1242f
1 changed files with 5 additions and 3 deletions

View File

@ -563,8 +563,9 @@ function(_ep_get_build_command name step cmd_var)
if(cfg_cmd_id STREQUAL "cmake") if(cfg_cmd_id STREQUAL "cmake")
# CMake project. Select build command based on generator. # CMake project. Select build command based on generator.
get_target_property(cmake_generator ${name} _EP_CMAKE_GENERATOR) get_target_property(cmake_generator ${name} _EP_CMAKE_GENERATOR)
if("${cmake_generator}" MATCHES "Make" AND if("${CMAKE_GENERATOR}" MATCHES "Make" AND
"${cmake_generator}" STREQUAL "${CMAKE_GENERATOR}") ("${cmake_generator}" STREQUAL "${CMAKE_GENERATOR}" OR
NOT cmake_generator))
# The project uses the same Makefile generator. Use recursive make. # The project uses the same Makefile generator. Use recursive make.
set(cmd "$(MAKE)") set(cmd "$(MAKE)")
if(step STREQUAL "INSTALL") if(step STREQUAL "INSTALL")
@ -593,7 +594,8 @@ function(_ep_get_build_command name step cmd_var)
endif() endif()
else() # if(cfg_cmd_id STREQUAL "configure") else() # if(cfg_cmd_id STREQUAL "configure")
# Non-CMake project. Guess "make" and "make install" and "make test". # Non-CMake project. Guess "make" and "make install" and "make test".
set(cmd "make") # But use "$(MAKE)" to get recursive parallel make.
set(cmd "$(MAKE)")
if(step STREQUAL "INSTALL") if(step STREQUAL "INSTALL")
set(args install) set(args install)
endif() endif()