SDL_image: cmake: install the headers through install(FILES)

From ad90b4add85493900f8f64780c1a6795bf9a6e0d Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Sat, 23 Jul 2022 15:35:46 +0200
Subject: [PATCH] cmake: install the headers through install(FILES)

---
 CMakeLists.txt | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6d02f623..9f1ea7c4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -223,7 +223,6 @@ if(WIN32 AND SDL2IMAGE_BUILD_SHARED_LIBS)
 endif()
 set_target_properties(SDL2_image PROPERTIES
     DEFINE_SYMBOL DLL_EXPORT
-    PUBLIC_HEADER SDL_image.h
     EXPORT_NAME ${sdl2_image_export_name}
     C_VISIBILITY_PRESET "hidden"
 )
@@ -655,7 +654,10 @@ if(SDL2IMAGE_INSTALL)
         ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel
         LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT library
         RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT library
-        PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/SDL2" COMPONENT devel
+    )
+    install(
+        FILES "${CMAKE_CURRENT_SOURCE_DIR}/SDL_image.h"
+        DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/SDL2" COMPONENT DEVEL
     )
 
     if(INSTALL_EXTRA_TARGETS)