【发布时间】:2021-02-12 10:19:23
【问题描述】:
我在我的项目中使用来自导入目标 assimp::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/assimp-5.0/assimpTargets.cmake 中的相应行。属性IMPORTED_CONFIGURATIONS 的assimp::assimp 目标只有RELEASE 值并且没有IMPORTED_LOCATION_DEBUG 属性,只有IMPORTED_LOCATION_RELEASE。
【问题讨论】: