Cmake 无法在调试生成配置中使用assimp库
我在我的项目中使用导入目标的库AssimpCmake 无法在调试生成配置中使用assimp库,cmake,assimp,Cmake,Assimp,我在我的项目中使用导入目标的库AssimpAssimp::Assimp: find_package(assimp REQUIRED 5) target_link_libraries(${PROJECT_NAME} PUBLIC assimp::assimp) 在Debug配置中构建项目的链接阶段,我得到一个错误: src/renderer/CMakeFiles/renderer.dir/build.make:256:**目标模式不包含“%”。停下来 错误的原因是(在Archlinux上)我没有
Assimp::Assimp
:
find_package(assimp REQUIRED 5)
target_link_libraries(${PROJECT_NAME} PUBLIC assimp::assimp)
在Debug
配置中构建项目的链接阶段,我得到一个错误:
src/renderer/CMakeFiles/renderer.dir/build.make:256:**目标模式不包含“%”。停下来
错误的原因是(在Archlinux上)我没有
/usr/lib/cmake/assimp-5.0/assimpTargets debug.cmake
和/usr/lib/cmake/assimpTargets.cmake
中的相应行。属性IMPORTED\u CONFIGURATIONS
ofassimp::assimp
target只有RELEASE
值,没有IMPORTED\u LOCATION\u DEBUG
属性,只需IMPORTED\u LOCATION\u RELEASE
即可解决问题,需要添加:
set_target_properties(assimp::assimp PROPERTIES MAP_IMPORTED_CONFIG_DEBUG Release)
就在查找程序包之后