SDL: cmake: install SDL headers with SYSTEM property disabled

From 4eb0f10ddad963034f5088818e4bb8908ff479b8 Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Fri, 29 Mar 2024 19:38:46 +0100
Subject: [PATCH] cmake: install SDL headers with SYSTEM property disabled

This causes the SDL include path to be added using -I instead of -isystem
---
 CMakeLists.txt | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 21e38c1d39b66..ff7c702f6aa63 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3211,9 +3211,10 @@ endif()
 
 add_library(SDL3_Headers INTERFACE)
 add_library(SDL3::Headers ALIAS SDL3_Headers)
-set_target_properties(SDL3_Headers PROPERTIES
-  EXPORT_NAME "Headers"
-)
+set_property(TARGET SDL3_Headers PROPERTY EXPORT_NAME "Headers")
+if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.25")
+  set_property(TARGET SDL3_Headers PROPERTY EXPORT_NO_SYSTEM "TRUE")
+endif()
 target_include_directories(SDL3_Headers
   INTERFACE
     "$<BUILD_INTERFACE:${SDL3_BINARY_DIR}/include>"