From ac418e999defbfb9852d20a6884118153e7a7151 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Sun, 22 Nov 2020 16:28:53 +0000 Subject: [PATCH] cmake: update condition for find_package(Eigen3 CONFIG) --- cmake/OpenCVFindLibsPerf.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/OpenCVFindLibsPerf.cmake b/cmake/OpenCVFindLibsPerf.cmake index 7b3874ff0e..3753084d28 100644 --- a/cmake/OpenCVFindLibsPerf.cmake +++ b/cmake/OpenCVFindLibsPerf.cmake @@ -51,7 +51,10 @@ endif(WITH_CUDA) # --- Eigen --- if(WITH_EIGEN AND NOT HAVE_EIGEN) - if(NOT OPENCV_SKIP_EIGEN_FIND_PACKAGE_CONFIG) + if((OPENCV_FORCE_EIGEN_FIND_PACKAGE_CONFIG + OR NOT (CMAKE_VERSION VERSION_LESS "3.0.0") # Eigen3Targets.cmake required CMake 3.0.0+ + ) AND NOT OPENCV_SKIP_EIGEN_FIND_PACKAGE_CONFIG + ) find_package(Eigen3 CONFIG QUIET) # Ceres 2.0.0 CMake scripts doesn't work with CMake's FindEigen3.cmake module (due to missing EIGEN3_VERSION_STRING) endif() if(NOT Eigen3_FOUND)