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
This commit is contained in:
Martin Gräßlin 2014-07-05 13:28:42 +02:00
parent 0f334d053f
commit 685e821d0a
3 changed files with 5 additions and 1 deletions

View file

@ -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)

1
kded/config-kded.h.cmake Normal file
View file

@ -0,0 +1 @@
#define KDECONNECTD_BIN "${CMAKE_INSTALL_PREFIX}/${LIBEXEC_INSTALL_DIR}/kdeconnectd"

View file

@ -26,6 +26,7 @@
#include <KStandardDirs>
#include "core/kdebugnamespace.h"
#include "config-kded.h"
K_PLUGIN_FACTORY(KdeConnectFactory, registerPlugin<Kded>();)
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()));