How to include OpenCV libraries in CMake Makefile

余生长醉 提交于 2019-12-04 02:57:29

You need to add the library names in the TARGET_LINK_LIBRARIES command, but you need to add them without the lib prefix. For example:

include_directories(${DIR}/headers /opt/local/include)
link_directories (${DIR}/src/utils /opt/local/lib)

ADD_EXECUTABLE(sample sample.cpp)
TARGET_LINK_LIBRARIES(sample opencv_core opencv_imgproc opencv_video ${EXTERNAL_LIBS})
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!