我想通过CMakeLists.txt使用OpenCV 3,CMakeLists.txt如下:
set(OpenCV_ROOT /usr/local/opencv3)
set(OpenCV_INCLUDE_DIRS ${OpenCV_ROOT}/include)
set(OpenCV_LIBRARIES "${OpenCV_ROOT}/lib")
message("find ${OpenCV_INCLUDE_DIRS}")
.....
include_directories(${OpenCV_INCLUDE_DIRS})
target_link_libraries(main ${OpenCV_LIBRARIES})
在以下位置找到OpenCV:/ usr / local / include / opencv; / usr / local / include
但是OpenCV 3的路径是/ usr / local / opencv3。看起来 指定的路径不起作用,CMakeLists.txt使用默认的opencv 2.4而不是OpenCV 3.
如何解决这个问题呢?我整天都在努力。