Skip to content

Commit

Permalink
project: move SDL_ttf.h into SDL3_ttf subfolder
Browse files Browse the repository at this point in the history
  • Loading branch information
madebr committed Aug 1, 2023
1 parent fee14e5 commit 65ec05d
Show file tree
Hide file tree
Showing 18 changed files with 25 additions and 24 deletions.
6 changes: 3 additions & 3 deletions .wikiheaders-options
Original file line number Diff line number Diff line change
@@ -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
Expand Down
9 changes: 5 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion VisualC-WinRT/SDL_ttf-UWP.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
2 changes: 1 addition & 1 deletion VisualC-WinRT/SDL_ttf-UWP.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion VisualC/SDL_ttf.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
2 changes: 1 addition & 1 deletion VisualC/SDL_ttf.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
4 changes: 2 additions & 2 deletions VisualC/pkg-support/cmake/sdl3_ttf-config-version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
2 changes: 1 addition & 1 deletion VisualC/pkg-support/cmake/sdl3_ttf-config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion Xcode/SDL_ttf.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,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>"; };
Expand Down
2 changes: 1 addition & 1 deletion build-scripts/test-versioning.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion cmake/sdl3-ttf.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion cmake/sdlmanpages.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmake/test/main.c
Original file line number Diff line number Diff line change
@@ -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[])
{
Expand Down
2 changes: 1 addition & 1 deletion examples/glfont.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion examples/showfont.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
4 changes: 2 additions & 2 deletions examples/testapp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/SDL_ttf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 65ec05d

Please sign in to comment.