From a8bea24f46e21098b1ed0aab6d8975a2446d3a9e Mon Sep 17 00:00:00 2001 From: Fabien Castan Date: Tue, 14 Feb 2023 19:01:55 +0100 Subject: [PATCH] [cmake] cannot have opencv contrib without opencv --- src/CMakeLists.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 460f123e96..b13e045055 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -495,17 +495,17 @@ if(ALICEVISION_BUILD_SFM) endif() endif() - if(NOT ALICEVISION_USE_OPENCV_CONTRIB STREQUAL "OFF") - find_package(OpenCV COMPONENTS mcc) - if(OpenCV_FOUND) - set(ALICEVISION_HAVE_OPENCV_CONTRIB 1) - message(STATUS "OpenCV contrib found.") - elseif(ALICEVISION_USE_OPENCV_CONTRIB STREQUAL "ON") - message(SEND_ERROR "Failed to find OpenCV.") + if(ALICEVISION_HAVE_OPENCV) + if(NOT ALICEVISION_USE_OPENCV_CONTRIB STREQUAL "OFF") + find_package(OpenCV COMPONENTS mcc) + if(OpenCV_FOUND) + set(ALICEVISION_HAVE_OPENCV_CONTRIB 1) + message(STATUS "OpenCV contrib found.") + elseif(ALICEVISION_USE_OPENCV_CONTRIB STREQUAL "ON") + message(SEND_ERROR "Failed to find OpenCV.") + endif() endif() - endif() - if(ALICEVISION_HAVE_OPENCV) include_directories(${OpenCV_INCLUDE_DIRS}) # add a definition that allows the conditional compiling if(ALICEVISION_USE_OCVSIFT)