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變量,我可以避免這個問題嗎?