From 685e821d0a821e25e2fe6b57d23ec0dd2df68561 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sat, 5 Jul 2014 13:28:42 +0200 Subject: [PATCH] Set path to kdeconnectd executable through cmake Libexec binaries need to be hardcoded, otherwise they are not found. This commit creates a config file and sets the path there. REVIEW: 119148 --- kded/CMakeLists.txt | 2 ++ kded/config-kded.h.cmake | 1 + kded/kded.cpp | 3 ++- 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 kded/config-kded.h.cmake diff --git a/kded/CMakeLists.txt b/kded/CMakeLists.txt index dd2c94146..3f1569345 100644 --- a/kded/CMakeLists.txt +++ b/kded/CMakeLists.txt @@ -1,5 +1,7 @@ include_directories(${CMAKE_SOURCE_DIR}) +configure_file(config-kded.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kded.h) + add_executable(kdeconnectd kdeconnectd.cpp) target_link_libraries(kdeconnectd kdeconnectcore KF5::ConfigWidgets) diff --git a/kded/config-kded.h.cmake b/kded/config-kded.h.cmake new file mode 100644 index 000000000..10882b7e9 --- /dev/null +++ b/kded/config-kded.h.cmake @@ -0,0 +1 @@ +#define KDECONNECTD_BIN "${CMAKE_INSTALL_PREFIX}/${LIBEXEC_INSTALL_DIR}/kdeconnectd" diff --git a/kded/kded.cpp b/kded/kded.cpp index a7c5c7540..8e3e06cb4 100644 --- a/kded/kded.cpp +++ b/kded/kded.cpp @@ -26,6 +26,7 @@ #include #include "core/kdebugnamespace.h" +#include "config-kded.h" K_PLUGIN_FACTORY(KdeConnectFactory, registerPlugin();) K_EXPORT_PLUGIN(KdeConnectFactory("kdeconnect", "kdeconnect-kded")) @@ -50,7 +51,7 @@ void Kded::start() return; } - const QString daemon = KStandardDirs::locate("exe", "kdeconnectd"); + const QString daemon = QStringLiteral(KDECONNECTD_BIN); kDebug(debugArea()) << "Starting daemon " << daemon; m_daemon = new KProcess(this); connect(m_daemon, SIGNAL(started()), SLOT(daemonStarted()));