From 1fe09e62703b18d19402b44aedf237ee8be6d74d Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Tue, 1 Aug 2023 15:43:07 +0200
Subject: [PATCH] project: move SDL_ttf.h into SDL3_ttf subfolder
---
.wikiheaders-options | 6 +++---
CMakeLists.txt | 9 +++++----
VisualC-WinRT/SDL_ttf-UWP.vcxproj | 2 +-
VisualC-WinRT/SDL_ttf-UWP.vcxproj.filters | 2 +-
VisualC/SDL_ttf.vcxproj | 2 +-
VisualC/SDL_ttf.vcxproj.filters | 2 +-
VisualC/pkg-support/cmake/sdl3_ttf-config-version.cmake | 4 ++--
VisualC/pkg-support/cmake/sdl3_ttf-config.cmake | 2 +-
Xcode/SDL_ttf.xcodeproj/project.pbxproj | 2 +-
build-scripts/test-versioning.sh | 2 +-
cmake/sdl3-ttf.pc.in | 2 +-
cmake/sdlmanpages.cmake | 2 +-
cmake/test/main.c | 2 +-
examples/glfont.c | 2 +-
examples/showfont.c | 2 +-
examples/testapp.c | 4 ++--
include/{SDL3 => SDL3_ttf}/SDL_ttf.h | 0
src/SDL_ttf.c | 2 +-
18 files changed, 25 insertions(+), 24 deletions(-)
rename include/{SDL3 => SDL3_ttf}/SDL_ttf.h (100%)
diff --git a/.wikiheaders-options b/.wikiheaders-options
index efde9480..3053eb27 100644
--- a/.wikiheaders-options
+++ b/.wikiheaders-options
@@ -1,10 +1,10 @@
projectfullname = SDL_ttf
projectshortname = SDL_ttf
-incsubdir = include/SDL3
+incsubdir = include/SDL3_ttf
wikisubdir = SDL3_ttf
apiprefixregex = TTF_
-mainincludefname = SDL3/SDL_ttf.h
-versionfname = include/SDL3/SDL_ttf.h
+mainincludefname = SDL3_ttf/SDL_ttf.h
+versionfname = include/SDL3_ttf/SDL_ttf.h
versionmajorregex = \A\#define\s+SDL_TTF_MAJOR_VERSION\s+(\d+)\Z
versionminorregex = \A\#define\s+SDL_TTF_MINOR_VERSION\s+(\d+)\Z
versionpatchregex = \A\#define\s+SDL_TTF_PATCHLEVEL\s+(\d+)\Z
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 29334312..49cf0832 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -103,9 +103,9 @@ endif()
target_include_directories(${sdl3_ttf_target_name}
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
- "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/SDL3>"
+ "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/SDL3_ttf>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
- "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/SDL3>"
+ "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/SDL3_ttf>"
)
target_compile_definitions(${sdl3_ttf_target_name} PRIVATE
BUILD_SDL
@@ -266,8 +266,8 @@ if(SDL3TTF_INSTALL)
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT library
)
install(FILES
- "${CMAKE_CURRENT_SOURCE_DIR}/include/SDL3/SDL_ttf.h"
- DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/SDL3" COMPONENT devel
+ "${CMAKE_CURRENT_SOURCE_DIR}/include/SDL3_ttf/SDL_ttf.h"
+ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/SDL3_ttf" COMPONENT devel
)
if(INSTALL_EXTRA_TARGETS)
@@ -335,6 +335,7 @@ if(SDL3TTF_INSTALL)
if(SDL3TTF_INSTALL_MAN)
SDL_generate_manpages(
+ HEADERS_DIR "${PROJECT_SOURCE_DIR}/include/SDL3_ttf"
SYMBOL "TTF_Init"
WIKIHEADERS_PL_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build-scripts/wikiheaders.pl"
)
diff --git a/VisualC-WinRT/SDL_ttf-UWP.vcxproj b/VisualC-WinRT/SDL_ttf-UWP.vcxproj
index 176ffa40..09b3b80e 100644
--- a/VisualC-WinRT/SDL_ttf-UWP.vcxproj
+++ b/VisualC-WinRT/SDL_ttf-UWP.vcxproj
@@ -27,7 +27,7 @@
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
- <ClInclude Include="..\include\SDL3\SDL_ttf.h" />
+ <ClInclude Include="..\include\SDL3_ttf\SDL_ttf.h" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\SDL\VisualC-WinRT\SDL-UWP.vcxproj">
diff --git a/VisualC-WinRT/SDL_ttf-UWP.vcxproj.filters b/VisualC-WinRT/SDL_ttf-UWP.vcxproj.filters
index 158e04c2..c6ff9844 100644
--- a/VisualC-WinRT/SDL_ttf-UWP.vcxproj.filters
+++ b/VisualC-WinRT/SDL_ttf-UWP.vcxproj.filters
@@ -275,7 +275,7 @@
</ClCompile>
</ItemGroup>
<ItemGroup>
- <ClInclude Include="..\include\SDL3\SDL_ttf.h">
+ <ClInclude Include="..\include\SDL3_ttf\SDL_ttf.h">
<Filter>Public Headers</Filter>
</ClInclude>
</ItemGroup>
diff --git a/VisualC/SDL_ttf.vcxproj b/VisualC/SDL_ttf.vcxproj
index 1ca317cd..2ff573cb 100644
--- a/VisualC/SDL_ttf.vcxproj
+++ b/VisualC/SDL_ttf.vcxproj
@@ -360,7 +360,7 @@
</ResourceCompile>
</ItemGroup>
<ItemGroup>
- <ClInclude Include="..\include\SDL3\SDL_ttf.h" />
+ <ClInclude Include="..\include\SDL3_ttf\SDL_ttf.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
diff --git a/VisualC/SDL_ttf.vcxproj.filters b/VisualC/SDL_ttf.vcxproj.filters
index 9bbed9a7..23bc872f 100644
--- a/VisualC/SDL_ttf.vcxproj.filters
+++ b/VisualC/SDL_ttf.vcxproj.filters
@@ -286,7 +286,7 @@
</ResourceCompile>
</ItemGroup>
<ItemGroup>
- <ClInclude Include="..\include\SDL3\SDL_ttf.h">
+ <ClInclude Include="..\include\SDL3_ttf\SDL_ttf.h">
<Filter>Public Headers</Filter>
</ClInclude>
</ItemGroup>
diff --git a/VisualC/pkg-support/cmake/sdl3_ttf-config-version.cmake b/VisualC/pkg-support/cmake/sdl3_ttf-config-version.cmake
index 076c78e9..632abfe4 100644
--- a/VisualC/pkg-support/cmake/sdl3_ttf-config-version.cmake
+++ b/VisualC/pkg-support/cmake/sdl3_ttf-config-version.cmake
@@ -3,12 +3,12 @@
# SDL3_ttf CMake version configuration file:
# This file is meant to be placed in a cmake subfolder of SDL3_ttf-devel-3.x.y-VC
-if(NOT EXISTS "${CMAKE_CURRENT_LIST_DIR}/../include/SDL3/SDL_ttf.h")
+if(NOT EXISTS "${CMAKE_CURRENT_LIST_DIR}/../include/SDL3_ttf/SDL_ttf.h")
message(AUTHOR_WARNING "Could not find SDL_ttf.h. This script is meant to be placed in a CMake subfolder of SDL3_ttf-devel-3.x.y-VC")
return()
endif()
-file(READ "${CMAKE_CURRENT_LIST_DIR}/../include/SDL3/SDL_ttf.h" _sdl_ttf_h)
+file(READ "${CMAKE_CURRENT_LIST_DIR}/../include/SDL3_ttf/SDL_ttf.h" _sdl_ttf_h)
string(REGEX MATCH "#define[ \t]+SDL_TTF_MAJOR_VERSION[ \t]+([0-9]+)" _sdl_major_re "${_sdl_ttf_h}")
set(_sdl_major "${CMAKE_MATCH_1}")
string(REGEX MATCH "#define[ \t]+SDL_TTF_MINOR_VERSION[ \t]+([0-9]+)" _sdl_minor_re "${_sdl_ttf_h}")
diff --git a/VisualC/pkg-support/cmake/sdl3_ttf-config.cmake b/VisualC/pkg-support/cmake/sdl3_ttf-config.cmake
index 8ac3f069..f3355047 100644
--- a/VisualC/pkg-support/cmake/sdl3_ttf-config.cmake
+++ b/VisualC/pkg-support/cmake/sdl3_ttf-config.cmake
@@ -37,7 +37,7 @@ if(NOT TARGET SDL3_ttf::SDL3_ttf)
add_library(SDL3_ttf::SDL3_ttf SHARED IMPORTED)
set_target_properties(SDL3_ttf::SDL3_ttf
PROPERTIES
- INTERFACE_INCLUDE_DIRECTORIES "${_sdl3ttf_incdir};${_sdl3ttf_incdir}/SDL3"
+ INTERFACE_INCLUDE_DIRECTORIES "${_sdl3ttf_incdir};${_sdl3ttf_incdir}/SDL3_ttf"
IMPORTED_IMPLIB "${_sdl3ttf_library}"
IMPORTED_LOCATION "${_sdl3ttf_dll}"
COMPATIBLE_INTERFACE_BOOL "SDL3_SHARED"
diff --git a/Xcode/SDL_ttf.xcodeproj/project.pbxproj b/Xcode/SDL_ttf.xcodeproj/project.pbxproj
index c677908b..4e733df7 100644
--- a/Xcode/SDL_ttf.xcodeproj/project.pbxproj
+++ b/Xcode/SDL_ttf.xcodeproj/project.pbxproj
@@ -148,7 +148,7 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
- 1014BAEA010A4B677F000001 /* SDL_ttf.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_ttf.h; path = ../include/SDL3/SDL_ttf.h; sourceTree = SOURCE_ROOT; };
+ 1014BAEA010A4B677F000001 /* SDL_ttf.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_ttf.h; path = ../include/SDL3_ttf/SDL_ttf.h; sourceTree = SOURCE_ROOT; };
7FC2F5DB285AC0D600836845 /* CMake */ = {isa = PBXFileReference; lastKnownFileType = folder; path = CMake; sourceTree = "<group>"; };
A75FDB0C23E37ED200529352 /* SDL3.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL3.framework; path = iOS/SDL3.framework; sourceTree = "<group>"; };
A75FDB1023E37EE400529352 /* SDL3.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL3.framework; path = tvOS/SDL3.framework; sourceTree = "<group>"; };
diff --git a/build-scripts/test-versioning.sh b/build-scripts/test-versioning.sh
index 6fedcbef..b2ecb8bd 100755
--- a/build-scripts/test-versioning.sh
+++ b/build-scripts/test-versioning.sh
@@ -9,7 +9,7 @@ cd `dirname $0`/..
# Needed so sed doesn't report illegal byte sequences on macOS
export LC_CTYPE=C
-header=include/SDL3/SDL_ttf.h
+header=include/SDL3_ttf/SDL_ttf.h
ref_major=$(sed -ne 's/^#define SDL_TTF_MAJOR_VERSION *//p' $header)
ref_minor=$(sed -ne 's/^#define SDL_TTF_MINOR_VERSION *//p' $header)
ref_micro=$(sed -ne 's/^#define SDL_TTF_PATCHLEVEL *//p' $header)
diff --git a/cmake/sdl3-ttf.pc.in b/cmake/sdl3-ttf.pc.in
index 6061b439..c725e390 100644
--- a/cmake/sdl3-ttf.pc.in
+++ b/cmake/sdl3-ttf.pc.in
@@ -10,4 +10,4 @@ Requires: sdl3 >= @SDL_REQUIRED_VERSION@
Libs: -L${libdir} -lSDL3_ttf
Requires.private: @PC_REQUIRES@
Libs.private: @PC_LIBS@
-Cflags: -I${includedir} -I${includedir}/SDL3
+Cflags: -I${includedir} -I${includedir}/SDL3_ttf
diff --git a/cmake/sdlmanpages.cmake b/cmake/sdlmanpages.cmake
index 0049de1f..f7691285 100644
--- a/cmake/sdlmanpages.cmake
+++ b/cmake/sdlmanpages.cmake
@@ -17,7 +17,7 @@ function(SDL_generate_manpages)
endif()
if(NOT ARG_HEADERS_DIR)
- set(ARG_HEADERS_DIR "${PROJECT_SOURCE_DIR}/include/SDL3")
+ message(FATAL_ERROR "Missing required HEADERS_DIR argument")
endif()
# FIXME: get rid of SYMBOL and let the perl script figure out the dependencies
diff --git a/cmake/test/main.c b/cmake/test/main.c
index 83577a1c..f8d7ac1a 100644
--- a/cmake/test/main.c
+++ b/cmake/test/main.c
@@ -1,6 +1,6 @@
#include <SDL3/SDL.h>
#include <SDL3/SDL_main.h>
-#include <SDL3/SDL_ttf.h>
+#include <SDL3_ttf/SDL_ttf.h>
int main(int argc, char *argv[])
{
diff --git a/examples/glfont.c b/examples/glfont.c
index 9f204d17..04444c52 100644
--- a/examples/glfont.c
+++ b/examples/glfont.c
@@ -30,7 +30,7 @@
#include <SDL3/SDL.h>
#include <SDL3/SDL_main.h>
-#include <SDL3/SDL_ttf.h>
+#include <SDL3_ttf/SDL_ttf.h>
#ifdef HAVE_OPENGL
diff --git a/examples/showfont.c b/examples/showfont.c
index d9bbeb55..11fe36b0 100644
--- a/examples/showfont.c
+++ b/examples/showfont.c
@@ -23,7 +23,7 @@
#include <SDL3/SDL.h>
#include <SDL3/SDL_main.h>
-#include <SDL3/SDL_ttf.h>
+#include <SDL3_ttf/SDL_ttf.h>
#include <stdlib.h>
#include <stdio.h>
diff --git a/examples/testapp.c b/examples/testapp.c
index 85e34e1b..d2676d26 100644
--- a/examples/testapp.c
+++ b/examples/testapp.c
@@ -37,8 +37,8 @@ static const int g_force_no_SDF = 0; /* make random fuzzer faster by disabling S
#include <stdlib.h>
#include <time.h>
-#include "SDL3/SDL.h"
-#include "SDL3/SDL_ttf.h"
+#include <SDL3/SDL.h>
+#include <SDL3_ttf/SDL_ttf.h>
static char *testapp_basename(const char *path) {
static char buffer[1024];
diff --git a/include/SDL3/SDL_ttf.h b/include/SDL3_ttf/SDL_ttf.h
similarity index 100%
rename from include/SDL3/SDL_ttf.h
rename to include/SDL3_ttf/SDL_ttf.h
diff --git a/src/SDL_ttf.c b/src/SDL_ttf.c
index 190ee968..445d3d20 100644
--- a/src/SDL_ttf.c
+++ b/src/SDL_ttf.c
@@ -20,7 +20,7 @@
*/
#include <SDL3/SDL.h>
-#include <SDL3/SDL_ttf.h>
+#include <SDL3_ttf/SDL_ttf.h>
#include <ft2build.h>
#include FT_FREETYPE_H