From 9d464e1adfc0a623b27717760746ab8dc3f5761f Mon Sep 17 00:00:00 2001
From: Joseph Walton-Rivers <joseph@walton-rivers.uk>
Date: Sat, 12 Mar 2022 14:37:18 +0000
Subject: [PATCH] fix public header paths

---
 CMakeLists.txt | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index fa071ed..eb78015 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,3 +1,4 @@
+set(namespace "fggl")
 cmake_minimum_required(VERSION 3.13)
 set(namespace "fggl")
 
@@ -15,6 +16,7 @@ set(CMAKE_CXX_STANDARD 17)
 set(CMAKE_CXX_STANDARD_REQUIRED True)
 set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
 
+include(GNUInstallDirs)
 target_include_directories(${PROJECT_NAME}
 	PRIVATE
 		${CMAKE_CURRENT_SOURCE_DIR}
@@ -75,15 +77,16 @@ add_subdirectory(demo)
 # INSTALL PHASE
 # see https://decovar.dev/blog/2021/03/08/cmake-cpp-library/
 ##
-set(public_headers
-    ${CMAKE_CURRENT_SOURCE_DIR}/include/fggl/fggl.hpp
+file(GLOB_RECURSE public_headers
+	${PROJECT_SOURCE_DIR}/include/${PROJECT_NAME}/*.hpp
+	${PROJECT_SOURCE_DIR}/include/${PROJECT_NAME}/*.h
 )
 
-# Structure preserving header macro
-include(GNUInstallDirs)
+#include(CMakePrintHelpers)
 
+# Structure preserving header macro
 foreach(header ${public_headers})
-    file(RELATIVE_PATH header_file_path "${CMAKE_CURRENT_SOURCE_DIR}" "${header}")
+    file(RELATIVE_PATH header_file_path "${CMAKE_CURRENT_SOURCE_DIR}/include" "${header}")
     get_filename_component(header_directory_path "${header_file_path}" DIRECTORY)
     install(
         FILES ${header}
-- 
GitLab