Detect OpenCV 4.x

This commit is contained in:
John Zhao
2018-06-05 15:00:44 +08:00
parent 9451fdd90c
commit 3e96e56d8b
2 changed files with 7 additions and 1 deletions

View File

@@ -19,8 +19,10 @@ find_package(OpenCV REQUIRED)
message(STATUS "Found OpenCV: ${OpenCV_VERSION}")
if(OpenCV_VERSION VERSION_LESS 3.0)
add_definitions(-DUSE_OPENCV2)
else()
elseif(OpenCV_VERSION VERSION_LESS 4.0)
add_definitions(-DUSE_OPENCV3)
else()
add_definitions(-DUSE_OPENCV4)
endif()
if(MSVC OR MSYS OR MINGW)