ccmake output corrupted by execute_process() output
If you have output coming from execute_process()
, it is captured fine for cmake
and in the cmake GUI. But for the ccmake
ncurses dialog, the newlines are not handled correctly. They don't seem to have carriage returns, just newlines. The text doesn't seem to get captured properly and as a result the output spills over lines and frequently just makes a mess of the display. The following simple project can be used to demonstrate the problem:
cmake_minimum_required(VERSION 3.15)
project(subbuildtest)
message("Starting sub-process...")
execute_process(COMMAND ls -la)
execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 2) # So you get a chance to see the corruption
message("End of sub-process")
For best results, run the above from a directory that has a reasonable number of files in it. I had to add a sleep to the above to give a chance to see it, but in a real project, the sub-process might take non-trivial time and the log is a mess while that is occurring.
The work in !3942 (merged) at the moment changes the behavior, but the underlying issue is still there.