【发布时间】:2017-02-20 08:54:44
【问题描述】:
我正在等待来自外部源的库的调试版本,他们已经交付了发布版本。
我们使用 Find... 模块来定位库。现在结果如下:
optimized;libfoo.a;debug;foo-NOTFOUND
CMakeLists.txt 文件:
...
add_executable(main main.c)
target_link_libraries(main ${foo})
使用以下命令启动构建:
cmake source/dir -DCMAKE_BUILD_TYPE=Release
但是 cmake 仍然抱怨缺少调试库。
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
foo
linked by target "main" in directory source/dir
这是预期的行为吗?我可以在不更改我们的 Find 模块或在每次使用之前强制设置 foo 变量的情况下避免这个问题吗?
【问题讨论】:
标签: cmake