ECHO_(OUTPUT|ERROR)_VARIABLE options to execute_process() only consider variables
The execute_process()
command is gaining new options ECHO_OUTPUT_VARIABLE
and ECHO_ERROR_VARIABLE
for the CMake 3.18 release (see !4383 (merged)). These new options are intended to make the command act like the Unix tee
command when capturing the content to variables. These options do not echo content if the output and error streams are being redirected to files instead of being captured to variables. It would be good to have options which enable echoing regardless of whether capturing is to variables or to files. This would provide consistent capabilities for both types of capturing.
Rather than add more options like ECHO_OUTPUT_FILE
and ECHO_ERROR_FILE
, I propose that these options be renamed ECHO_OUTPUT
and ECHO_ERROR
respectively and that they be made to work for when capturing to variables or to files. The execute_process()
command already has a large number of options, so avoiding adding any more than necessary would be good. There's also little reason to differentiate between the capture-to-variables and capture-to-files cases as far as echoing is concerned.
This would need to be done for the CMake 3.18 release since we would be changing the names of the options that are being introduced in that release. If we postpone to the next release, we end up having to support more options, which we should avoid to minimise complexity.