MantisBT - CMake
View Issue Details
0013067CMake(No Category)public2012-03-26 10:562012-08-09 17:10
Matthew McCormick 
Peter Collingbourne 
normalmajoralways
closedfixed 
Linux
 
CMake 2.8.9CMake 2.8.9 
0013067: Ninja: Invalid build.ninja after hitting CMake error. "unknown build rule 'RERUN_CMAKE'"
(Using CMake master (0000046:0000002.8.8rc1))

I successfully generated a project with the Ninja generator.

Then, I edit the CMakeLists.txt and introduce and error (as I often do ;-P), e.g., a non-existing file name to add_executable:

$ ninja
[1/1] Re-running CMake...
FAILED: /home/matt/apps/cmake_rb/bin/cmake -H/home/matt/progs/calaTK -B/home/matt/apps/calatk_rdb
-- Configuring done
CMake Error at Code/Testing/CMakeLists.txt:231 (add_executable):
  Cannot find source file:

    calatkApplicationImageFileNameInputesTest.cxx

  Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
  .hxx .in .txx


-- Build files have been written to: /home/matt/apps/calatk_rdb
ninja: ERROR: rebuilding 'build.ninja': subcommand failed


I fix the error, then I re-run ninja, and:

$ ninja
ninja: ERROR: build.ninja:18: unknown build rule 'RERUN_CMAKE'
build build.ninja: RERUN_CMAKE | /home/matt/apps/calatk_rdb/CMakeFiles/C...
                 ^ near here

build.ninja is attached

Running cmake manually fixes the error, but it would be nice if that was not necessary.
see above
No tags attached.
? build.ninja (22,888) 2012-03-26 10:56
https://public.kitware.com/Bug/file/4267/build.ninja
? rules.ninja (430) 2012-03-26 11:06
https://public.kitware.com/Bug/file/4268/rules.ninja
Issue History
2012-03-26 10:56Matthew McCormickNew Issue
2012-03-26 10:56Matthew McCormickFile Added: build.ninja
2012-03-26 11:03Nicolas DespresNote Added: 0028971
2012-03-26 11:06Matthew McCormickFile Added: rules.ninja
2012-03-26 11:07Matthew McCormickNote Added: 0028972
2012-03-26 11:30Brad KingAssigned To => Peter Collingbourne
2012-03-26 11:30Brad KingStatusnew => assigned
2012-05-16 19:06Peter CollingbourneNote Added: 0029490
2012-05-21 14:33Matthew McCormickNote Added: 0029531
2012-07-03 05:55Peter KuemmelStatusassigned => resolved
2012-07-03 05:55Peter KuemmelResolutionopen => fixed
2012-08-09 16:53David ColeFixed in Version => CMake 2.8.9
2012-08-09 16:53David ColeTarget Version => CMake 2.8.9
2012-08-09 17:10Matthew McCormickStatusresolved => closed

Notes
(0028971)
Nicolas Despres   
2012-03-26 11:03   
Rules are defined in the rules.ninja file. Can you check/attach this file so that we can see if RERUN_CMAKE is present. Normally this file is included at the beginning of the build.ninja file.
(0028972)
Matthew McCormick   
2012-03-26 11:07   
File uploaded. It looks good to my naive eye. A ninja bug? I am using ninja master (abd33d5e3b).
(0029490)
Peter Collingbourne   
2012-05-16 19:06   
I've pushed a fix for this issue to next.
(0029531)
Matthew McCormick   
2012-05-21 14:33   
It looks like it has now been merged into master. I tested it, and it looks to fix my problem. Thank you!