diff --git a/CMakeLists.txt b/CMakeLists.txt index dd0f96ab..7323c5d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -113,7 +113,7 @@ option(SDL3IMAGE_XV "Support loading XV images" ON) cmake_dependent_option(SDL3IMAGE_JPG_SAVE "Add JPEG save support" ON SDL3IMAGE_JPG OFF) cmake_dependent_option(SDL3IMAGE_PNG_SAVE "Add PNG save support" ON SDL3IMAGE_PNG OFF) -set(LIBAVIF_MINIMUM_VERSION "0.9.3") +set(LIBAVIF_MINIMUM_VERSION "1.0") if(SDL3IMAGE_VENDORED AND SDL3IMAGE_AVIF) set(SDL3IMAGE_AVIF_VENDORED ON) else() @@ -445,15 +445,12 @@ if(SDL3IMAGE_AVIF) endif() endif() else() - find_package(libavif 1.0 QUIET) - if(NOT libavif_FOUND) - find_package(libavif ${LIBAVIF_MINIMUM_VERSION} QUIET) - endif() + find_package(libavif "${LIBAVIF_MINIMUM_VERSION}" QUIET ${required}) if(libavif_FOUND) message(STATUS "${PROJECT_NAME}: Using system libavif") set(SDL3IMAGE_AVIF_ENABLED TRUE) if(NOT SDL3IMAGE_AVIF_SHARED) - list(APPEND PC_REQUIRES libavif) + list(APPEND PC_REQUIRES "libavif >= ${LIBAVIF_MINIMUM_VERSION}") endif() else() message(STATUS "libavif-${LIBAVIF_MINIMUM_VERSION} or compatible not found")