AOMediaCodec / libavif

libavif - Library for encoding and decoding .avif files
Other
1.58k stars 206 forks source link

Fix static libs INTERFACE_INCLUDE_DIRECTORIES #2505

Closed WangWeiLin-MV closed 5 days ago

WangWeiLin-MV commented 6 days ago

Fix issue https://github.com/microsoft/vcpkg/issues/42112, error with fatal error: 'avif/avif.h' file not found that target avif (i.e. avif_static) lost INTERFACE_INCLUDE_DIRECTORIES for static build.

Let merge_static_libs.cmake copy INTERFACE_INCLUDE_DIRECTORIES too.

vrabaud commented 5 days ago

Thx !

vrabaud commented 5 days ago

@WangWeiLin-MV , does that new version of the patch actually fix the original bug ?

WangWeiLin-MV commented 5 days ago

@vrabaud Yes, in my tests, it was generated correctly in packages/libavif_x64-windows-static/share/libavif/libavif-config.cmake

add_library(avif STATIC IMPORTED)

set_target_properties(avif PROPERTIES
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
)

and invoke avifVersion() successfully.

vrabaud commented 5 days ago

Great, thx !