From 10d47e53470b79ecb6fdcade9650a5ef0dbc2878 Mon Sep 17 00:00:00 2001 From: Rosalie Wanders Date: Mon, 18 Dec 2023 23:57:24 +0100 Subject: [PATCH] RMG-Core: use GNUInstallDirs paths --- Source/RMG-Core/Config.hpp.in | 4 +++- Source/RMG-Core/Directories.cpp | 16 ++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Source/RMG-Core/Config.hpp.in b/Source/RMG-Core/Config.hpp.in index 396139ce..c1a35be6 100644 --- a/Source/RMG-Core/Config.hpp.in +++ b/Source/RMG-Core/Config.hpp.in @@ -13,7 +13,9 @@ #define CORE_VERSION "${GIT_VERSION}" #ifndef PORTABLE_INSTALL -#define CORE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" +#define CORE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" +#define CORE_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}" +#define CORE_INSTALL_DATADIR "${CMAKE_INSTALL_DATADIR}" #endif // PORTABLE_INSTALL #endif // CORE_CONFIG_HPP diff --git a/Source/RMG-Core/Directories.cpp b/Source/RMG-Core/Directories.cpp index 9ad97941..e27d9a99 100644 --- a/Source/RMG-Core/Directories.cpp +++ b/Source/RMG-Core/Directories.cpp @@ -245,7 +245,9 @@ std::filesystem::path CoreGetLibraryDirectory(void) else { directory = CORE_INSTALL_PREFIX; - directory += "/lib/RMG/"; + directory += "/"; + directory += CORE_INSTALL_LIBDIR; + directory += "/RMG/"; } #endif // PORTABLE_INSTALL return directory.make_preferred(); @@ -271,8 +273,8 @@ std::filesystem::path CoreGetCoreDirectory(void) } else { - directory = CORE_INSTALL_PREFIX; - directory += "/lib/RMG/Core"; + directory = CoreGetLibraryDirectory(); + directory += "/Core"; } #endif // CORE_INSTALL_PREFIX return directory.make_preferred(); @@ -298,8 +300,8 @@ std::filesystem::path CoreGetPluginDirectory(void) } else { - directory = CORE_INSTALL_PREFIX; - directory += "/lib/RMG/Plugin"; + directory = CoreGetLibraryDirectory(); + directory += "/Plugin"; } #endif // CORE_INSTALL_PREFIX return directory.make_preferred(); @@ -471,7 +473,9 @@ std::filesystem::path CoreGetSharedDataDirectory(void) else { directory = CORE_INSTALL_PREFIX; - directory += "/share/RMG"; + directory += "/"; + directory += CORE_INSTALL_DATADIR; + directory += "/RMG"; } #endif // PORTABLE_INSTALL return directory.make_preferred();