Repository navigation
cmake: prefer selected libheif headers and avoid system include demotion - #478
Open
DichenZhang1 wants to merge 1 commit into
Open
DichenZhang1 wants to merge 1 commit into
DichenZhang1 wants to merge 1 commit into
Conversation
- Prepend libheif include directories (from target interface or LIBHEIF_INCLUDE_DIRS) to PRIVATE_INCLUDE_DIR so they are searched before other dependency or system include paths. - For CMake 3.25+, set SYSTEM FALSE on target libheif::heif to prevent it from being classified as a system target, ensuring its headers take precedence over conflicting host headers without stripping system include classification from other dependencies (e.g. GTest, Threads). - Resolve ALIASED_TARGET before calling set_target_properties to prevent CMake configuration fatal errors when libheif::heif is an ALIAS target (e.g. from Findlibheif.cmake aliasing 'heif' or 'PkgConfig::PC_LIBHEIF'). - Fall back to LIBHEIF_INCLUDE_DIRS if the target does not define INTERFACE_INCLUDE_DIRECTORIES. - Guard get_target_property with if(TARGET libheif::heif) to prevent CMake configuration errors when using custom or legacy Find modules. Ref: PR #468, PR #478
DichenZhang1
force-pushed
the
fix/cmake-prefer-libheif-headers
branch
from
September 18, 2026 22:55
24a610e to
cf5cfe3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ref: PR #468