CMake not redirecting stderr with execute_process

拈花ヽ惹草 提交于 2019-12-08 18:07:29

Specifying the same file for both OUTPUT_FILE and ERROR_FILE has only recently been added in CMake 3.3. See release notes.

As a work-around for earlier versions, use the options OUTPUT_VARIABLE and ERROR_VARIABLE with the same variable and then write the contents of the variable to the file, e.g.:

execute_process( 
    COMMAND "${EXE}" ${ARGS}
    ERROR_VARIABLE _testOut
    OUTPUT_VARIABLE _testOut
)
file (WRITE "test${ID}.out" "${_testOut}")
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!