Skip to content

cmake: prefer using Eigen configuration files#18699

Merged
opencv-pushbot merged 1 commit intoopencv:3.4from
alalek:support_ceres_2.0.0
Nov 5, 2020
Merged

cmake: prefer using Eigen configuration files#18699
opencv-pushbot merged 1 commit intoopencv:3.4from
alalek:support_ceres_2.0.0

Conversation

@alalek
Copy link
Copy Markdown
Member

@alalek alalek commented Oct 29, 2020

opencv_contrib PR: opencv/opencv_contrib#2732

Compatibility with Ceres 2.0.0 CMake scripts

Related CMake message:

Failed to find Ceres - Found Eigen dependency, but the version of Eigen found () does not exactly match the version of Eigen Ceres was compiled with (3.3.7).

opencv_contrib=

if(WITH_EIGEN AND NOT HAVE_EIGEN)
find_package(Eigen3 QUIET)
if(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)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another option might be to adjust the FindEigen3.cmake module to be compatible with Eigen's own cmake config modules and by (additionally) setting EIGEN3_VERSION_STRING.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FindEigen3.cmake is not a part of OpenCV.
It is part of CMake distributions on some platforms (like Fedora 31/32, check /usr/share/cmake/Modules/FindEigen3.cmake).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh ok, sorry, I misinterpreted it. (Still you could set EIGEN3_VERSION_STRING here if it is unset). But maybe your proposed solution is good enough. The only case I can think of is if someone wants to build with ceres 2.0.0, but find Eigen in a way that works with the find module, but doesn't work with eigens own config module (maybe from an Eigen source tree directly, not build or install dir).

- for better compatibility with Ceres 2.0.0 CMake scripts
@alalek
Copy link
Copy Markdown
Member Author

alalek commented Nov 5, 2020

👍

@opencv-pushbot opencv-pushbot merged commit fb69620 into opencv:3.4 Nov 5, 2020
@alalek alalek mentioned this pull request Nov 5, 2020
@alalek alalek mentioned this pull request Nov 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants