【发布时间】:2018-08-29 12:00:39
【问题描述】:
在我的 cmake 文件中,我使用 execute_process 运行命令。我想检查它是否失败。它不会向stderr 打印任何内容。
到目前为止,我一直在使用 bash 脚本来运行命令,然后使用 $? == 1 检查退出状态。
有没有办法用 cmake 做类似的事情?
execute_process(COMMAND "runThis")
if("{$?}" EQUAL 1)
message( FATAL_ERROR "Bad exit status")
endif()
我使用 cmake 3.12.1
【问题讨论】:
标签: cmake