From 50a806c04259863b2d161cad86481f780866aa72 Mon Sep 17 00:00:00 2001 From: raulmur Date: Mon, 16 Jan 2017 15:01:46 +0100 Subject: [PATCH] Fix OpenCV 3 support --- CMakeLists.txt | 4 ++-- Examples/ROS/ORB_SLAM2/CMakeLists.txt | 9 ++++++++- Thirdparty/DBoW2/CMakeLists.txt | 8 +++++++- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 94edcbe371..08a8af468e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,9 +28,9 @@ endif() LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules) -find_package(OpenCV 2.4.3 QUIET) +find_package(OpenCV 3.0 QUIET) if(NOT OpenCV_FOUND) - find_package(OpenCV 3.0 QUIET) + find_package(OpenCV 2.4.3 QUIET) if(NOT OpenCV_FOUND) message(FATAL_ERROR "OpenCV > 2.4.3 not found.") endif() diff --git a/Examples/ROS/ORB_SLAM2/CMakeLists.txt b/Examples/ROS/ORB_SLAM2/CMakeLists.txt index 9c02407db4..7cbf71c199 100644 --- a/Examples/ROS/ORB_SLAM2/CMakeLists.txt +++ b/Examples/ROS/ORB_SLAM2/CMakeLists.txt @@ -30,7 +30,14 @@ endif() LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/../../../cmake_modules) -find_package(OpenCV 2.4.3 REQUIRED) +find_package(OpenCV 3.0 QUIET) +if(NOT OpenCV_FOUND) + find_package(OpenCV 2.4.3 QUIET) + if(NOT OpenCV_FOUND) + message(FATAL_ERROR "OpenCV > 2.4.3 not found.") + endif() +endif() + find_package(Eigen3 3.1.0 REQUIRED) find_package(Pangolin REQUIRED) diff --git a/Thirdparty/DBoW2/CMakeLists.txt b/Thirdparty/DBoW2/CMakeLists.txt index 4da56b2bcd..0eb512600a 100644 --- a/Thirdparty/DBoW2/CMakeLists.txt +++ b/Thirdparty/DBoW2/CMakeLists.txt @@ -24,7 +24,13 @@ set(SRCS_DUTILS DUtils/Random.cpp DUtils/Timestamp.cpp) -find_package(OpenCV REQUIRED) +find_package(OpenCV 3.0 QUIET) +if(NOT OpenCV_FOUND) + find_package(OpenCV 2.4.3 QUIET) + if(NOT OpenCV_FOUND) + message(FATAL_ERROR "OpenCV > 2.4.3 not found.") + endif() +endif() set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)