对于错误: CMake Error at D:\VSA_paper\VSA\CMakeLists.txt:48 (target_link_libraries): 1> [CMake] Cannot specify link libraries for target “variational” which is not built by this project.
查到的资料都说target_link_libraries没有放到add_executable后面,但我的不是这个问题 以下是错误定位到的代码段
add_executable(${PROJECT_NAME}_bin ${SRCFILES} ${HEAD_FILES} ${RCC_FILES} ${WRAP_FILES} "gauss.h" "developable_degree.h")
target_link_libraries(${PROJECT_NAME} Qt5::Widgets Qt5::Core Qt5::Gui)
target_link_libraries(${PROJECT_NAME}_bin igl::core igl::opengl_glfw)
target_link_libraries(${PROJECT_NAME}_bin OpenMesh)
从错误“Cannot specify link libraries for target “variational” which is not built by this project.”可以看到项目名"variational"有误,应当为"variational_bin",解决办法就是把上面代码段中的${PROJECT_NAME}后面缺失的“_bin”加上 修改后的结果如下:
add_executable(${PROJECT_NAME}_bin ${SRCFILES} ${HEAD_FILES} ${RCC_FILES} ${WRAP_FILES} "gauss.h" "developable_degree.h")
#添加Qt5依赖项
target_link_libraries(${PROJECT_NAME}_bin Qt5::Widgets Qt5::Core Qt5::Gui)
target_link_libraries(${PROJECT_NAME}_bin igl::core igl::opengl_glfw)
target_link_libraries(${PROJECT_NAME}_bin OpenMesh)
|