I would like to directly see the output of a command started by the EXECUTE_PROCESS
command on stdout while the program is running.
I have the following te
Try:
execute_process(COMMAND cmd /c dir)
instead. 'dir' is a built-in shell command. 'execute_process' expects a *.exe file name as it's first argument after COMMAND. (Or some exe available in the PATH.)
In fact, if you try to dig in and find out what's wrong with your original execute_process call...
execute_process(COMMAND dir RESULT_VARIABLE rv)
message("rv='${rv}'")
...you'll get this output:
rv='The system cannot find the file specified'
Which is pretty much what you'd get if you passed "dir" to the WIN32 CreateProcess call.