Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/cmake/Config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ if (NOT @BUILD_SHARED_LIBS@)
# This is required in static library builds, as e.g. PNG::PNG appears among
# INTERFACE_LINK_LIBRARIES. If the project does not know about PNG target, it will cause
# configuration error about unknown targets being linked in.
# Static libtiff configs may reference this target without importing it.
# https://gitlab.com/libtiff/libtiff/-/work_items/871
if (NOT TARGET Deflate::Deflate)
find_package (libdeflate CONFIG QUIET)
if (TARGET libdeflate::libdeflate_static)
add_library (Deflate::Deflate ALIAS libdeflate::libdeflate_static)
elseif (TARGET libdeflate::libdeflate_shared)
add_library (Deflate::Deflate ALIAS libdeflate::libdeflate_shared)
endif ()
endif ()
find_dependency(TIFF)
find_dependency(OpenColorIO)
if (@JPEG_FOUND@)
Expand Down
8 changes: 8 additions & 0 deletions src/cmake/externalpackages.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ endif ()
checked_find_package (libuhdr
VERSION_MIN 1.3)

# Static libtiff configs may reference this target without importing it.
# https://gitlab.com/libtiff/libtiff/-/work_items/871
if (NOT TARGET Deflate::Deflate)
find_package (libdeflate CONFIG QUIET)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Internally, we use checked_find_package, which has lots of bells and whistles, including that it will be included in the build log report of which dependencies were found at which version.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's something about when + how checked_find_package does what it does that makes it difficult for the config that libtiff sets up that fails to survive a rebuild, when the locally-built libtiff is rediscovered... I don't really understand enough about what's happening behind the scenes to grok exactly what's going on. But the only thing that seems to work is forcing tiff to always build locally (when rebuilding using an existing build dir persisting previously built deps).

alias_library_if_not_exists (Deflate::Deflate libdeflate::libdeflate_static)
alias_library_if_not_exists (Deflate::Deflate libdeflate::libdeflate_shared)
endif ()
Comment thread
zachlewis marked this conversation as resolved.

checked_find_package (TIFF REQUIRED
VERSION_MIN 4.0
RECOMMEND_MIN 4.5
Expand Down
Loading