1
我正在等待来自外部源的库的调试版本,他们已经提供了发布版本。CMake抱怨在构建版本时找不到调试库
我们使用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
这是预期的行为?如果不更改我们的查找模块或在每次使用之前强制设置foo变量,我可以避免这个问题吗?