diff options
| author | Thijs Paelman <thijs@ouroboros.rocks> | 2025-06-09 13:35:21 +0200 | 
|---|---|---|
| committer | Sander Vrijders <sander@ouroboros.rocks> | 2025-06-11 08:18:38 +0200 | 
| commit | 3b090f49a5df1b3cef6a635924b782e8ee93b419 (patch) | |
| tree | 6bb6715e6e11c4bc09ac5933faa5e30a3a2d893e | |
| parent | 950ba4921f03e80d33956f8d1645db345761530a (diff) | |
| download | ouroboros-3b090f49a5df1b3cef6a635924b782e8ee93b419.tar.gz ouroboros-3b090f49a5df1b3cef6a635924b782e8ee93b419.zip | |
build: Always install systemd service when asked
When the variable SYSTEMD_UNITDIR is specified (for example on the
command line), always install the systemd service file to this
directory, even if systemd is not found by pkg-config.
This also will help building with Guix without patching CMakeLists.txt.
Signed-off-by: Thijs Paelman <thijs@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
| -rw-r--r-- | CMakeLists.txt | 22 | 
1 files changed, 11 insertions, 11 deletions
| diff --git a/CMakeLists.txt b/CMakeLists.txt index e3c7976c..c69b89b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -141,18 +141,18 @@ if (SYSTEMD_FOUND)        "${SYSTEMD_UNITDIR}"      )    endif () -  if (NOT ${SYSTEMD_UNITDIR} STREQUAL "") -    message(STATUS "Installing systemd service in: ${SYSTEMD_UNITDIR}") -    if (LIBTOML_LIBRARIES AND NOT DISABLE_CONFIGFILE) -      set (CONFIGURE_STRING "--config ${OUROBOROS_CONFIG_DIR}${OUROBOROS_CONFIG_FILE}") -    else () -      set (CONFIGURE_STRING "") -    endif () -    configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ouroboros.service.in" -      "${CMAKE_CURRENT_BINARY_DIR}/ouroboros.service" @ONLY) -    install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ouroboros.service" -      DESTINATION "${SYSTEMD_UNITDIR}") +endif () +if (NOT ${SYSTEMD_UNITDIR} STREQUAL "") +  message(STATUS "Installing systemd service in: ${SYSTEMD_UNITDIR}") +  if (LIBTOML_LIBRARIES AND NOT DISABLE_CONFIGFILE) +    set (CONFIGURE_STRING "--config ${OUROBOROS_CONFIG_DIR}${OUROBOROS_CONFIG_FILE}") +  else () +    set (CONFIGURE_STRING "")    endif () +  configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ouroboros.service.in" +    "${CMAKE_CURRENT_BINARY_DIR}/ouroboros.service" @ONLY) +  install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ouroboros.service" +    DESTINATION "${SYSTEMD_UNITDIR}")  endif ()  enable_testing() | 
