CMake: Fix compatibility with CMake 3.0

`x GREATER_EQUAL y` wasn't added until 3.7, so
instead this uses `NOT x LESS y`
This commit is contained in:
Sam Edwards 2019-01-13 13:00:56 -07:00
parent 052004d06b
commit 0ff6787c1c
1 changed files with 4 additions and 3 deletions

View File

@ -496,10 +496,11 @@ package_option(OPENCV
package_status(OPENCV "OpenCV")
if(OpenCV_VERSION_MAJOR GREATER_EQUAL 3)
# CMake <3.7 doesn't support GREATER_EQUAL, so this uses NOT LESS instead.
if(NOT OpenCV_VERSION_MAJOR LESS 3)
set(OPENCV_VER_3 ON)
elseif(OpenCV_VERSION_MAJOR GREATER_EQUAL 2 AND
OpenCV_VERSION_MINOR GREATER_EQUAL 3)
elseif(NOT OpenCV_VERSION_MAJOR LESS 2 AND
NOT OpenCV_VERSION_MINOR LESS 3)
set(OPENCV_VER_23 ON)
endif()