Fix avif version detection

Currently, even though libavif is found, the version of libavif will not
be printed. `find_package(libavif QUIET)` will set `libavif_VERSION`
according to cmake documentation https://cmake.org/cmake/help/latest/command/find_package.html#config-mode-version-selection

This patch has been tested on ArchLinux with libavif 1.0.3 installed.
This commit is contained in:
Letu Ren 2023-12-29 00:16:52 +08:00
parent 2e3ccb4e8e
commit 6e3685d733

View File

@ -1452,8 +1452,8 @@ if(WITH_WEBP OR HAVE_WEBP)
endif()
if(WITH_AVIF OR HAVE_AVIF)
if(AVIF_VERSION)
status(" AVIF:" AVIF_FOUND THEN "${AVIF_LIBRARY} (ver ${AVIF_VERSION})" ELSE "NO")
if(libavif_VERSION)
status(" AVIF:" AVIF_FOUND THEN "${AVIF_LIBRARY} (ver ${libavif_VERSION})" ELSE "NO")
else()
status(" AVIF:" AVIF_FOUND THEN "${AVIF_LIBRARY}" ELSE "NO")
endif()