SDL_image: cmake: create ZLIB::ZLIB target

From 4134157d06e3d7dfd81dd21c2429a212fa92a1d7 Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Mon, 29 Jan 2024 20:19:27 +0100
Subject: [PATCH] cmake: create ZLIB::ZLIB target

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

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d0f0f1a9..06e18b0e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -411,6 +411,9 @@ if(SDL3IMAGE_ZLIB)
         else()
             set(ZLIB_LIBRARY zlibstatic)
         endif()
+        if(NOT TARGET ZLIB::ZLIB)
+            add_library(ZLIB::ZLIB ALIAS ${ZLIB_LIBRARY})
+        endif()
         # ZLIB_LIBRARIES variable is used by vendored libpng
         set(ZLIB_LIBRARIES "${ZLIB_LIBRARY}")
         # ZLIB_INCLUDE_DIRS variable is used by vendored libpng