Skip to content

ENH: GDCM skip find_package when *_LIBRARIES pre-set#6502

Draft
blowekamp wants to merge 1 commit into
InsightSoftwareConsortium:mainfrom
blowekamp:gdcm_support_system_deps
Draft

ENH: GDCM skip find_package when *_LIBRARIES pre-set#6502
blowekamp wants to merge 1 commit into
InsightSoftwareConsortium:mainfrom
blowekamp:gdcm_support_system_deps

Conversation

@blowekamp

Copy link
Copy Markdown
Member

Use ITK module interface targets for GDCM system libraries.

Replace the EXPAT_INCLUDE_DIR/EXPAT_LIBRARY (singular) hint variables
with EXPAT_LIBRARIES/ZLIB_LIBRARIES pre-set to ITK::ITKExpatModule
and ITK::ITKZLIBModule. Guard each find_package call in the GDCM
source with if(NOT <pkg>_LIBRARIES) so a parent project that pre-sets
the plural _LIBRARIES variable skips the find entirely — the same
pattern used in the ITK DCMTK third-party module.

AI assistance
  • Tool: GitHub Copilot (Claude Sonnet 4.6)
  • Role: identified the skip-find pattern from InsightSoftwareConsortium/DCMTK@7c7dc11, applied it to GDCM ZLIB/Expat/OpenJPEG blocks, and drafted the commit

Guard GDCM system-library find_package with if(NOT <pkg>_LIBRARIES) so
ITK module interface targets directly can be set directly.

Set EXPAT_LIBRARIES/ZLIB_LIBRARIES/OPENJPEG_LIBRARIES to
ITK::ITKExpatModule, ITK::ITKZLIBModule, ITK::ITKOpenJPEGModule,
and GDCM_JPEGTURBO_LIBRARIES to ITK::ITKJPEGModule, bypassing
GDCM's internal bundled copies.
@github-actions github-actions Bot added type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots type:Enhancement Improvement of existing methods or implementation area:ThirdParty Issues affecting the ThirdParty module labels Jun 24, 2026
@blowekamp

Copy link
Copy Markdown
Member Author

Updating GDCM before rebasing these changes: #6520

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:Enhancement Improvement of existing methods or implementation 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