From 44290c46274f54101479e75aeed3b388fa44846b Mon Sep 17 00:00:00 2001 From: Milas Bowman Date: Fri, 27 Dec 2024 09:52:29 -0500 Subject: [PATCH] [build] allow disabling systemd service unit install 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()