Skip to content

COMP: Require libtiff 4.0.3 when ITK_USE_SYSTEM_TIFF is ON - #7270

Merged
hjmjohnson merged 1 commit into
InsightSoftwareConsortium:mainfrom
hjmjohnson:comp-libtiff-min-version
Nov 30, 2026
Merged

hjmjohnson merged 1 commit into
InsightSoftwareConsortium:mainfrom
hjmjohnson:comp-libtiff-min-version

Conversation

@hjmjohnson

Copy link
Copy Markdown
Member

With ITK_USE_SYSTEM_TIFF=ON, require libtiff 4.0.3 in find_package(TIFF), so an older system libtiff stops configuration instead of failing to compile in TIFFImageIO. Follow-up requested by @blowekamp in review of #7240.
Merge danger: two-way door; blast radius: builds with ITK_USE_SYSTEM_TIFF=ON against a libtiff older than 4.0.3, and projects using such an installed ITK.

Shape of the change
 if(ITK_USE_SYSTEM_TIFF)
-  find_package(TIFF REQUIRED)
+  set(_itk_tiff_min_version 4.0.3)
+  find_package(TIFF ${_itk_tiff_min_version} REQUIRED)
   ...
   ITKTIFF_EXPORT_CODE_INSTALL:  find_package(TIFF ${_itk_tiff_min_version} REQUIRED)
   ITKTIFF_EXPORT_CODE_BUILD:    find_package(TIFF ${_itk_tiff_min_version} REQUIRED)

FindTIFF reads TIFF_VERSION_STRING from tiffvers.h and checks it through find_package_handle_standard_args, so no other code is needed. 4.0.3 is the minimum set by 40f5c4d; until now it was stated only in a source comment.

Evidence

Local, macOS, CMake 3.26, Homebrew libtiff 4.7.2, -DITK_BUILD_DEFAULT_MODULES=OFF -DModule_ITKIOTIFF=ON -DITK_USE_SYSTEM_TIFF=ON:

  • With the minimum temporarily raised above the installed version, configure stops:
    Could NOT find TIFF: Found unsuitable version "4.7.2", but required is at least "99.0".
  • With 4.0.3: configure succeeds, the installed ITKTIFF.cmake contains find_package(TIFF 4.0.3 REQUIRED), and ctest -R TIFF passes 107 of 109 (the other two, KWStyle and the GTest driver, were not built).
  • Not tested: an actual libtiff older than 4.0.3, and the bundled-TIFF path (ITK_USE_SYSTEM_TIFF=OFF), which this change does not touch.

TIFFImageIO has needed libtiff 4.0.3 or later since 40f5c4d, and
after InsightSoftwareConsortium#7240 it has no fallback for older versions, but find_package(TIFF)
asked for no version. An older system libtiff was accepted at configure
time and failed only when TIFFImageIO compiled.

The build and both exported find_package(TIFF) calls now ask for 4.0.3,
so an older libtiff stops configuration with FindTIFF's "Found
unsuitable version" message, and so do projects that use the installed
ITK.

Requested by blowekamp in review of InsightSoftwareConsortium#7240.
@github-actions github-actions Bot added type:Compiler Compiler support or related warnings type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots area:ThirdParty Issues affecting the ThirdParty module labels Nov 30, 2026
@hjmjohnson
hjmjohnson marked this pull request as ready for review November 30, 2026 16:30
@greptile-apps

greptile-apps Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Requires libtiff 4.0.3 when ITK_USE_SYSTEM_TIFF is enabled.

  • System TIFF builds require libtiff 4.0.3 or newer.

Reviews (1) · Last reviewed commit: "COMP: Require libtiff 4.0.3 when ITK_USE..." · Reviewed by Greptile

@hjmjohnson
hjmjohnson merged commit 2b45cfa into InsightSoftwareConsortium:main Nov 30, 2026
15 of 18 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:Compiler Compiler support or related warnings 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