FindEigen.cmake does not find cmake Eigen3 installations.

662 views
Skip to first unread message

Thomas Kastl

unread,
Apr 19, 2017, 9:30:00 AM4/19/17
to Ceres Solver
I have the following issue:

My Eigen version is installed in a specific local folder and is usually found by cmake through find_package(Eigen3). The path to Eigen3Config.cmake is stored in the windows registry according to cmake user package registry.

Ceres' FindEigen.cmake however doesn't seem to try finding Eigen through find_package(), and only searches for the usual install paths:

# Search user-installed locations first, so that we prefer user installs
# to system installs where both exist.
#
# TODO: Add standard Windows search locations for Eigen.
list(APPEND EIGEN_CHECK_INCLUDE_DIRS
  /usr/local/include
  /usr/local/homebrew/include # Mac OS X
  /opt/local/var/macports/software # Mac OS X.
  /opt/local/include
  /usr/include)
# Additional suffixes to try appending to each search path.
list(APPEND EIGEN_CHECK_PATH_SUFFIXES
  eigen3 # Default root directory for Eigen.
  Eigen/include/eigen3 ) # Windows (for C:/Program Files prefix).

This causes my CMakeLists.txt to fail, since EIGEN_CHECK_INCLUDE_DIR does not know about my custom directory. 

Is there something I am missing? Or does Ceres not yet consider cmake installs of Eigen that can be found by find_package, meaning I have to hardcode my include directory?

Cheers, Thomas

Alex Stewart

unread,
Apr 19, 2017, 11:20:32 AM4/19/17
to ceres-...@googlegroups.com
The short answer is for easy legacy compatibility.  I have added a new CL here:


which should update the behaviour to mimic our versions of FindGflags.cmake & FindGlog.cmake which default to CMake installed packages if available, please give it a try.

-Alex

--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/68adf2f9-af5a-4898-b62c-9f710a0ea556%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thomas

unread,
Apr 20, 2017, 9:27:10 AM4/20/17
to ceres-...@googlegroups.com
I tried your fix and it now works flawlessly with CMake installed libraries. Thanks!

- Thomas

To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Ceres Solver" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ceres-solver/EaN3Zb8_bNs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ceres-solver+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/A0B35504-B2A9-4893-84E7-5DD31B6553AD%40gmail.com.

Alex Stewart

unread,
Apr 20, 2017, 9:35:30 AM4/20/17
to ceres-...@googlegroups.com
Thanks Thomas, this has now been merged into master.

-A

To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/CAMi47nPCAX4ZNP7KF%3DFZZ%3DjedPtDkwDY6RcbmSVHL9H8yL7Qsw%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages