SDL_image: Support libavif 1.0, bump minimum required libavif from 0.9.1 to 0.9.3. (05448)

From 05448e2e0818178664a647c4c114e3c192714bb1 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Fri, 8 Sep 2023 21:04:32 +0300
Subject: [PATCH] Support libavif 1.0, bump minimum required libavif from 0.9.1
 to 0.9.3.

---
 CMakeLists.txt | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index cc9fa261..1f6d6183 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -96,7 +96,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.1")
+set(LIBAVIF_MINIMUM_VERSION "0.9.3")
 if(SDL3IMAGE_VENDORED AND SDL3IMAGE_AVIF)
     set(SDL3IMAGE_AVIF_VENDORED ON)
 else()
@@ -370,7 +370,17 @@ if(SDL3IMAGE_AVIF)
         endif()
     else()
         message(STATUS "${PROJECT_NAME}: Using system libavif")
-        find_package(libavif ${LIBAVIF_MINIMUM_VERSION} REQUIRED)
+        find_package(libavif 1.0 QUIET)
+        if(NOT libavif_FOUND)
+            message(STATUS "libavif-1.0 or compatible not found")
+            find_package(libavif ${LIBAVIF_MINIMUM_VERSION} QUIET)
+        endif()
+        if(libavif_FOUND)
+            message(STATUS "libavif-${libavif_VERSION} found")
+        else()
+            message(STATUS "libavif-${LIBAVIF_MINIMUM_VERSION} or compatible not found")
+            message(FATAL_ERROR "libavif NOT found")
+        endif()
         if(NOT SDL3IMAGE_AVIF_SHARED)
             list(APPEND PC_REQUIRES libavif)
         endif()