From fb5fd59e7329c6019f9e8a1ebd99ce6080477a64 Mon Sep 17 00:00:00 2001 From: Milas Bowman Date: Tue, 28 Jan 2025 15:33:36 -0500 Subject: [PATCH] [build] allow disabling systemd service unit install (#2652) Add `INSTALL_SYSTEMD_UNIT` which can explicitly be set to `false` to disable installing the service unit even if systemd is available. If not defined, it defaults to true, i.e. the systemed service unit is created. As a result, this change is backwards compatible: it's required to _opt-out_ of systemd unit installation. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a1ee70af90..26cccb45faf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -104,7 +104,7 @@ include(GNUInstallDirs) pkg_check_modules(SYSTEMD systemd) -if(SYSTEMD_FOUND) +if(SYSTEMD_FOUND AND (NOT DEFINED INSTALL_SYSTEMD_UNIT OR INSTALL_SYSTEMD_UNIT)) pkg_get_variable(OTBR_SYSTEMD_UNIT_DIR systemd systemdsystemunitdir) endif()