diff --git a/cmake/DetectOpenCV.cmake b/cmake/DetectOpenCV.cmake index 196a551..a10a149 100644 --- a/cmake/DetectOpenCV.cmake +++ b/cmake/DetectOpenCV.cmake @@ -19,8 +19,10 @@ find_package(OpenCV REQUIRED) message(STATUS "Found OpenCV: ${OpenCV_VERSION}") if(OpenCV_VERSION VERSION_LESS 3.0) add_definitions(-DUSE_OPENCV2) -else() +elseif(OpenCV_VERSION VERSION_LESS 4.0) add_definitions(-DUSE_OPENCV3) +else() + add_definitions(-DUSE_OPENCV4) endif() if(MSVC OR MSYS OR MINGW) diff --git a/samples/api/CMakeLists.txt b/samples/api/CMakeLists.txt index 8100370..4c27086 100644 --- a/samples/api/CMakeLists.txt +++ b/samples/api/CMakeLists.txt @@ -30,8 +30,12 @@ make_executable(camera_a ## get_depth_with_region +if(OpenCV_VERSION VERSION_LESS 4.0) + make_executable(get_depth_with_region SRCS get_depth_with_region.cc LINK_LIBS mynteye ${OpenCV_LIBS} DLL_SEARCH_PATHS ${PRO_DIR}/_install/bin ${OpenCV_LIB_SEARCH_PATH} ) + +endif()