From 13f3add0bd570855cb3d339f659694a25d366c49 Mon Sep 17 00:00:00 2001 From: Christoph Kahl <26385576+kanonet@users.noreply.github.com> Date: Sat, 20 Jul 2019 01:01:44 +0200 Subject: [PATCH] Add OpenCV 4.x compatibility to CMakeLists.txt of examples (#271) --- examples/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 6a838c26a..fe9fd96e0 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -9,6 +9,9 @@ if("${OpenCV_VERSION_MAJOR}$" EQUAL 2) elseif("${OpenCV_VERSION_MAJOR}$" EQUAL 3) message(STATUS "OpenCV 3.x detected - including imgcodecs for compatibility") find_package(OpenCV 3 REQUIRED core imgproc imgcodecs) +elseif("${OpenCV_VERSION_MAJOR}$" EQUAL 4) + message(STATUS "OpenCV 4.x detected - including imgcodecs for compatibility") + find_package(OpenCV 4 REQUIRED core imgproc imgcodecs) endif() # 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)