From f096d4c38fb8ca9ce075e29563f99c6d9c447ac4 Mon Sep 17 00:00:00 2001
From: Stephane Del Pino <stephane.delpino44@gmail.com>
Date: Fri, 27 Dec 2024 17:55:40 +0100
Subject: [PATCH] Improve installation recipes

---
 CMakeLists.txt     |  2 ++
 src/CMakeLists.txt | 15 +++++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3a9f59557..66f561885 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,6 +22,7 @@ if("${PUGS_SHORT_VERSION}" STREQUAL "")
   message(FATAL_ERROR "Unable to compute short version from PUGS_VERSION=${PUGS_VERSION}")
 endif()
 
+set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
 
 set(CMAKE_CONFIGURATION_TYPES "Release;Debug;Coverage" CACHE STRING INTERNAL FORCE )
 
@@ -372,6 +373,7 @@ endif()
 #------------------------------------------------------
 
 # Rang (colors? Useless thus necessary!)
+add_subdirectory(${PUGS_SOURCE_DIR}/packages/rang/)
 include_directories(SYSTEM "${PUGS_SOURCE_DIR}/packages/rang/include")
 
 # CLI11
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index eebccac12..30d920bb0 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -3,6 +3,21 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
 
 #------------------------------------------------------
 
+install(
+  DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/"
+  DESTINATION "include"
+  FILES_MATCHING
+  PATTERN "*.hpp"
+)
+
+install(
+  DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/"
+  DESTINATION "include"
+  FILES_MATCHING
+  PATTERN "*.hpp"
+  PATTERN "CMakeFiles" EXCLUDE
+)
+
 # Pugs utils
 add_subdirectory(utils)
 
-- 
GitLab