MantisBT - CMake
View Issue Details
0013220CMake(No Category)public2012-05-14 19:522012-10-01 13:23
Brian Helba 
Brad King 
normalminorhave not tried
closedfixed 
CMake 2.8.8 
CMake 2.8.9CMake 2.8.9 
0013220: In trace mode, evaluated 'elseif'/'else' commands are not printed
In trace mode ('--trace'), only the opening 'if' command of a conditional block is printed. If the opening 'if' command evaluates False, any subsequent 'elseif'/'else' statements will be evaluated by CMake ('else' is a trivial evaluation), but not printed.

Determining which 'elseif'/'else' commands were evaluated can still be done implicitly, by examining which set of consequent commands are evaluated. However, actually printing which 'elseif'/'else' commands are evaluated would make trace mode more usable and consistent (since 'if' evaluation is printed).
For "test.cmake":
  IF(0)
    COMMAND1()
  ELSEIF(0)
    COMMAND2()
  ELSEIF(1)
    COMMAND3()
  ELSE()
    COMMAND4()
  ENDIF()

Current output in trace mode ("cmake --trace -P test.cmake"):
  test.cmake(1): IF(0 )
  test.cmake(6): COMMAND3( )

Preferred output would be:
  test.cmake(1): IF(0 )
  test.cmake(3): ELSEIF(0 )
  test.cmake(5): ELSEIF(1 )
  test.cmake(6): COMMAND3( )
No tags attached.
patch 0001-Print-any-evaluated-elseif-else-commands-in-trace-mo.patch (4,090) 2012-05-15 14:54
https://public.kitware.com/Bug/file/4328/0001-Print-any-evaluated-elseif-else-commands-in-trace-mo.patch
Issue History
2012-05-14 19:52Brian HelbaNew Issue
2012-05-15 14:54Brian HelbaFile Added: 0001-Print-any-evaluated-elseif-else-commands-in-trace-mo.patch
2012-05-16 09:20Brad KingNote Added: 0029481
2012-05-16 09:20Brad KingAssigned To => Brad King
2012-05-16 09:20Brad KingStatusnew => resolved
2012-05-16 09:20Brad KingResolutionopen => fixed
2012-05-16 09:20Brad KingFixed in Version => CMake 2.8.9
2012-05-16 09:20Brad KingTarget Version => CMake 2.8.9
2012-10-01 13:23David ColeNote Added: 0031130
2012-10-01 13:23David ColeStatusresolved => closed

Notes
(0029481)
Brad King   
2012-05-16 09:20   
Thanks. Applied with minor whitespace and line length adjustments:

  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b3b095a9 [^]
(0031130)
David Cole   
2012-10-01 13:23   
Closing resolved issues that have not been updated in more than 4 months.