Skip to content

BUG: Remove hardcoded HDF5 system paths from ITKTargets#6494

Draft
blowekamp wants to merge 2 commits into
InsightSoftwareConsortium:mainfrom
blowekamp:hdf5_system_path
Draft

BUG: Remove hardcoded HDF5 system paths from ITKTargets#6494
blowekamp wants to merge 2 commits into
InsightSoftwareConsortium:mainfrom
blowekamp:hdf5_system_path

Conversation

@blowekamp

Copy link
Copy Markdown
Member

Two fixes to the ITK_USE_SYSTEM_HDF5 path in ITKHDF5 CMakeLists:

  1. Scope ITKHDF5_SYSTEM_INCLUDE_DIRS to the variable-fallback branch only — imported targets carry their own include interface and do not need baked-in paths in the installed config files.
  2. Consolidate the duplicated shared/static target-detection branches using a single _hdf5_type suffix variable.
  3. Replace the unreachable variable-fallback branch with a FATAL_ERROR: CMake 3.19+ FindHDF5 always provides hdf5::hdf5 imported targets, and ITK requires CMake ≥ 3.22.

Companion to #6491, #6492, and #6493 which applied the same imported-target pattern to ZLIB, Expat, JPEG, PNG, and double-conversion.

Scope ITKHDF5_SYSTEM_INCLUDE_DIRS to the variable-fallback branch so
it is only set when no imported target is available. Imported targets
carry their own include interface and do not need baked-in paths.

Also consolidate the shared/static target-detection branches using a
single _hdf5_type suffix variable.
CMake 3.19+ FindHDF5 always provides hdf5::hdf5 imported targets.
Since ITK requires CMake >= 3.22, the variable-only fallback path
is unreachable on any supported configuration. Replace it with a
fatal error directing users to set HDF5_DIR.
@github-actions github-actions Bot added type:Bug Inconsistencies or issues which will cause an incorrect result under some or all circumstances type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots area:ThirdParty Issues affecting the ThirdParty module labels Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ThirdParty Issues affecting the ThirdParty module type:Bug Inconsistencies or issues which will cause an incorrect result under some or all circumstances type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant