SDL_image: cmake: require at least libavif 1.0

From fbfc1e53151336fbbb227a4226a9d6d680c355cf Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Wed, 24 Jan 2024 16:51:54 +0100
Subject: [PATCH] cmake: require at least libavif 1.0

---
 CMakeLists.txt | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

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")