Skip to content

BUG: Use imported target for system double-conversion#6493

Merged
hjmjohnson merged 1 commit into
InsightSoftwareConsortium:mainfrom
blowekamp:double-convert_system_path
Jun 23, 2026
Merged

BUG: Use imported target for system double-conversion#6493
hjmjohnson merged 1 commit into
InsightSoftwareConsortium:mainfrom
blowekamp:double-convert_system_path

Conversation

@blowekamp

Copy link
Copy Markdown
Member

Replace get_target_property calls with the double-conversion::double-conversion imported target and add find_package export code to prevent baked-in paths in installed CMake config files.

Companion to #6491 and #6492 which applied the same fix to ZLIB, Expat, JPEG, and PNG.

Replace get_target_property calls with the double-conversion::double-conversion
imported target and add find_package export code.
@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
@blowekamp blowekamp marked this pull request as ready for review June 22, 2026 22:39
@greptile-apps

greptile-apps Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR modernizes the system double-conversion CMake integration by replacing get_target_property calls (which baked absolute paths into installed config files) with the double-conversion::double-conversion imported target name, and adds EXPORT_CODE_INSTALL/EXPORT_CODE_BUILD blocks so downstream find_package(ITK) consumers re-locate the library portably.

  • ITKDoubleConversion_LIBRARIES is now set to the imported target string; include directories are implicitly propagated via the target's INTERFACE_INCLUDE_DIRECTORIES, so ITKDoubleConversion_INCLUDE_DIRS is intentionally removed for the system case.
  • The _double_conversion_compatible variable (3.1) is immediately interpolated into both export-code strings at configure time, which is the correct CMake behavior here.
  • Minimum required version is lowered from 3.1.6 to 3.1; this is the only notable behavioural difference from the original.

Confidence Score: 4/5

Safe to merge; the change is a straightforward adoption of the imported-target pattern already applied to companion modules, with no functional regression risk for the common case.

The imported-target approach is correct and the EXPORT_CODE blocks follow the established pattern in this codebase. The only concrete difference from the original is that the minimum version accepted for system double-conversion drops from 3.1.6 to 3.1, which could silently admit older patch releases — worth a quick author confirmation but unlikely to matter in practice.

Modules/ThirdParty/DoubleConversion/CMakeLists.txt — specifically the version requirement change on line 13.

Important Files Changed

Filename Overview
Modules/ThirdParty/DoubleConversion/CMakeLists.txt Replaces get_target_property extraction of include dirs and LOCATION with the imported target name directly, and adds EXPORT_CODE_INSTALL/BUILD blocks to avoid baked-in paths in installed configs; minimum version requirement is slightly relaxed from 3.1.6 to 3.1.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[CMakeLists.txt\nITKDoubleConversion] --> B{ITK_USE_SYSTEM_DOUBLECONVERSION?}
    B -- YES --> C["find_package(double-conversion 3.1 REQUIRED)"]
    C --> D["set ITKDoubleConversion_LIBRARIES\n= 'double-conversion::double-conversion'"]
    D --> E["set ITKDoubleConversion_NO_SRC 1"]
    E --> F["set EXPORT_CODE_INSTALL\n→ find_package at install time"]
    E --> G["set EXPORT_CODE_BUILD\n→ find_package in build tree\n(guarded by NOT ITK_BINARY_DIR)"]
    B -- NO --> H["set ITKDoubleConversion_INCLUDE_DIRS\n(bundled source paths)"]
    H --> I["set ITKDoubleConversion_LIBRARIES itkdouble-conversion"]
    F --> J[itk_module_impl]
    G --> J
    I --> J
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[CMakeLists.txt\nITKDoubleConversion] --> B{ITK_USE_SYSTEM_DOUBLECONVERSION?}
    B -- YES --> C["find_package(double-conversion 3.1 REQUIRED)"]
    C --> D["set ITKDoubleConversion_LIBRARIES\n= 'double-conversion::double-conversion'"]
    D --> E["set ITKDoubleConversion_NO_SRC 1"]
    E --> F["set EXPORT_CODE_INSTALL\n→ find_package at install time"]
    E --> G["set EXPORT_CODE_BUILD\n→ find_package in build tree\n(guarded by NOT ITK_BINARY_DIR)"]
    B -- NO --> H["set ITKDoubleConversion_INCLUDE_DIRS\n(bundled source paths)"]
    H --> I["set ITKDoubleConversion_LIBRARIES itkdouble-conversion"]
    F --> J[itk_module_impl]
    G --> J
    I --> J
Loading

Reviews (1): Last reviewed commit: "BUG: Use imported target for system doub..." | Re-trigger Greptile

Comment thread Modules/ThirdParty/DoubleConversion/CMakeLists.txt
@hjmjohnson hjmjohnson merged commit fb2e7fc into InsightSoftwareConsortium:main Jun 23, 2026
22 checks passed
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.

3 participants