SDL_ttf: cmake: make sure SDL3's include directory comes first

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

Include directories of a target come before those of linked targets.
---
 CMakeLists.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7b27db8c..b1bbe793 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -160,6 +160,8 @@ target_compile_definitions(${sdl3_ttf_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_ttf_target_name} PRIVATE $<TARGET_PROPERTY:SDL3::Headers,INTERFACE_INCLUDE_DIRECTORIES>)
 target_link_libraries(${sdl3_ttf_target_name} PUBLIC SDL3::Headers)
 if(SDLTTF_BUILD_SHARED_LIBS)
     target_link_libraries(${sdl3_ttf_target_name} PRIVATE SDL3::SDL3-shared)