diff --git a/daemon/CMakeLists.txt b/daemon/CMakeLists.txt index f49265e87..eee98728b 100644 --- a/daemon/CMakeLists.txt +++ b/daemon/CMakeLists.txt @@ -19,6 +19,13 @@ target_link_libraries(kdeconnectd ecm_mark_nongui_executable(kdeconnectd) configure_file(org.kde.kdeconnect.daemon.desktop.cmake ${CMAKE_CURRENT_BINARY_DIR}/org.kde.kdeconnect.daemon.desktop) + +# Conditionally configure the daemon service according to the target OS +if(WIN32) + set(SERV_EXEC kdeconnectd) +else() + set(SERV_EXEC ${KDE_INSTALL_FULL_LIBEXECDIR}/kdeconnectd) +endif() configure_file(org.kde.kdeconnect.service.in ${CMAKE_CURRENT_BINARY_DIR}/org.kde.kdeconnect.service) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.kde.kdeconnect.daemon.desktop DESTINATION ${AUTOSTART_INSTALL_DIR}) diff --git a/daemon/org.kde.kdeconnect.service.in b/daemon/org.kde.kdeconnect.service.in index 4f747186d..1008191d3 100644 --- a/daemon/org.kde.kdeconnect.service.in +++ b/daemon/org.kde.kdeconnect.service.in @@ -1,3 +1,3 @@ [D-BUS Service] Name=org.kde.kdeconnect -Exec=@KDE_INSTALL_FULL_LIBEXECDIR@/kdeconnectd +Exec=@SERV_EXEC@