Skip to content
Snippets Groups Projects
Commit 8c26b7d0 authored by MichaelGrupp's avatar MichaelGrupp
Browse files

Include appropriate libraries for OpenCV 2.x or 3.x

imread has moved from highgui to the imgcodecs module in version 3.0.
parent ced2b602
No related branches found
No related tags found
No related merge requests found
...@@ -2,10 +2,12 @@ project(examples) ...@@ -2,10 +2,12 @@ project(examples)
cmake_minimum_required(VERSION 2.8.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) if("${OpenCV_VERSION_MAJOR}$" EQUAL 2)
if("${OpenCV_VERSION_MAJOR}$" EQUAL 3) message(STATUS "OpenCV 2.x detected")
find_package(OpenCV 2.4.3 REQUIRED core imgproc highgui)
elseif("${OpenCV_VERSION_MAJOR}$" EQUAL 3)
message(STATUS "OpenCV 3.x detected - including imgcodecs for compatibility") message(STATUS "OpenCV 3.x detected - including imgcodecs for compatibility")
find_package(OpenCV 3.0.0 REQUIRED core imgproc highgui imgcodecs) find_package(OpenCV 3.0.0 REQUIRED core imgproc imgcodecs)
endif() 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}")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment