diff --git a/CMakeLists.txt b/CMakeLists.txt index 120102600..0d036e1d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ cmake_minimum_required(VERSION 2.8.12) find_package(ECM 0.0.9 REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_SOURCE_DIR}/cmake) -find_package(Qt5 5.2 REQUIRED COMPONENTS Quick Bluetooth) +find_package(Qt5 5.2 REQUIRED COMPONENTS Quick) find_package(KF5 REQUIRED COMPONENTS I18n ConfigWidgets DBusAddons) find_package(KF5DocTools) diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index e73155a3e..6dcfcc81f 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -8,7 +8,12 @@ include_directories( add_subdirectory(backends/lan) add_subdirectory(backends/loopback) -add_subdirectory(backends/bluetooth) + +option(BLUETOOTH_ENABLED "Bluetooth support for kdeconnect" OFF) +if(BLUETOOTH_ENABLED) + find_package(Qt5 REQUIRED COMPONENTS Bluetooth) + add_subdirectory(backends/bluetooth) +endif() find_package(KF5Notifications 5.9 REQUIRED) @@ -39,7 +44,6 @@ PUBLIC Qt5::Network KF5::CoreAddons qca-qt5 - Qt5::Bluetooth PRIVATE Qt5::DBus Qt5::Gui @@ -47,6 +51,11 @@ PRIVATE KF5::ConfigCore ) +if (BLUETOOTH_ENABLED) + target_compile_definitions(kdeconnectcore PRIVATE -DKDECONNECT_BLUETOOTH) + target_link_libraries(kdeconnectcore PRIVATE Qt5::Bluetooth) +endif() + set_target_properties(kdeconnectcore PROPERTIES VERSION ${KDECONNECT_VERSION} SOVERSION ${KDECONNECT_VERSION_MAJOR} diff --git a/core/daemon.cpp b/core/daemon.cpp index c45362371..6fd4cb57e 100644 --- a/core/daemon.cpp +++ b/core/daemon.cpp @@ -28,7 +28,11 @@ #include "core_debug.h" #include "kdeconnectconfig.h" #include "networkpackage.h" -#include "backends/bluetooth/bluetoothlinkprovider.h" + +#ifdef KDECONNECT_BLUETOOTH + #include "backends/bluetooth/bluetoothlinkprovider.h" +#endif + #include "backends/lan/lanlinkprovider.h" #include "backends/loopback/loopbacklinkprovider.h" #include "device.h" @@ -67,7 +71,9 @@ Daemon::Daemon(QObject *parent, bool testMode) d->mLinkProviders.insert(new LoopbackLinkProvider()); else { d->mLinkProviders.insert(new LanLinkProvider()); - d->mLinkProviders.insert(new BluetoothLinkProvider()); + #ifdef KDECONNECT_BLUETOOTH + d->mLinkProviders.insert(new BluetoothLinkProvider()); + #endif } //Read remebered paired devices