Commit ced2b602 authored by MichaelGrupp's avatar MichaelGrupp

Compatibility with OpenCV 3.x

imread has moved from highgui to the imgcodecs module in version 3.0.
parent 3a39a178
...@@ -3,6 +3,10 @@ cmake_minimum_required(VERSION 2.8.10) ...@@ -3,6 +3,10 @@ cmake_minimum_required(VERSION 2.8.10)
# The examples need a few additional dependencies (e.g. boost filesystem and OpenCV highgui): # The examples need a few additional dependencies (e.g. boost filesystem and OpenCV highgui):
find_package(OpenCV 2.4.3 REQUIRED core imgproc highgui) find_package(OpenCV 2.4.3 REQUIRED core imgproc highgui)
if("${OpenCV_VERSION_MAJOR}$" EQUAL 3)
message(STATUS "OpenCV 3.x detected - including imgcodecs for compatibility")
find_package(OpenCV 3.0.0 REQUIRED core imgproc highgui imgcodecs)
endif()
message(STATUS "OpenCV include dir found at ${OpenCV_INCLUDE_DIRS}") message(STATUS "OpenCV include dir found at ${OpenCV_INCLUDE_DIRS}")
message(STATUS "OpenCV lib dir found at ${OpenCV_LIB_DIR}") message(STATUS "OpenCV lib dir found at ${OpenCV_LIB_DIR}")
# This allows us to compile in RelWithDebInfo. It'll use the Release-version of OpenCV: # This allows us to compile in RelWithDebInfo. It'll use the Release-version of OpenCV:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment