From 01f7fe8f78e72dcda6000c70fd8b1d5bfefc46f2 Mon Sep 17 00:00:00 2001 From: Henri Chain Date: Fri, 10 Jul 2020 13:12:25 +0000 Subject: Add ecm_generate_dbus_service_file Summary: It serves as a replacement for `kdbusaddons_generate_dbus_service_file`. An application can be a DBus-activated service just fine without using KDBusAddons. Moreover, this new module uses named arguments for future-proofing, and adds support for specifying a `SystemdService`. It also cleans up the confusion on what the "path" is about: Rather than requiring to specify executable and path separately, we just extract the executable file name on Windows, if necessary. Usage: ``` ecm_generate_dbus_service_file(NAME org.kde.kded5 EXECUTABLE ${KDE_INSTALL_FULL_BINDIR}/kded5 SYSTEMD_SERVICE plasma-kded) ``` Test Plan: * Was able to generate a kded service file * Was able to generate a kded service file with `SystemdUnit` * Verified that it moaned when executable wasn't an absolute path * Untested on Windwos Reviewers: #frameworks, davidedmundson, kossebau, kfunk, habacker Subscribers: kde-frameworks-devel, kde-buildsystem Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D29051 --- .../ECMGenerateDBusServiceFileTest/CMakeLists.txt | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tests/ECMGenerateDBusServiceFileTest/CMakeLists.txt (limited to 'tests/ECMGenerateDBusServiceFileTest/CMakeLists.txt') diff --git a/tests/ECMGenerateDBusServiceFileTest/CMakeLists.txt b/tests/ECMGenerateDBusServiceFileTest/CMakeLists.txt new file mode 100644 index 00000000..426ada89 --- /dev/null +++ b/tests/ECMGenerateDBusServiceFileTest/CMakeLists.txt @@ -0,0 +1,25 @@ +cmake_minimum_required(VERSION 3.5) +project(ECMGenerateDBusServiceFileTest) +set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../modules) + +# make sure the test install dir is clean +file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}") +include(ECMGenerateDBusServiceFile) + +# run test + +ecm_generate_dbus_service_file( + NAME org.kde.kded5 + EXECUTABLE /usr/bin/kded5 + DESTINATION ${CMAKE_INSTALL_PREFIX}/test +) + +ecm_generate_dbus_service_file( + NAME org.kde.kded5.withSystemD + EXECUTABLE /usr/bin/kded5 + SYSTEMD_SERVICE plasma-kded.service + DESTINATION ${CMAKE_INSTALL_PREFIX}/test +) + +# this will be run by CTest +configure_file(check_tree.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/check_tree.cmake" @ONLY) -- cgit v1.2.1