SDL_image: cmake: make sure SDL3's include directory comes first (2a78d)

From 2a78d8fe16b96914af6d9adf8e18b7cf54ce51a5 Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Sun, 26 Oct 2025 20:49:15 +0100
Subject: [PATCH] cmake: make sure SDL3's include directory comes first

Include directories of a target come before those of linked targets.

(cherry picked from commit 99a502cc1d6bf237a1c243c2623cc4d1786f09a3)
---
 CMakeLists.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index a35a173a..10cc71b3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -290,6 +290,8 @@ target_compile_definitions(${sdl3_image_target_name} PRIVATE
     SDL_BUILD_MINOR_VERSION=${MINOR_VERSION}
     SDL_BUILD_MICRO_VERSION=${MICRO_VERSION}
 )
+# Make sure SDL3's include directory comes first
+target_include_directories(${sdl3_image_target_name} PUBLIC $<TARGET_PROPERTY:SDL3::Headers,INTERFACE_INCLUDE_DIRECTORIES>)
 target_link_libraries(${sdl3_image_target_name} PUBLIC SDL3::Headers)
 if(SDLIMAGE_BUILD_SHARED_LIBS)
     target_link_libraries(${sdl3_image_target_name} PRIVATE SDL3::SDL3-shared)