【发布时间】:2020-12-24 22:56:53
【问题描述】:
我事先硬编码了一个库路径,如果文件不存在,我想手动将路径设置为 NOTFOUND。
set(MY_LIB "path that doesn't exist")
if(NOT EXISTS "${MY_LIB}")
message("not found")
// set it back to NOTFOUND ??
endif()
if (MY_LIB)
// set flags
endif()
【问题讨论】:
-
set(MY_LIB "NOTFOUND")? -
以后会作为条件吗?
-
我不明白。 “服务”如何?具体如何?在哪个“条件”中?您的问题中的“条件”是
if语句吗? -
编辑了问题。条件表示代码中的第二个 if 语句。
-
阅读if cmake manual你会找到答案
标签: cmake unset file-not-found