MantisBT - CMake
View Issue Details
0013159CMakeModulespublic2012-04-22 15:142012-05-22 11:24
Matthew McCormick 
Brad King 
normalminoralways
closedfixed 
CMake 2.8.8 
CMake 2.8.9CMake 2.8.9 
0013159: Ninja generator + non-CMake Makefile ExternalProject fails.
A Ninja generator is used with a non-CMake External project, then the build command is not passed in a way that is recognized by Ninja. It tries to use '$(MAKE)', but ninja does not like the '$', and $(MAKE) is likely not available? The explicit 'make' was replaced in the attached patch.
Configure ITK with Ninja. Turn on ITK_WRAP_PYTHON. The failure occurs with the ExternalProject build of SWIG.
patch attached
No tags attached.
patch 0001-ExternalProject-Fix-build-command-for-Ninja-make.patch (1,226) 2012-04-22 15:14
https://public.kitware.com/Bug/file/4314/0001-ExternalProject-Fix-build-command-for-Ninja-make.patch
patch 0001-ExternalProject-Fix-build-command-for-Ninja-make.2.patch (1,227) 2012-05-21 14:51
https://public.kitware.com/Bug/file/4333/0001-ExternalProject-Fix-build-command-for-Ninja-make.2.patch
Issue History
2012-04-22 15:14Matthew McCormickNew Issue
2012-04-22 15:14Matthew McCormickFile Added: 0001-ExternalProject-Fix-build-command-for-Ninja-make.patch
2012-04-23 08:26David ColeAssigned To => David Cole
2012-04-23 08:26David ColeStatusnew => assigned
2012-04-23 09:55Bill HoffmanNote Added: 0029308
2012-04-23 10:00Bill HoffmanNote Edited: 0029308bug_revision_view_page.php?bugnote_id=29308#r625
2012-04-23 10:56Matthew McCormickNote Added: 0029314
2012-05-21 14:51Matthew McCormickFile Added: 0001-ExternalProject-Fix-build-command-for-Ninja-make.2.patch
2012-05-21 14:52Matthew McCormickNote Added: 0029532
2012-05-21 15:07David ColeTarget Version => CMake 2.8.9
2012-05-21 15:08David ColeAssigned ToDavid Cole => Brad King
2012-05-21 15:08David ColeNote Added: 0029534
2012-05-21 19:00Brad KingNote Added: 0029539
2012-05-21 19:00Brad KingStatusassigned => resolved
2012-05-21 19:00Brad KingFixed in Version => CMake 2.8.9
2012-05-21 19:00Brad KingResolutionopen => fixed
2012-05-22 11:24Matthew McCormickNote Added: 0029544
2012-05-22 11:24Matthew McCormickStatusresolved => closed

Notes
(0029308)
Bill Hoffman   
2012-04-23 09:55   
(edited on: 2012-04-23 10:00)
OK, I get it now...

    else() # if(cfg_cmd_id STREQUAL "configure")
      # Non-CMake project. Guess "make" and "make install" and "make test".
      # But use "$(MAKE)" to get recursive parallel make.
      set(cmd "$(MAKE)")

The code should make sure that a makefile generator is being used before using $(MAKE)

More like this:

+ if("${CMAKE_GENERATOR}" MATCHES "Makefiles")
+ # To try to get the parallel arguments.
+ set(cmd "$(MAKE)")
+ else()
+ # use regular make command if generator is not make based
+ set(cmd "make")
+ endif()
if(

(0029314)
Matthew McCormick   
2012-04-23 10:56   
Yes, that looks good.
(0029532)
Matthew McCormick   
2012-05-21 14:52   
Uploaded a patch with Bill's suggestion. It is a slight improvement because it will help any future non-Ninja cases where "$(MAKE)" is not available.
(0029534)
David Cole   
2012-05-21 15:08   
Brad, do you think Matt's latest patch is the right fix for this issue...?
(0029539)
Brad King   
2012-05-21 19:00   
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c9097c74 [^]
(0029544)
Matthew McCormick   
2012-05-22 11:24   
Excellent. Thanks.