Added dbus activation to org.kde.kdeconnect
This commit is contained in:
parent
955f0dbd13
commit
d8943f03ae
8 changed files with 42 additions and 8 deletions
31
cmake/DbusActivationMacros.cmake
Normal file
31
cmake/DbusActivationMacros.cmake
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
include(UsePkgConfig)
|
||||||
|
|
||||||
|
MACRO(PKGCONFIG_GETVAR _package _var _output_variable)
|
||||||
|
SET(${_output_variable})
|
||||||
|
|
||||||
|
# if pkg-config has been found
|
||||||
|
IF(PKGCONFIG_EXECUTABLE)
|
||||||
|
|
||||||
|
EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --exists RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull )
|
||||||
|
|
||||||
|
# and if the package of interest also exists for pkg-config, then get the information
|
||||||
|
IF(NOT _return_VALUE)
|
||||||
|
|
||||||
|
EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --variable ${_var} OUTPUT_VARIABLE ${_output_variable} )
|
||||||
|
|
||||||
|
ENDIF(NOT _return_VALUE)
|
||||||
|
|
||||||
|
ENDIF(PKGCONFIG_EXECUTABLE)
|
||||||
|
|
||||||
|
ENDMACRO(PKGCONFIG_GETVAR _package _var _output_variable)
|
||||||
|
|
||||||
|
macro(dbus_add_activation_service _sources)
|
||||||
|
PKGCONFIG_GETVAR(dbus-1 session_bus_services_dir _install_dir)
|
||||||
|
foreach (_i ${_sources})
|
||||||
|
get_filename_component(_service_file ${_i} ABSOLUTE)
|
||||||
|
string(REGEX REPLACE "\\.service.*$" ".service" _output_file ${_i})
|
||||||
|
set(_target ${CMAKE_CURRENT_BINARY_DIR}/${_output_file})
|
||||||
|
configure_file(${_service_file} ${_target})
|
||||||
|
install(FILES ${_target} DESTINATION ${_install_dir})
|
||||||
|
endforeach (_i ${ARGN})
|
||||||
|
endmacro(dbus_add_activation_service _sources)
|
|
@ -48,7 +48,7 @@ LINK_PRIVATE
|
||||||
target_include_directories(kdeconnectcore PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
|
target_include_directories(kdeconnectcore PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
generate_export_header(kdeconnectcore EXPORT_FILE_NAME ${CMAKE_CURRENT_BINARY_DIR}/kdeconnectcore_export.h BASE_NAME KDEConnectCore)
|
generate_export_header(kdeconnectcore EXPORT_FILE_NAME ${CMAKE_CURRENT_BINARY_DIR}/kdeconnectcore_export.h BASE_NAME KDEConnectCore)
|
||||||
|
|
||||||
include(macros)
|
include(DbusInterfaceMacros)
|
||||||
|
|
||||||
generate_and_install_dbus_interface(
|
generate_and_install_dbus_interface(
|
||||||
kdeconnectcore
|
kdeconnectcore
|
||||||
|
|
|
@ -2,13 +2,12 @@ include_directories(${CMAKE_SOURCE_DIR})
|
||||||
|
|
||||||
kde4_add_executable(kdeconnectd kdeconnectd.cpp)
|
kde4_add_executable(kdeconnectd kdeconnectd.cpp)
|
||||||
target_link_libraries(kdeconnectd kdeconnectcore ${KDE4_KDEUI_LIBS})
|
target_link_libraries(kdeconnectd kdeconnectcore ${KDE4_KDEUI_LIBS})
|
||||||
|
install(TARGETS kdeconnectd DESTINATION ${LIBEXEC_INSTALL_DIR})
|
||||||
|
|
||||||
kde4_add_plugin(kded_kdeconnect kded.cpp)
|
kde4_add_plugin(kded_kdeconnect kded.cpp)
|
||||||
|
|
||||||
target_link_libraries(kded_kdeconnect ${KDE4_KDECORE_LIBS})
|
target_link_libraries(kded_kdeconnect ${KDE4_KDECORE_LIBS})
|
||||||
|
|
||||||
install(TARGETS kdeconnectd DESTINATION ${LIBEXEC_INSTALL_DIR})
|
|
||||||
install(TARGETS kded_kdeconnect DESTINATION ${PLUGIN_INSTALL_DIR})
|
install(TARGETS kded_kdeconnect DESTINATION ${PLUGIN_INSTALL_DIR})
|
||||||
install(FILES kdeconnect.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kded)
|
install(FILES kdeconnect.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kded)
|
||||||
|
|
||||||
|
include(DbusActivationMacros)
|
||||||
|
dbus_add_activation_service(org.kde.kdeconnect.service.in)
|
||||||
|
|
3
kded/org.kde.kdeconnect.service.in
Normal file
3
kded/org.kde.kdeconnect.service.in
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
[D-BUS Service]
|
||||||
|
Name=org.kde.kdeconnect
|
||||||
|
Exec=@LIBEXEC_INSTALL_DIR@/kdeconnectd
|
|
@ -10,7 +10,7 @@ target_link_libraries(kdeconnect_battery kdeconnectcore ${KDE4_KDEUI_LIBS})
|
||||||
install(TARGETS kdeconnect_battery DESTINATION ${PLUGIN_INSTALL_DIR} )
|
install(TARGETS kdeconnect_battery DESTINATION ${PLUGIN_INSTALL_DIR} )
|
||||||
install(FILES kdeconnect_battery.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
|
install(FILES kdeconnect_battery.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
|
||||||
|
|
||||||
include(macros)
|
include(DbusInterfaceMacros)
|
||||||
|
|
||||||
generate_and_install_dbus_interface(
|
generate_and_install_dbus_interface(
|
||||||
kdeconnect_battery
|
kdeconnect_battery
|
||||||
|
|
|
@ -11,7 +11,8 @@ target_link_libraries(kdeconnect_notifications kdeconnectcore ${KDE4_KDEUI_LIBS}
|
||||||
install(TARGETS kdeconnect_notifications DESTINATION ${PLUGIN_INSTALL_DIR} )
|
install(TARGETS kdeconnect_notifications DESTINATION ${PLUGIN_INSTALL_DIR} )
|
||||||
install(FILES kdeconnect_notifications.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
|
install(FILES kdeconnect_notifications.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
|
||||||
|
|
||||||
include(macros)
|
include(DbusInterfaceMacros)
|
||||||
|
|
||||||
generate_and_install_dbus_interface(
|
generate_and_install_dbus_interface(
|
||||||
kdeconnect_notifications
|
kdeconnect_notifications
|
||||||
notificationsdbusinterface.h
|
notificationsdbusinterface.h
|
||||||
|
|
|
@ -11,7 +11,7 @@ target_link_libraries(kdeconnect_sftp kdeconnectcore ${KDE4_KFILE_LIBS})
|
||||||
install(TARGETS kdeconnect_sftp DESTINATION ${PLUGIN_INSTALL_DIR} )
|
install(TARGETS kdeconnect_sftp DESTINATION ${PLUGIN_INSTALL_DIR} )
|
||||||
install(FILES kdeconnect_sftp.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
|
install(FILES kdeconnect_sftp.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
|
||||||
|
|
||||||
include(macros)
|
include(DbusInterfaceMacros)
|
||||||
|
|
||||||
generate_and_install_dbus_interface(
|
generate_and_install_dbus_interface(
|
||||||
kdeconnect_sftp
|
kdeconnect_sftp
|
||||||
|
|
Loading…
Reference in a new issue