From 927a5f4d757e9eacb6f133ebd45b69db01e9e2f3 Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Mon, 18 May 2020 12:47:51 +0200 Subject: cmake: add support for user session semantic on Linux operating systems Systemd user support is controlled by the cmake variable ENABLE_USER_SESSION, which and WITH_SYSTEMD_USERUNITDIR to specify a custom installation location. If WITH_SYSTEMD_USERUNITDIR is not specified, the related install path is determined from an installed systemd package, if present. This was added to the Autotools build system as part of fd.o#61301, but until now was not possible to enable when building with CMake. --- bus/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'bus') diff --git a/bus/CMakeLists.txt b/bus/CMakeLists.txt index 2aa6068d..09503966 100644 --- a/bus/CMakeLists.txt +++ b/bus/CMakeLists.txt @@ -176,6 +176,13 @@ if(DBUS_BUS_ENABLE_SYSTEMD) add_systemd_service(${CMAKE_CURRENT_BINARY_DIR}/dbus.service PATH ${DBUS_SYSTEMD_SYSTEMUNITDIR} LINKS multi-user.target.wants) endif() +if(DBUS_ENABLE_USER_SESSION) + configure_file(systemd-user/dbus.socket.in ${CMAKE_CURRENT_BINARY_DIR}/systemd-user/dbus.socket) + configure_file(systemd-user/dbus.service.in ${CMAKE_CURRENT_BINARY_DIR}/systemd-user/dbus.service) + add_systemd_service(${CMAKE_CURRENT_BINARY_DIR}/systemd-user/dbus.socket PATH ${DBUS_SYSTEMD_USERUNITDIR} LINKS sockets.target.wants) + add_systemd_service(${CMAKE_CURRENT_BINARY_DIR}/systemd-user/dbus.service PATH ${DBUS_SYSTEMD_USERUNITDIR}) +endif() + ## mop up the gcov files #clean-local: # /bin/rm *.bb *.bbg *.da *.gcov || true -- cgit v1.2.1