Home cmake find_package (OpenCV) always use OpenCV 2.4 even I specify PATHS to OpenCV 3.3
Reply: 0

cmake find_package (OpenCV) always use OpenCV 2.4 even I specify PATHS to OpenCV 3.3

cupwater
1#
cupwater Published in 2017-12-06 12:25:50Z

I want to use OpenCV 3 through CMakeLists.txt, and the CMakeLists.txt is as following:

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})

find OpenCV in: /usr/local/include/opencv;/usr/local/include

But the path of OpenCV 3 is /usr/local/opencv3. It seems that the specified paths didn't work, and CMakeLists.txt use the default opencv 2.4 instead of OpenCV 3.

How to solve this problem? I have worked on it all day.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.296804 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO