MantisBT - CMake
View Issue Details
0014645CMakeCMakepublic2013-12-12 11:462014-06-02 08:37
Nathan Climer 
Brad King 
normalminoralways
closedfixed 
PCFedora17
CMake 2.8.9 
CMake 3.0CMake 3.0 
0014645: exec_program and execute_process don't capture output when it does not end in a newline
When trying to capture output of a process, if the stream does not end in a new line, these commands cannot capture the output.
The following batch script shows the problem nicely

 
MESSAGE(STATUS "Outputting captured newline")
EXEC_PROGRAM(printf ARGS "\"output is shown\\n\"")

MESSAGE(STATUS "Outputting without newline")
EXEC_PROGRAM(printf ARGS "\"output is not shown\"")
No tags attached.
Issue History
2013-12-12 11:46Nathan ClimerNew Issue
2013-12-18 11:39Brad KingNote Added: 0034790
2013-12-18 11:39Brad KingAssigned To => Brad King
2013-12-18 11:39Brad KingStatusnew => resolved
2013-12-18 11:39Brad KingResolutionopen => fixed
2013-12-18 11:39Brad KingFixed in Version => CMake 3.0
2013-12-18 11:39Brad KingTarget Version => CMake 3.0
2014-06-02 08:37Robert MaynardNote Added: 0036056
2014-06-02 08:37Robert MaynardStatusresolved => closed

Notes
(0034790)
Brad King   
2013-12-18 11:39   
The execute_process commands seems to work fine for this.

Since 2.8.12 was released CMake 'master' in Git replaced the underlying implementation of exec_program with the same infrastructure used by execute_process. Local testing says this issue was fixed by that.

Please try with CMake 'master' built from source, or try a nightly 'next' binary from:

 http://www.cmake.org/files/dev/?C=M;O=D [^]
(0036056)
Robert Maynard   
2014-06-02 08:37   
Closing resolved issues that have not been updated in more than 4 months.