[CMake] Handling real-time output from execute_process

Person Withhats personwithhats2 at gmail.com
Fri Dec 21 20:30:17 EST 2018


Hey there!

I'm running a script that downloads some files and untars them. This takes
a while but it outputs progress. Unfortunately I can't get the output to
show up in real-time with CMake GUI or CLI.

Current workaround to see output live, loses it in log though......
    execute_process(COMMAND "cmd" /c "start /wait download_sdks.exe"
    WORKING_DIRECTORY "${SCRIPT_DIR}"
    OUTPUT_VARIABLE OUT
    RESULT_VARIABLE RES)

Exit code is always 0 no matter what I do or how I get this set up. I want
to see the output as it's running (preferably in same cmake window) and for
the GUI stop-button to properly stop the script instead of hanging until
script ends by itself.

Right now I can get the output at the end but after 1.5 hours of
untarring/etc. I'd be worried if it wasn't just frozen......

This is for windows 10 ofc and the .exe file is PyInstalled. Works fine
double-clicking (launches terminal/etc.) but Cmake....ugh......

tl;dr script runs and works fine as usual but I can't see output *while*
it's running instead of after.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20181221/d4330ad6/attachment.html>


More information about the CMake mailing list