Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Upstream Eigen3Config.cmake #19

Open
sloretz opened this issue Apr 1, 2022 · 0 comments
Open

Use Upstream Eigen3Config.cmake #19

sloretz opened this issue Apr 1, 2022 · 0 comments
Labels

Comments

@sloretz
Copy link
Contributor

sloretz commented Apr 1, 2022

The chocolatey package for Eigen currently ships a custom EigenConfig.cmake, but it only sets old-style CMake variables. The upstream EigenConfig.cmake sets CMake targets. I think the upstream one should be used here.

This repo's

get_filename_component (_PREFIX "${CMAKE_CURRENT_LIST_DIR}/../.." ABSOLUTE)
set (Eigen3_INCLUDE_DIRS "${_PREFIX}/include")
# Compatibility with nonstandard and legacy package variable expectations.
set (Eigen3_INCLUDE_DIR "${Eigen3_INCLUDE_DIRS}")
set (EIGEN3_INCLUDE_DIRS "${Eigen3_INCLUDE_DIRS}")
set (EIGEN3_INCLUDE_DIR "${Eigen3_INCLUDE_DIRS}")

Upstream's
https://gitlab.com/libeigen/eigen/-/blob/master/cmake/Eigen3Config.cmake.in#L7

clalancette added a commit to ros2/geometry2 that referenced this issue Apr 29, 2022
These come about because of the use of the old-style CMake
variables like ${orocos_kdl_INCLUDE_DIRS}.  Unfortunately,
there is a bug in the orocos_kdl CMake modern targets where
they forget to export a dependency on Eigen.  To workaround
this, make an explicit dependency on Eigen (even though we
don't directly use it), and use the Eigen targets instead.

Note that on Windows, this *still* causes us to use a
hardcoded path on Eigen.  However, this path is less problematic
because it will always be there if the user followed our
installation instructions (and won't be a "random" path like
C:\ci\ws\install\include).  Also, once we fix
ros2/choco-packages#19 , this hard-coded
path will go away as well.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants