SDL_image: cmake: look for libavif 0.9.3 and 1.0 in SDL3_imageConfig.cmake

From 5dbaffa28879c6c4e6fdcb24fe9b6e9627bb5cb6 Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Fri, 8 Sep 2023 22:29:26 +0200
Subject: [PATCH] cmake: look for libavif 0.9.3 and 1.0 in
 SDL3_imageConfig.cmake

---
 cmake/SDL3_imageConfig.cmake.in | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/cmake/SDL3_imageConfig.cmake.in b/cmake/SDL3_imageConfig.cmake.in
index ec35ceea..b33bda0e 100644
--- a/cmake/SDL3_imageConfig.cmake.in
+++ b/cmake/SDL3_imageConfig.cmake.in
@@ -58,7 +58,14 @@ if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL3_image-static-targets.cmake")
         include(CMakeFindDependencyMacro)
 
         if(SDL3IMAGE_AVIF AND NOT TARGET avif)
-            find_dependency(libavif @LIBAVIF_MINIMUM_VERSION@)
+            find_package(libavif 1.0 QUIET)
+            if(NOT libavif_FOUND)
+                find_package(libavif $@LIBAVIF_MINIMUM_VERSION@ QUIET)
+            endif()
+            if(NOT libavif_FOUND)
+                set(SDL3_image_FOUND FALSE)
+                return()
+            endif()
         endif()
 
         if(SDL3IMAGE_JPG AND NOT TARGET JPEG::JPEG)