Crascit/DownloadProject

Strange output formatting with ccmake

Closed this issue · 2 comments

When I configure in ccmake, some information about the DownloadProject is printed, but it oddly overlaps the normal ccmake menus:

ccmake

This goes away by using QUIET, but it seems like this isn't intended behavior without QUIET.

DownloadProject doesn't attempt to capture the output of its execute_process() calls, so the output should fall through to the console for the cmake run invoking it. When you use ccmake rather than cmake, I'm assuming it uses direct function calls internally rather than invoking cmake, so it is probably expecting to be able to capture cmake output via some internal method but is being thwarted by what execute_process() does. You could experiment with the various options to the execute_process() calls and hide the output, but if something goes wrong, you'd have to ensure that you still printed the output somewhere so the user had a chance of diagnosing the problem. It sounds like you've already started doing that with the OUTPUT_QUIET and/or ERROR_QUIET options. You probably want to use RESULT_VARIABLE, OUTPUT_VARIABLE and ERROR_VARIABLE instead and print the contents of the latter two if RESULT_VARIABLE indicates there was a problem.

FYI this behaviour is not specific to DownloadProject, it happens with pretty much anything that generates additional output that ccmake doesn't otherwise capture.