SDL_net: fixes for public header inclusion

From d90dd39a192dd29de9cb4e4032aabcddbd50f5cd Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Sat, 30 Sep 2023 14:33:02 +0300
Subject: [PATCH] fixes for public header inclusion

---
 CMakeLists.txt                                  | 2 --
 VisualC/examples/get-local-addrs.vcxproj        | 8 ++++----
 VisualC/examples/resolve-hostnames.vcxproj      | 8 ++++----
 VisualC/examples/simple-http-get.vcxproj        | 8 ++++----
 VisualC/examples/voipchat.vcxproj               | 8 ++++----
 VisualC/pkg-support/cmake/sdl3_net-config.cmake | 2 +-
 cmake/sdl3-net.pc.in                            | 2 +-
 examples/get-local-addrs.c                      | 2 +-
 examples/resolve-hostnames.c                    | 2 +-
 examples/simple-http-get.c                      | 2 +-
 examples/voipchat.c                             | 5 +----
 11 files changed, 22 insertions(+), 27 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 80ea69a..14eb429 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -90,9 +90,7 @@ endif()
 target_include_directories(${sdl3_net_target_name}
     PUBLIC
         "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
-        "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/SDL3_net>"
         "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
-        "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/SDL3_net>"
 )
 target_compile_definitions(${sdl3_net_target_name} PRIVATE
     BUILD_SDL
diff --git a/VisualC/examples/get-local-addrs.vcxproj b/VisualC/examples/get-local-addrs.vcxproj
index d873fb2..34ab76a 100644
--- a/VisualC/examples/get-local-addrs.vcxproj
+++ b/VisualC/examples/get-local-addrs.vcxproj
@@ -83,19 +83,19 @@
     <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <IncludePath>$(SolutionDir)..\..\SDL\include;$(SolutionDir)..\include;$(SolutionDir)..\include\SDL3_net;$(IncludePath)</IncludePath>
+    <IncludePath>$(SolutionDir)..\..\SDL\include;$(SolutionDir)..\include;$(IncludePath)</IncludePath>
     <LibraryPath>$(SolutionDir)..\..\SDL\VisualC\$(PlatformName)\$(Configuration);$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <IncludePath>$(SolutionDir)..\..\SDL\include;$(SolutionDir)..\include;$(SolutionDir)..\include\SDL3_net;$(IncludePath)</IncludePath>
+    <IncludePath>$(SolutionDir)..\..\SDL\include;$(SolutionDir)..\include;$(IncludePath)</IncludePath>
     <LibraryPath>$(SolutionDir)..\..\SDL\VisualC\$(PlatformName)\$(Configuration);$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <IncludePath>$(SolutionDir)..\..\SDL\include;$(SolutionDir)..\include;$(SolutionDir)..\include\SDL3_net;$(IncludePath)</IncludePath>
+    <IncludePath>$(SolutionDir)..\..\SDL\include;$(SolutionDir)..\include;$(IncludePath)</IncludePath>
     <LibraryPath>$(SolutionDir)..\..\SDL\VisualC\$(PlatformName)\$(Configuration);$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <IncludePath>$(SolutionDir)..\..\SDL\include;$(SolutionDir)..\include;$(SolutionDir)..\include\SDL3_net;$(IncludePath)</IncludePath>
+    <IncludePath>$(SolutionDir)..\..\SDL\include;$(SolutionDir)..\include;$(IncludePath)</IncludePath>
     <LibraryPath>$(SolutionDir)..\..\SDL\VisualC\$(PlatformName)\$(Configuration);$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
diff --git a/VisualC/examples/resolve-hostnames.vcxproj b/VisualC/examples/resolve-hostnames.vcxproj
index 30f16bf..80cf3a0 100644
--- a/VisualC/examples/resolve-hostnames.vcxproj
+++ b/VisualC/examples/resolve-hostnames.vcxproj
@@ -83,19 +83,19 @@
     <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <IncludePath>$(SolutionDir)..\..\SDL\include;$(SolutionDir)..\include;$(SolutionDir)..\include\SDL3_net;$(IncludePath)</IncludePath>
+    <IncludePath>$(SolutionDir)..\..\SDL\include;$(SolutionDir)..\include;$(IncludePath)</IncludePath>
     <LibraryPath>$(SolutionDir)..\..\SDL\VisualC\$(PlatformName)\$(Configuration);$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <IncludePath>$(SolutionDir)..\..\SDL\include;$(SolutionDir)..\include;$(SolutionDir)..\include\SDL3_net;$(IncludePath)</IncludePath>
+    <IncludePath>$(SolutionDir)..\..\SDL\include;$(SolutionDir)..\include;$(IncludePath)</IncludePath>
     <LibraryPath>$(SolutionDir)..\..\SDL\VisualC\$(PlatformName)\$(Configuration);$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <IncludePath>$(SolutionDir)..\..\SDL\include;$(SolutionDir)..\include;$(SolutionDir)..\include\SDL3_net;$(IncludePath)</IncludePath>
+    <IncludePath>$(SolutionDir)..\..\SDL\include;$(SolutionDir)..\include;$(IncludePath)</IncludePath>
     <LibraryPath>$(SolutionDir)..\..\SDL\VisualC\$(PlatformName)\$(Configuration);$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <IncludePath>$(SolutionDir)..\..\SDL\include;$(SolutionDir)..\include;$(SolutionDir)..\include\SDL3_net;$(IncludePath)</IncludePath>
+    <IncludePath>$(SolutionDir)..\..\SDL\include;$(SolutionDir)..\include;$(IncludePath)</IncludePath>
     <LibraryPath>$(SolutionDir)..\..\SDL\VisualC\$(PlatformName)\$(Configuration);$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
diff --git a/VisualC/examples/simple-http-get.vcxproj b/VisualC/examples/simple-http-get.vcxproj
index 93c9c38..e900e1b 100644
--- a/VisualC/examples/simple-http-get.vcxproj
+++ b/VisualC/examples/simple-http-get.vcxproj
@@ -83,19 +83,19 @@
     <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <IncludePath>$(SolutionDir)..\..\SDL\include;$(SolutionDir)..\include;$(SolutionDir)..\include\SDL3_net;$(IncludePath)</IncludePath>
+    <IncludePath>$(SolutionDir)..\..\SDL\include;$(SolutionDir)..\include;$(IncludePath)</IncludePath>
     <LibraryPath>$(SolutionDir)..\..\SDL\VisualC\$(PlatformName)\$(Configuration);$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <IncludePath>$(SolutionDir)..\..\SDL\include;$(SolutionDir)..\include;$(SolutionDir)..\include\SDL3_net;$(IncludePath)</IncludePath>
+    <IncludePath>$(SolutionDir)..\..\SDL\include;$(SolutionDir)..\include;$(IncludePath)</IncludePath>
     <LibraryPath>$(SolutionDir)..\..\SDL\VisualC\$(PlatformName)\$(Configuration);$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <IncludePath>$(SolutionDir)..\..\SDL\include;$(SolutionDir)..\include;$(SolutionDir)..\include\SDL3_net;$(IncludePath)</IncludePath>
+    <IncludePath>$(SolutionDir)..\..\SDL\include;$(SolutionDir)..\include;$(IncludePath)</IncludePath>
     <LibraryPath>$(SolutionDir)..\..\SDL\VisualC\$(PlatformName)\$(Configuration);$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <IncludePath>$(SolutionDir)..\..\SDL\include;$(SolutionDir)..\include;$(SolutionDir)..\include\SDL3_net;$(IncludePath)</IncludePath>
+    <IncludePath>$(SolutionDir)..\..\SDL\include;$(SolutionDir)..\include;$(IncludePath)</IncludePath>
     <LibraryPath>$(SolutionDir)..\..\SDL\VisualC\$(PlatformName)\$(Configuration);$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
diff --git a/VisualC/examples/voipchat.vcxproj b/VisualC/examples/voipchat.vcxproj
index 2ceafd0..98b4e4f 100644
--- a/VisualC/examples/voipchat.vcxproj
+++ b/VisualC/examples/voipchat.vcxproj
@@ -83,19 +83,19 @@
     <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <IncludePath>$(SolutionDir)..\..\SDL\include;$(SolutionDir)..\include;$(SolutionDir)..\include\SDL3_net;$(IncludePath)</IncludePath>
+    <IncludePath>$(SolutionDir)..\..\SDL\include;$(SolutionDir)..\include;$(IncludePath)</IncludePath>
     <LibraryPath>$(SolutionDir)..\..\SDL\VisualC\$(PlatformName)\$(Configuration);$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <IncludePath>$(SolutionDir)..\..\SDL\include;$(SolutionDir)..\include;$(SolutionDir)..\include\SDL3_net;$(IncludePath)</IncludePath>
+    <IncludePath>$(SolutionDir)..\..\SDL\include;$(SolutionDir)..\include;$(IncludePath)</IncludePath>
     <LibraryPath>$(SolutionDir)..\..\SDL\VisualC\$(PlatformName)\$(Configuration);$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <IncludePath>$(SolutionDir)..\..\SDL\include;$(SolutionDir)..\include;$(SolutionDir)..\include\SDL3_net;$(IncludePath)</IncludePath>
+    <IncludePath>$(SolutionDir)..\..\SDL\include;$(SolutionDir)..\include;$(IncludePath)</IncludePath>
     <LibraryPath>$(SolutionDir)..\..\SDL\VisualC\$(PlatformName)\$(Configuration);$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <IncludePath>$(SolutionDir)..\..\SDL\include;$(SolutionDir)..\include;$(SolutionDir)..\include\SDL3_net;$(IncludePath)</IncludePath>
+    <IncludePath>$(SolutionDir)..\..\SDL\include;$(SolutionDir)..\include;$(IncludePath)</IncludePath>
     <LibraryPath>$(SolutionDir)..\..\SDL\VisualC\$(PlatformName)\$(Configuration);$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
diff --git a/VisualC/pkg-support/cmake/sdl3_net-config.cmake b/VisualC/pkg-support/cmake/sdl3_net-config.cmake
index 6f9de2b..f42bceb 100644
--- a/VisualC/pkg-support/cmake/sdl3_net-config.cmake
+++ b/VisualC/pkg-support/cmake/sdl3_net-config.cmake
@@ -31,7 +31,7 @@ if(NOT TARGET SDL3_net::SDL3_net-shared)
     add_library(SDL3_net::SDL3_net-shared SHARED IMPORTED)
     set_target_properties(SDL3_net::SDL3_net-shared
         PROPERTIES
-            INTERFACE_INCLUDE_DIRECTORIES "${_sdl3net_incdir};${_sdl3net_incdir}/SDL3_net"
+            INTERFACE_INCLUDE_DIRECTORIES "${_sdl3net_incdir}"
             IMPORTED_IMPLIB "${_sdl3net_library}"
             IMPORTED_LOCATION "${_sdl3net_dll}"
             COMPATIBLE_INTERFACE_BOOL "SDL3_SHARED"
diff --git a/cmake/sdl3-net.pc.in b/cmake/sdl3-net.pc.in
index e26a675..36ba83a 100644
--- a/cmake/sdl3-net.pc.in
+++ b/cmake/sdl3-net.pc.in
@@ -10,4 +10,4 @@ Requires: sdl3 >= @SDL_REQUIRED_VERSION@
 Libs: -L${libdir} -lSDL3_net
 Requires.private: @PC_REQUIRES@
 Libs.private: @PC_LIBS@
-Cflags: -I${includedir} -I${includedir}/SDL3_net
+Cflags: -I${includedir}
diff --git a/examples/get-local-addrs.c b/examples/get-local-addrs.c
index f563b79..5dffc39 100644
--- a/examples/get-local-addrs.c
+++ b/examples/get-local-addrs.c
@@ -8,7 +8,7 @@
 #include <stdio.h>
 #include <SDL3/SDL.h>
 #include <SDL3/SDL_main.h>
-#include "SDL_net.h"
+#include <SDL3_net/SDL_net.h>
 
 int main(int argc, char **argv)
 {
diff --git a/examples/resolve-hostnames.c b/examples/resolve-hostnames.c
index e028d25..ac28e7b 100644
--- a/examples/resolve-hostnames.c
+++ b/examples/resolve-hostnames.c
@@ -8,7 +8,7 @@
 #include <stdio.h>
 #include <SDL3/SDL.h>
 #include <SDL3/SDL_main.h>
-#include "SDL_net.h"
+#include <SDL3_net/SDL_net.h>
 
 int main(int argc, char **argv)
 {
diff --git a/examples/simple-http-get.c b/examples/simple-http-get.c
index fb02104..fefc9ae 100644
--- a/examples/simple-http-get.c
+++ b/examples/simple-http-get.c
@@ -9,7 +9,7 @@
 #include <stdio.h>
 #include <SDL3/SDL.h>
 #include <SDL3/SDL_main.h>
-#include "SDL_net.h"
+#include <SDL3_net/SDL_net.h>
 
 int main(int argc, char **argv)
 {
diff --git a/examples/voipchat.c b/examples/voipchat.c
index 9f976ea..78f09ab 100644
--- a/examples/voipchat.c
+++ b/examples/voipchat.c
@@ -1,6 +1,6 @@
 #include <SDL3/SDL_main.h>
 #include <SDL3/SDL.h>
-#include "SDL_net.h"
+#include <SDL3_net/SDL_net.h>
 
 /*
  * This is just for demonstration purposes! A real VoIP solution would
@@ -370,6 +370,3 @@ int main(int argc, char **argv)
     SDL_Quit();
     return 0;
 }
-
-
-