SDL_net: cmake: install headers through install(FILES)

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

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

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 77110e9..859cba8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -101,7 +101,6 @@ if(WIN32)
 endif()
 set_target_properties(SDL2_net PROPERTIES
     DEFINE_SYMBOL DLL_EXPORT
-    PUBLIC_HEADER SDL_net.h
     EXPORT_NAME ${sdl2_net_export_name}
     C_VISIBILITY_PRESET "hidden"
 )
@@ -172,7 +171,10 @@ if(SDL2NET_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_net.h"
+        DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/SDL2" COMPONENT devel
     )
 
     if(WIN32 AND NOT MINGW)