- added fallback to pkg-config if webp cmake module wasn't found

fixes linker errors: undefined reference to `WebPGetInfo`, `WebPMuxCreateInternal`, `WebPMuxGetChunk`, `WebPMuxDelete`, `WebPInitDecoderConfigInternal`, `WebPDecode`
This commit is contained in:
alexey.lysiuk 2023-09-07 13:13:25 +03:00
parent ecc0301f5b
commit 964f98da12

View file

@ -229,6 +229,20 @@ find_package( VPX )
find_package( ZLIB )
find_package( WebP )
if (NOT WebP_FOUND)
include(FindPkgConfig)
pkg_check_modules(libwebp IMPORTED_TARGET libwebp)
if (NOT TARGET PkgConfig::libwebp)
message(SEND_ERROR "libwebp not found")
endif()
pkg_check_modules(libwebpmux REQUIRED IMPORTED_TARGET libwebpmux)
pkg_check_modules(libwebpdemux REQUIRED IMPORTED_TARGET libwebpdemux)
add_library(WebP::webp ALIAS PkgConfig::libwebp)
add_library(WebP::webpdemux ALIAS PkgConfig::libwebpdemux)
add_library(WebP::libwebpmux ALIAS PkgConfig::libwebpmux)
endif()
include( TargetArch )
target_architecture(TARGET_ARCHITECTURE)