Skip to content

Comments

Bugfix for libheif detection#5051

Closed
irieger wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
irieger:build-fix/libheif-check-conan
Closed

Bugfix for libheif detection#5051
irieger wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
irieger:build-fix/libheif-check-conan

Conversation

@irieger
Copy link

@irieger irieger commented Feb 18, 2026

Description

When the LIBHEIF_LIBRARIES refers to targets (like happening when conan packaging provides the targets), an empty string from get_filename_component will fail as it is not counted as an argument if used without quotes.

Adding the quote lets the code pass without an error. It will not display the warning, but it provides at least a fix for letting it build. (In the conan package we patch that check out at the moment to get it to build: https://github.com/conan-io/conan-center-index/blob/master/recipes/openimageio/all/patches/3.1.10.0-conan-fixes.patch)

I tried to extract the underlying information but haven't come that far. For example some debugging code I tried:

        if (TARGET ${_libeheif_library})
            get_property(libeheif_type TARGET _libeheif_library PROPERTY TYPE)
            get_target_property(interface_library "${_libeheif_library}" INTERFACE_LINK_LIBRARIES)
            message("Get the actual libraries of the target ${_libeheif_library}: interface_library")
            message("  Type of library: ${libeheif_type}")
        endif()

Such commands extract a bit more info, as the library type is only INTERFACE_LIBRARY and not shared or static, that didn't help much. Also at least for usages like conan, where there are prepared helper tools to get all license information etc. So I'm not too deep into CMake for that specific stuff, so just at least suggesting to use the quotes to not break it if CMake can't extract the library file ending. Could also switch to display another warning saying it MIGHT link to libheif with its broken license.

Tests

The target to have it build with conan is achieved. Tried different experiments, including the current one locally via changing the patch accordingly.

Checklist:

  • I have read the guidelines on contributions and code review procedures.
  • I have updated the documentation if my PR adds features or changes
    behavior.
  • I am sure that this PR's changes are tested somewhere in the
    testsuite
    .
  • I have run and passed the testsuite in CI before submitting the
    PR, by pushing the changes to my fork and seeing that the automated CI
    passed there. (Exceptions: If most tests pass and you can't figure out why
    the remaining ones fail, it's ok to submit the PR and ask for help. Or if
    any failures seem entirely unrelated to your change; sometimes things break
    on the GitHub runners.)
  • My code follows the prevailing code style of this project and I
    fixed any problems reported by the clang-format CI test.
  • If I added or modified a public C++ API call, I have also amended the
    corresponding Python bindings. If altering ImageBufAlgo functions, I also
    exposed the new functionality as oiiotool options.

When the LIBHEIF_LIBRARIES refers to targets (like happening when conan packaging provides the targets), an empty string from
get_filename_component will fail as it is not counted as an argument if used without quotes.
@linux-foundation-easycla
Copy link

CLA Not Signed

@lgritz
Copy link
Collaborator

lgritz commented Feb 20, 2026

Superseded by #5053

@lgritz lgritz closed this Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants