Home cmake find_package (OpenCV) always use OpenCV 2.4 even I specify PATHS to OpenCV 3.3
 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.