From 4c73ee20024e1d1272a979574438749cfcd61426 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sat, 7 Feb 2026 21:59:35 +0100 Subject: build: Fix config dir to follow install prefix Move CMAKE_INSTALL_PREFIX override before GNUInstallDirs so that CMAKE_INSTALL_FULL_SYSCONFDIR is computed with the correct prefix (/usr on Linux, /usr/local on macOS). This ensures OUROBOROS_CONFIG_DIR defaults to /etc/ouroboros for /usr installs and /usr/local/etc/ouroboros for /usr/local installs on first cmake run. Also move config/global before dependencies so OUROBOROS_CONFIG_DIR is set when libtoml.cmake displays the configuration directory message. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- CMakeLists.txt | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index d225d29d..c886146d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,15 +4,6 @@ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") project(ouroboros C) -include(GNUInstallDirs) - -include(utils/DebugTargets) - -include(version) -include(package) - -include(compiler) - if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) if(APPLE) set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE STRING @@ -23,6 +14,15 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) endif() endif() +include(GNUInstallDirs) + +include(utils/DebugTargets) + +include(version) +include(package) + +include(compiler) + if(APPLE) set(CMAKE_MACOSX_RPATH 1) # Homebrew installs to /usr/local/include on Intel, /opt/homebrew/include on ARM @@ -46,10 +46,11 @@ if(isSystemDir STREQUAL "-1") set(CMAKE_INSTALL_RPATH "${RPATH_PREFIX}/${CMAKE_INSTALL_LIBDIR}") endif() +# Configuration options (must be loaded before dependencies) +include(config/global) + include(dependencies) -# Configuration options (must be loaded before component modules) -include(config/global) include(config/lib) include(config/ssm) include(config/irmd) -- cgit v1.2.3