Commit fb8e6ed
committed
COMP: Address greptile review on vendored Eigen 5 import
Three findings on Modules/ThirdParty/Eigen3/src/itkeigen, all scoped to
the vendored Eigen build tree (USE_SYSTEM_EIGEN=ON consumers go through
find_package and never read these files; the system Eigen3Config.cmake
ships separately).
P1 — Eigen3Config.cmake.in:7 hardcoded "Eigen3Targets.cmake", dropping
the @EIGEN3_TARGETS_FILE@ substitution. The ITK section in
Modules/ThirdParty/Eigen3/src/itkeigen/CMakeLists.txt sets
EIGEN3_TARGETS_FILE=ITKInternalEigen3Targets.cmake (line 972) before
calling configure_package_config_file against this template, but the
hardcoded form ignored that variable. The generated
ITKInternalEigen3Config.cmake would then include "…/Eigen3Targets.cmake"
(belonging to eigen_external), and ITKInternalEigen3::Eigen would
never be imported for installed consumers. Restore the substitution.
P2 — Modules/ThirdParty/Eigen3/src/itkeigen/CMakeLists.txt declared
option(ITK_USE_EIGEN_MPL2_ONLY ...) twice in the ITK section: once at
line 844 and again at line 952. CMake silently ignores subsequent
option() calls when the variable is cached, so behavior is unchanged,
but the duplicate (and a slightly different description) is confusing.
Drop the second declaration; replace with a one-line pointer back to
the canonical declaration site.
P2 — Modules/ThirdParty/Eigen3/src/itkeigen/CMakeLists.txt:964 had a
commented-out generator expression
"# $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/..>". Eigen 5's
header tree is fully sourced from CMAKE_CURRENT_SOURCE_DIR (no
configured headers land in the binary dir for this module), so the
commented line was dead code. Remove it.
USE_SYSTEM_EIGEN compatibility for Eigen 3.3+ is preserved: all three
edits live under Modules/ThirdParty/Eigen3/src/itkeigen which is only
configured when USE_SYSTEM_EIGEN=OFF; the system-Eigen path
(find_package(Eigen3 3.3 REQUIRED)) does not read these files.1 parent 7071c66 commit fb8e6ed
2 files changed
Lines changed: 2 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
949 | 949 | | |
950 | 950 | | |
951 | 951 | | |
952 | | - | |
953 | | - | |
| 952 | + | |
954 | 953 | | |
955 | 954 | | |
956 | 955 | | |
| |||
961 | 960 | | |
962 | 961 | | |
963 | 962 | | |
964 | | - | |
965 | 963 | | |
966 | 964 | | |
967 | 965 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
0 commit comments