无法为目标错误CMakeLists指定链接库

时间:2017-10-31 08:50:59

标签: c++ cmake

我的Cmake给了我以下错误:

CMake Error at ros_halcon_bridge/CMakeLists.txt:21 (target_link_libraries):
  Cannot specify link libraries for target "treshhold," which is not built by
  this project.

我的Cmake文件如下:

add_executable(treshhold src/main.cpp)
add_dependencies(treshhold ${PROJECT_NAME})
target_link_libraries(treshhold ${PROJECT_NAME})
target_link_libraries(treshhold ${catkin_LIBRARIES})

include_directories(/opt/halcon/lib/x64-linux)
target_link_libraries(treshhold, hAcqArgos3D-P1xx.so)

1 个答案:

答案 0 :(得分:2)

我认为问题是,之后的treshhold,。尝试:

target_link_libraries(treshhold hAcqArgos3D-P1xx.so)