Skip to content

Commit c1715d9

Browse files
committed
BUG: Restore eigen_internal export to ITK's main targets set (#6239)
Commit 64ddc66 (Eigen 5.0.1 vendored update, 2026-05-01) silently moved eigen_internal out of ITK's main `${ITK3P_INSTALL_EXPORT_NAME}` export set into a standalone `ITKInternalEigen3Targets`. Because `ITKConfig.cmake` only loads `ITKTargets.cmake`, downstream `find_package(ITK)` could no longer resolve `eigen_internal` and any consumer using FetchContent with `FIND_PACKAGE_ARGS` (SimpleITK's pattern) hit a target-collision cascade as CMake fell back to `add_subdirectory`. Re-add the install rule that registers `eigen_internal` in `${ITK3P_INSTALL_EXPORT_NAME}` while keeping the existing standalone `ITKInternalEigen3Targets` install for `find_package(ITKInternalEigen3)` consumers. Both export sets now reference the same target. Issue: #6239
1 parent 7820bbc commit c1715d9

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Modules/ThirdParty/Eigen3/src/itkeigen/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -965,6 +965,12 @@ target_include_directories (eigen_internal SYSTEM INTERFACE
965965

966966
# Export as title case Eigen
967967
set_target_properties (eigen_internal PROPERTIES EXPORT_NAME Eigen)
968+
# Register in ITK's main export set so find_package(ITK) resolves
969+
# eigen_internal as an IMPORTED target loaded from ITKTargets.cmake
970+
# (issue #6239: SimpleITK FetchContent + FIND_PACKAGE_ARGS fallback).
971+
install (TARGETS eigen_internal EXPORT ${ITK3P_INSTALL_EXPORT_NAME})
972+
# Also register in the standalone ITKInternalEigen3 export set used by
973+
# find_package(ITKInternalEigen3) consumers.
968974
install (TARGETS eigen_internal EXPORT ITKInternalEigen3Targets)
969975

970976
set(EIGEN3_TARGETS_FILE ITKInternalEigen3Targets.cmake)

0 commit comments

Comments
 (0)