diff options
| author | Dimitri Staessens <dimitri@ouroboros.rocks> | 2026-02-07 21:59:35 +0100 |
|---|---|---|
| committer | Sander Vrijders <sander@ouroboros.rocks> | 2026-02-13 09:22:29 +0100 |
| commit | 4c73ee20024e1d1272a979574438749cfcd61426 (patch) | |
| tree | f280d4997fd6f5f8675e9fe8bd1e0ab92cf54e40 /CMakeLists.txt | |
| parent | acd92b8873839bdaaf15aaf86c19edc9f165966e (diff) | |
| download | ouroboros-4c73ee20024e1d1272a979574438749cfcd61426.tar.gz ouroboros-4c73ee20024e1d1272a979574438749cfcd61426.zip | |
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 <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 23 |
1 files changed, 12 insertions, 11 deletions
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) |
