SDL_rtf: project: move SDL_rtf.h into SDL3_rtf subfolder

From 91bf20b424f042a0007bc55e1c4b326925552a4d Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Tue, 1 Aug 2023 15:52:06 +0200
Subject: [PATCH] project: move SDL_rtf.h into SDL3_rtf subfolder

---
 .wikiheaders-options                 | 6 +++---
 CMakeLists.txt                       | 9 +++++----
 cmake/sdl3-rtf.pc.in                 | 2 +-
 cmake/sdlmanpages.cmake              | 2 +-
 examples/showrtf.c                   | 4 ++--
 include/{SDL3 => SDL3_rtf}/SDL_rtf.h | 0
 src/SDL_rtf.c                        | 2 +-
 src/SDL_rtfreadr.c                   | 2 +-
 src/rtfactn.c                        | 2 +-
 9 files changed, 15 insertions(+), 14 deletions(-)
 rename include/{SDL3 => SDL3_rtf}/SDL_rtf.h (100%)

diff --git a/.wikiheaders-options b/.wikiheaders-options
index 8269e8f..f300c4d 100644
--- a/.wikiheaders-options
+++ b/.wikiheaders-options
@@ -1,10 +1,10 @@
 projectfullname = SDL_rtf
 projectshortname = SDL_rtf
-incsubdir =
+incsubdir = include/SDL3_rtf
 wikisubdir = SDL_rtf
 apiprefixregex = RTF_
-mainincludefname = SDL3/SDL_rtf.h
-versionfname = include/SDL3/SDL_rtf.h
+mainincludefname = SDL3_rtf/SDL_rtf.h
+versionfname = include/SDL3_rtf/SDL_rtf.h
 versionmajorregex = \A\#define\s+SDL_RTF_MAJOR_VERSION\s+(\d+)\Z
 versionminorregex = \A\#define\s+SDL_RTF_MINOR_VERSION\s+(\d+)\Z
 versionpatchregex = \A\#define\s+SDL_RTF_PATCHLEVEL\s+(\d+)\Z
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7eed890..d82ec79 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -101,9 +101,9 @@ endif()
 target_include_directories(${sdl3_rtf_target_name} PUBLIC
     "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>"
     "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
-    "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/SDL3>"
+    "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/SDL3_rtf>"
     "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/include>"
-    "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/include/SDL3>"
+    "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/include/SDL3_rtf>"
 )
 target_compile_definitions(${sdl3_rtf_target_name} PRIVATE
     BUILD_SDL
@@ -177,8 +177,8 @@ if(SDL3RTF_INSTALL)
         RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT library
     )
     install(
-        FILES "${CMAKE_CURRENT_SOURCE_DIR}/include/SDL3/SDL_rtf.h"
-        DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/SDL3" COMPONENT devel
+        FILES "${CMAKE_CURRENT_SOURCE_DIR}/include/SDL3_rtf/SDL_rtf.h"
+        DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/SDL3_rtf" COMPONENT devel
     )
 
     if(WIN32 AND NOT MINGW)
@@ -226,6 +226,7 @@ if(SDL3RTF_INSTALL)
 
     if(SDL3RTF_INSTALL_MAN)
         SDL_generate_manpages(
+            HEADERS_DIR "${PROJECT_DIR}/include/SDL3_rtf"
             SYMBOL "RTF_CreateContext"
             WIKIHEADERS_PL_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build-scripts/wikiheaders.pl"
         )
diff --git a/cmake/sdl3-rtf.pc.in b/cmake/sdl3-rtf.pc.in
index a84141a..2b7ccb7 100644
--- a/cmake/sdl3-rtf.pc.in
+++ b/cmake/sdl3-rtf.pc.in
@@ -8,4 +8,4 @@ Description: Support for Rich Text Format (.rtf) files with Simple Directmedia L
 Version: @PROJECT_VERSION@
 Requires: sdl3 >= @SDL_REQUIRED_VERSION@
 Libs: -L${libdir} -lSDL3_rtf
-Cflags: -I${includedir} -I${includedir}/SDL3 @SDL_PC_CFLAGS@
+Cflags: -I${includedir} -I${includedir}/SDL3_rtf @SDL_PC_CFLAGS@
diff --git a/cmake/sdlmanpages.cmake b/cmake/sdlmanpages.cmake
index 0049de1..f769128 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/examples/showrtf.c b/examples/showrtf.c
index f6734d8..33ebfb5 100644
--- a/examples/showrtf.c
+++ b/examples/showrtf.c
@@ -22,8 +22,8 @@
 /* A simple program to test the RTF rendering of the SDL_rtf library */
 
 #include <SDL3/SDL.h>
-#include <SDL3/SDL_ttf.h>
-#include <SDL3/SDL_rtf.h>
+#include <SDL3_ttf/SDL_ttf.h>
+#include <SDL3_rtf/SDL_rtf.h>
 
 #define SCREEN_WIDTH    640
 #define SCREEN_HEIGHT   480
diff --git a/include/SDL3/SDL_rtf.h b/include/SDL3_rtf/SDL_rtf.h
similarity index 100%
rename from include/SDL3/SDL_rtf.h
rename to include/SDL3_rtf/SDL_rtf.h
diff --git a/src/SDL_rtf.c b/src/SDL_rtf.c
index fef0d48..3f9f532 100644
--- a/src/SDL_rtf.c
+++ b/src/SDL_rtf.c
@@ -20,7 +20,7 @@
 */
 
 #include <SDL3/SDL.h>
-#include <SDL3/SDL_rtf.h>
+#include <SDL3_rtf/SDL_rtf.h>
 
 #include "rtftype.h"
 #include "rtfdecl.h"
diff --git a/src/SDL_rtfreadr.c b/src/SDL_rtfreadr.c
index 3265738..1218e0f 100644
--- a/src/SDL_rtfreadr.c
+++ b/src/SDL_rtfreadr.c
@@ -19,7 +19,7 @@
   3. This notice may not be removed or altered from any source distribution.
 */
 
-#include <SDL3/SDL_rtf.h>
+#include <SDL3_rtf/SDL_rtf.h>
 #include "SDL_rtfreadr.h"
 
 #include "rtftype.h"
diff --git a/src/rtfactn.c b/src/rtfactn.c
index 2bc34d2..87c1e31 100644
--- a/src/rtfactn.c
+++ b/src/rtfactn.c
@@ -3,7 +3,7 @@
  * http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnrtfspec/html/rtfspec.asp
  */
 
-#include "SDL.h"
+#include <SDL3/SDL.h>
 
 #include "rtftype.h"
 #include "rtfdecl.h"