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)