diff options
author | Ralf Habacker <ralf.habacker@freenet.de> | 2020-05-18 12:44:37 +0200 |
---|---|---|
committer | Simon McVittie <smcv@collabora.com> | 2020-06-10 18:13:47 +0000 |
commit | 97bdefd4e2598e6ea72337acb4230928594bda81 (patch) | |
tree | cd0415996ab93a57ee6a7f24a85f5b9f03b1fdff /bus | |
parent | eb6d4a14399f880cee581fb1706e1f4ac85df158 (diff) | |
download | dbus-97bdefd4e2598e6ea72337acb4230928594bda81.tar.gz |
cmake: Add support for systemd integration on Linux operating systems
Previously, only the Autotools build system could do this. This commit
includes most of the same features as in the Autotools build, although
not the user-session semantics, which will be added separately.
Systemd support is controlled by the cmake variable ENABLE_SYSTEMD, which can
have the values OFF, ON and AUTO, the latter enabling support by default if
the required libraries are available.
With WITH_SYSTEMD_SYSTEMUNITDIR a custom installation location can be specified.
If it is not specified, the related install path is determined from the installed
systemd package, if present.
Diffstat (limited to 'bus')
-rw-r--r-- | bus/CMakeLists.txt | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/bus/CMakeLists.txt b/bus/CMakeLists.txt index 5d76573d..2aa6068d 100644 --- a/bus/CMakeLists.txt +++ b/bus/CMakeLists.txt @@ -169,6 +169,13 @@ if(NOT WIN32) install_example_file(example-system-hardening-without-traditional-activation.conf) endif() +if(DBUS_BUS_ENABLE_SYSTEMD) + configure_file(dbus.socket.in ${CMAKE_CURRENT_BINARY_DIR}/dbus.socket) + configure_file(dbus.service.in ${CMAKE_CURRENT_BINARY_DIR}/dbus.service) + add_systemd_service(${CMAKE_CURRENT_BINARY_DIR}/dbus.socket PATH ${DBUS_SYSTEMD_SYSTEMUNITDIR} LINKS sockets.target.wants) + add_systemd_service(${CMAKE_CURRENT_BINARY_DIR}/dbus.service PATH ${DBUS_SYSTEMD_SYSTEMUNITDIR} LINKS multi-user.target.wants) +endif() + ## mop up the gcov files #clean-local: # /bin/rm *.bb *.bbg *.da *.gcov || true |