[cmake] optimize opencv.cmake to ensure find_package take affect (#302)

* update reademe_cn link

* [fix] # Win/Linux/Mac  specified opencv path unable to take effect

* Update opencv.cmake
This commit is contained in:
ChaoII
2022-09-28 19:07:00 +08:00
committed by GitHub
parent c5f85de356
commit 9af0e93af6

View File

@@ -132,7 +132,8 @@ if(OPENCV_DIRECTORY)
endif()
# Win/Linux/Mac
else()
find_package(OpenCV REQUIRED PATHS ${OPENCV_DIRECTORY})
set(OpenCV_DIR ${OPENCV_DIRECTORY})
find_package(OpenCV REQUIRED PATHS ${OpenCV_DIR})
include_directories(${OpenCV_INCLUDE_DIRS})
list(APPEND DEPEND_LIBS ${OpenCV_LIBS})
endif()