From da5c9bd30e400d837774a2344a5737d8240a592b Mon Sep 17 00:00:00 2001 From: Patrick von Reth Date: Thu, 10 Sep 2015 15:51:38 +0200 Subject: [PATCH] Fix compilation on Windows. --- cli/CMakeLists.txt | 1 + core/CMakeLists.txt | 2 +- core/backends/lan/landevicelink.cpp | 5 ----- core/backends/lan/lanlinkprovider.cpp | 2 ++ daemon/CMakeLists.txt | 2 ++ daemon/kdeconnectd.cpp | 14 +++++++++++++- kcmplugin/CMakeLists.txt | 2 +- kcmplugin/kdeconnectpluginkcm.h | 4 ++-- plugins/CMakeLists.txt | 4 +++- 9 files changed, 25 insertions(+), 11 deletions(-) diff --git a/cli/CMakeLists.txt b/cli/CMakeLists.txt index 7ddf635c2..932a13457 100644 --- a/cli/CMakeLists.txt +++ b/cli/CMakeLists.txt @@ -1,5 +1,6 @@ add_executable(kdeconnect-cli kdeconnect-cli.cpp) +ecm_mark_nongui_executable(kdeconnect-cli) target_link_libraries(kdeconnect-cli kdeconnectinterfaces KF5::CoreAddons KF5::I18n) diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index dd8fedbbe..d1d739bd2 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -48,6 +48,6 @@ set_target_properties(kdeconnectcore PROPERTIES ) 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 kdeconnectcore_export.h BASE_NAME KDEConnectCore) install(TARGETS kdeconnectcore EXPORT kdeconnectLibraryTargets ${INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP) diff --git a/core/backends/lan/landevicelink.cpp b/core/backends/lan/landevicelink.cpp index 10273fe50..65f7d7e6d 100644 --- a/core/backends/lan/landevicelink.cpp +++ b/core/backends/lan/landevicelink.cpp @@ -21,11 +21,6 @@ #include "landevicelink.h" #include "core_debug.h" -#include -#include -#include -#include - #include "../linkprovider.h" #include "uploadjob.h" #include "downloadjob.h" diff --git a/core/backends/lan/lanlinkprovider.cpp b/core/backends/lan/lanlinkprovider.cpp index f5c4a8bc6..03f429cf5 100644 --- a/core/backends/lan/lanlinkprovider.cpp +++ b/core/backends/lan/lanlinkprovider.cpp @@ -21,10 +21,12 @@ #include "lanlinkprovider.h" #include "core_debug.h" +#ifndef Q_OS_WIN #include #include #include #include +#endif #include #include diff --git a/daemon/CMakeLists.txt b/daemon/CMakeLists.txt index 0aec94248..6bc4f114f 100644 --- a/daemon/CMakeLists.txt +++ b/daemon/CMakeLists.txt @@ -7,6 +7,8 @@ add_definitions(-DTRANSLATION_DOMAIN="kdeconnect-kded") add_executable(kdeconnectd kdeconnectd.cpp) target_link_libraries(kdeconnectd kdeconnectcore KF5::KIOWidgets KF5::DBusAddons KF5::Notifications KF5::I18n Qt5::Widgets) +ecm_mark_nongui_executable(kdeconnectd) + configure_file(kdeconnectd.desktop.cmake ${CMAKE_CURRENT_BINARY_DIR}/kdeconnectd.desktop) configure_file(org.kde.kdeconnect.service.in ${CMAKE_CURRENT_BINARY_DIR}/org.kde.kdeconnect.service) diff --git a/daemon/kdeconnectd.cpp b/daemon/kdeconnectd.cpp index 06a709e42..56d9634ae 100644 --- a/daemon/kdeconnectd.cpp +++ b/daemon/kdeconnectd.cpp @@ -18,7 +18,6 @@ * along with this program. If not, see . */ -#include #include #include @@ -35,9 +34,19 @@ #include "core/device.h" #include "kdeconnect-version.h" + +#ifndef Q_OS_WIN +#include +#endif + static int sigtermfd[2]; const static char deadbeef = 1; + + +// TODO: Implement for Windows. +#ifndef Q_OS_WIN struct sigaction action; +#endif void sighandler(int signum) { @@ -50,6 +59,8 @@ void sighandler(int signum) void initializeTermHandlers(QCoreApplication* app, Daemon* daemon) { +// TODO: Implement for Windows. +#ifndef Q_OS_WIN ::socketpair(AF_UNIX, SOCK_STREAM, 0, sigtermfd); QSocketNotifier* snTerm = new QSocketNotifier(sigtermfd[1], QSocketNotifier::Read, app); QObject::connect(snTerm, SIGNAL(activated(int)), daemon, SLOT(deleteLater())); @@ -60,6 +71,7 @@ void initializeTermHandlers(QCoreApplication* app, Daemon* daemon) sigaction(SIGTERM, &action, nullptr); sigaction(SIGINT, &action, nullptr); +#endif } class DesktopDaemon : public Daemon diff --git a/kcmplugin/CMakeLists.txt b/kcmplugin/CMakeLists.txt index 18b7c09be..3f0fb1151 100644 --- a/kcmplugin/CMakeLists.txt +++ b/kcmplugin/CMakeLists.txt @@ -22,7 +22,7 @@ set_target_properties(kdeconnectpluginkcm PROPERTIES ) target_include_directories(kdeconnectpluginkcm PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) -generate_export_header(kdeconnectpluginkcm EXPORT_FILE_NAME ${CMAKE_CURRENT_BINARY_DIR}../core/kdeconnectcore_export.h BASE_NAME kdeconnectpluginkcm) +generate_export_header(kdeconnectpluginkcm EXPORT_FILE_NAME kdeconnectpluginkcm_export.h BASE_NAME kdeconnectpluginkcm) # Remove NAMELINK_SKIP if/when headers are being installed and the library # becomes public. diff --git a/kcmplugin/kdeconnectpluginkcm.h b/kcmplugin/kdeconnectpluginkcm.h index e6b604f1d..bf669162c 100644 --- a/kcmplugin/kdeconnectpluginkcm.h +++ b/kcmplugin/kdeconnectpluginkcm.h @@ -23,8 +23,8 @@ #include -#include "core/kdeconnectcore_export.h" #include "core/kdeconnectpluginconfig.h" +#include "kdeconnectpluginkcm_export.h" struct KdeConnectPluginKcmPrivate; @@ -32,7 +32,7 @@ struct KdeConnectPluginKcmPrivate; * Inheriting your plugin's KCM from this class gets you a easy way to share * configuration values between the KCM and the plugin. */ -class KDECONNECTCORE_EXPORT KdeConnectPluginKcm +class KDECONNECTPLUGINKCM_EXPORT KdeConnectPluginKcm : public KCModule { Q_OBJECT diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 176ba174b..6d6e75c07 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -8,7 +8,9 @@ add_subdirectory(mpriscontrol) add_subdirectory(clipboard) add_subdirectory(telephony) add_subdirectory(battery) -add_subdirectory(mousepad) +if(NOT WIN32) + add_subdirectory(mousepad) +endif() add_subdirectory(share) add_subdirectory(notifications) add_subdirectory(sftp)