Commit 0247a590 authored by Patrik Huber's avatar Patrik Huber

Use OpenCV 3 instead of 3.0.0

parent 49259eeb
...@@ -10,7 +10,7 @@ if("${OpenCV_VERSION_MAJOR}$" EQUAL 2) ...@@ -10,7 +10,7 @@ if("${OpenCV_VERSION_MAJOR}$" EQUAL 2)
find_package(OpenCV 2.4.3 REQUIRED core imgproc highgui) find_package(OpenCV 2.4.3 REQUIRED core imgproc highgui)
elseif("${OpenCV_VERSION_MAJOR}$" EQUAL 3) 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 imgcodecs) find_package(OpenCV 3 REQUIRED core imgproc imgcodecs)
endif() endif()
# 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:
set_target_properties(${OpenCV_LIBS} PROPERTIES MAP_IMPORTED_CONFIG_RELWITHDEBINFO RELEASE) set_target_properties(${OpenCV_LIBS} PROPERTIES MAP_IMPORTED_CONFIG_RELWITHDEBINFO RELEASE)
......
...@@ -5,8 +5,17 @@ cmake_minimum_required(VERSION 3.7.0) ...@@ -5,8 +5,17 @@ cmake_minimum_required(VERSION 3.7.0)
find_package(Matlab COMPONENTS MX_LIBRARY REQUIRED) find_package(Matlab COMPONENTS MX_LIBRARY REQUIRED)
# Dependencies of the modules: # Dependencies of the modules:
find_package(OpenCV 2.4.3 REQUIRED core) #check installed version in order to include the correct OpenCV libraries
#version variable is defined from project root's CMakeLists
if("${OpenCV_VERSION_MAJOR}$" EQUAL 2)
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")
find_package(OpenCV 3 REQUIRED core imgproc imgcodecs)
endif()
set_target_properties(${OpenCV_LIBS} PROPERTIES MAP_IMPORTED_CONFIG_RELWITHDEBINFO RELEASE) set_target_properties(${OpenCV_LIBS} PROPERTIES MAP_IMPORTED_CONFIG_RELWITHDEBINFO RELEASE)
if(MSVC) if(MSVC)
# The standard find_package for boost on Win finds the dynamic libs, so for dynamic linking to boost we need to #define: # The standard find_package for boost on Win finds the dynamic libs, so for dynamic linking to boost we need to #define:
add_definitions(-DBOOST_ALL_NO_LIB) # Don't use the automatic library linking by boost with VS (#pragma ...). Instead, we specify everything here in cmake. add_definitions(-DBOOST_ALL_NO_LIB) # Don't use the automatic library linking by boost with VS (#pragma ...). Instead, we specify everything here in cmake.
......
...@@ -11,7 +11,7 @@ if("${OpenCV_VERSION_MAJOR}$" EQUAL 2) ...@@ -11,7 +11,7 @@ if("${OpenCV_VERSION_MAJOR}$" EQUAL 2)
find_package(OpenCV 2.4.3 REQUIRED core imgproc) find_package(OpenCV 2.4.3 REQUIRED core imgproc)
elseif("${OpenCV_VERSION_MAJOR}$" EQUAL 3) 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 imgcodecs) find_package(OpenCV 3 REQUIRED core imgproc imgcodecs)
endif() endif()
# 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:
set_target_properties(${OpenCV_LIBS} PROPERTIES MAP_IMPORTED_CONFIG_RELWITHDEBINFO RELEASE) set_target_properties(${OpenCV_LIBS} PROPERTIES MAP_IMPORTED_CONFIG_RELWITHDEBINFO RELEASE)
......
...@@ -10,7 +10,7 @@ if("${OpenCV_VERSION_MAJOR}$" EQUAL 2) ...@@ -10,7 +10,7 @@ if("${OpenCV_VERSION_MAJOR}$" EQUAL 2)
find_package(OpenCV 2.4.3 REQUIRED core imgproc highgui) find_package(OpenCV 2.4.3 REQUIRED core imgproc highgui)
elseif("${OpenCV_VERSION_MAJOR}$" EQUAL 3) 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 imgcodecs) find_package(OpenCV 3 REQUIRED core imgproc imgcodecs)
endif() endif()
# 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:
set_target_properties(${OpenCV_LIBS} PROPERTIES MAP_IMPORTED_CONFIG_RELWITHDEBINFO RELEASE) set_target_properties(${OpenCV_LIBS} PROPERTIES MAP_IMPORTED_CONFIG_RELWITHDEBINFO RELEASE)
......
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