Skip to content

Conversation

cho-m
Copy link

@cho-m cho-m commented Oct 4, 2025

Existing find_package won't detect Eigen3 5.0.0. Upstream added support for range to help with this https://gitlab.com/libeigen/eigen/-/merge_requests/1989

However, the support is only available in 3.4.1+ so version 3.4.0 needs to use old approach.

Also, EIGEN3_INCLUDE_DIR was removed so instead just use Eigen3::Eigen target.

Eigen 3.4.0 has:

# Create imported target Eigen3::Eigen
add_library(Eigen3::Eigen INTERFACE IMPORTED)

set_target_properties(Eigen3::Eigen PROPERTIES
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/eigen3"
)

Eigen 5.0.0 has:

# Create imported target Eigen3::Eigen
add_library(Eigen3::Eigen INTERFACE IMPORTED)

set_target_properties(Eigen3::Eigen PROPERTIES
  INTERFACE_COMPILE_FEATURES "cxx_std_14"
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/eigen3"
)

@cho-m cho-m mentioned this pull request Oct 5, 2025
24 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant