SDL_mixer: cmake: install headers through install(FILES)

From 2a6bc9469dc0c456ba5bf33122d6d41b404bdec9 Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Sat, 23 Jul 2022 16:42:31 +0200
Subject: [PATCH] cmake: install headers through install(FILES)

---
 CMakeLists.txt | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 48d31916..a12b0caa 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -228,7 +228,6 @@ if(WIN32 AND BUILD_SHARED_LIBS)
 endif()
 set_target_properties(SDL2_mixer PROPERTIES
     DEFINE_SYMBOL DLL_EXPORT
-    PUBLIC_HEADER "include/SDL_mixer.h"
     EXPORT_NAME ${sdl2_mixer_export_name}
     C_VISIBILITY_PRESET "hidden"
 )
@@ -765,6 +764,10 @@ if(SDL2MIXER_INSTALL)
         RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT library
         PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/SDL2" COMPONENT devel
     )
+    install(FILES
+        "${CMAKE_CURRENT_SOURCE_DIR}/include/SDL_mixer.h"
+        DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/SDL2" COMPONENT devel
+    )
 
     if(INSTALL_EXTRA_TARGETS)
         install(TARGETS ${INSTALL_EXTRA_TARGETS}