Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 5c9d3a9d authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Make a new kdeconnectcore library

Solves the need of compiling device.cpp against all plugins. Also
networkpackage and others don't need to either.

REVIEW: 118742
parent 1bda8043
......@@ -3,11 +3,14 @@ project(kdeconnect)
cmake_minimum_required(VERSION 2.6)
find_package(KDE4 REQUIRED)
find_package(QJSON REQUIRED)
find_package(QCA2 REQUIRED)
#if(CMAKE_COMPILER_IS_GNUCXX)
# add_definitions(-std=gnu++0x)
#endif()
include(GenerateExportHeader)
include(KDE4Defaults)
include_directories(${KDE4_INCLUDES})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
......
add_subdirectory(plugins)
find_package (QJSON 0.8.1 REQUIRED)
find_package (QCA2 REQUIRED)
project(KDEConnectCore)
include_directories(
${KDE4_KIO_LIBS}
${QJSON_INCLUDE_DIR}
${QCA2_INCLUDE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
)
add_subdirectory(plugins)
add_subdirectory(backends/lan)
add_subdirectory(backends/loopback)
......@@ -28,16 +28,21 @@ set(kded_kdeconnect_SRCS
kdebugnamespace.cpp
)
kde4_add_executable(kdeconnectd kdeconnectd.cpp ${kded_kdeconnect_SRCS})
target_link_libraries(kdeconnectd
kde4_add_library(kdeconnectcore SHARED ${kded_kdeconnect_SRCS})
target_link_libraries(kdeconnectcore
PUBLIC
${KDE4_KDECORE_LIBS}
${KDE4_KDEUI_LIBS}
PRIVATE
${KDE4_KIO_LIBS}
${QT_QTNETWORK_LIBRARY}
${QJSON_LIBRARIES}
${QT_QTNETWORK_LIBRARY}
${QCA2_LIBRARIES}
)
generate_export_header(kdeconnectcore EXPORT_FILE_NAME ${CMAKE_CURRENT_BINARY_DIR}/kdeconnectcore_export.h BASE_NAME KDEConnectCore)
kde4_add_executable(kdeconnectd kdeconnectd.cpp)
target_link_libraries(kdeconnectd kdeconnectcore ${KDE4_KDEUI_LIBS})
kde4_add_plugin(kded_kdeconnect kded.cpp)
......
......@@ -28,13 +28,14 @@
#include <KDEDModule>
#include <KPluginFactory>
#include "kdeconnectcore_export.h"
#include "device.h"
#include "networkpackage.h"
#include "backends/devicelink.h"
#include "backends/linkprovider.h"
class Daemon
class KDECONNECTCORE_EXPORT Daemon
: public QObject
{
Q_OBJECT
......
......@@ -33,7 +33,7 @@
class DeviceLink;
class KdeConnectPlugin;
class Device
class KDECONNECTCORE_EXPORT Device
: public QObject
{
Q_OBJECT
......
......@@ -23,7 +23,7 @@
#include <KDebug>
int kdeconnect_kded();
KDE_EXPORT int kdeconnect_kded();
#endif
......@@ -31,15 +31,15 @@
#include <QtCrypto>
#include <QSharedPointer>
#include <qjson/parser.h>
#include <KUrl>
#include "kdeconnectcore_export.h"
#include "kdebugnamespace.h"
#include "default_args.h"
class FileTransferJob;
class NetworkPackage : public QObject
class KDECONNECTCORE_EXPORT NetworkPackage : public QObject
{
Q_OBJECT
Q_PROPERTY( QString id READ id WRITE setId )
......
find_package(KDE4 REQUIRED)
find_package(QJSON REQUIRED)
find_package(QCA2 REQUIRED)
include(KDE4Defaults)
include_directories(
${QJSON_INCLUDE_DIR}
${QCA2_INCLUDE_DIR}
${KDE4_INCLUDES}
${CMAKE_SOURCE_DIR}
)
set(kdeconnect_battery_SRCS
batteryplugin.cpp
batterydbusinterface.cpp
../kdeconnectplugin.cpp
../pluginloader.cpp
../../networkpackage.cpp
../../filetransferjob.cpp
../../device.cpp
../../kdebugnamespace.cpp
)
kde4_add_plugin(kdeconnect_battery ${kdeconnect_battery_SRCS})
target_link_libraries(kdeconnect_battery
${KDE4_KDECORE_LIBS}
${KDE4_KDEUI_LIBS}
${KDE4_KIO_LIBS}
${QT_QTNETWORK_LIBRARY}
${QJSON_LIBRARIES}
${QCA2_LIBRARIES}
)
target_link_libraries(kdeconnect_battery kdeconnectcore ${KDE4_KDEUI_LIBS})
install(TARGETS kdeconnect_battery DESTINATION ${PLUGIN_INSTALL_DIR} )
install(FILES kdeconnect_battery.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
......
find_package(KDE4 REQUIRED)
find_package(QJSON REQUIRED)
find_package(QCA2 REQUIRED)
include(KDE4Defaults)
include_directories(
${QJSON_INCLUDE_DIR}
${QCA2_INCLUDE_DIR}
${KDE4_INCLUDES}
${CMAKE_SOURCE_DIR}
)
set(kdeconnect_clipboard_SRCS
clipboardplugin.cpp
../kdeconnectplugin.cpp
../pluginloader.cpp
../../networkpackage.cpp
../../filetransferjob.cpp
../../device.cpp
../../kdebugnamespace.cpp
)
kde4_add_plugin(kdeconnect_clipboard ${kdeconnect_clipboard_SRCS})
target_link_libraries(kdeconnect_clipboard
${KDE4_KDECORE_LIBS}
${KDE4_KDEUI_LIBS}
${KDE4_KIO_LIBS}
${QT_QTNETWORK_LIBRARY}
${QJSON_LIBRARIES}
${QCA2_LIBRARIES}
)
target_link_libraries(kdeconnect_clipboard kdeconnectcore ${QT_QTGUI_LIBRARY})
install(TARGETS kdeconnect_clipboard DESTINATION ${PLUGIN_INSTALL_DIR} )
install(FILES kdeconnect_clipboard.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
......@@ -28,6 +28,10 @@ KdeConnectPlugin::KdeConnectPlugin(QObject* parent, const QVariantList& args)
mDevice = qvariant_cast< Device* >(args.first());
}
KdeConnectPlugin::~KdeConnectPlugin()
{
}
Device* KdeConnectPlugin::device()
{
return mDevice;
......
......@@ -38,6 +38,8 @@ class KDE_EXPORT KdeConnectPlugin
public:
KdeConnectPlugin(QObject* parent, const QVariantList& args);
virtual ~KdeConnectPlugin();
Device* device();
Device const* device() const;
......
find_package(KDE4 REQUIRED)
find_package(QJSON REQUIRED)
find_package(QCA2 REQUIRED)
include(KDE4Defaults)
include_directories(
${QJSON_INCLUDE_DIR}
${QCA2_INCLUDE_DIR}
${KDE4_INCLUDES}
${CMAKE_SOURCE_DIR}
)
set(kdeconnect_mpriscontrol_SRCS
mpriscontrolplugin.cpp
../kdeconnectplugin.cpp
../pluginloader.cpp
../../networkpackage.cpp
../../filetransferjob.cpp
../../device.cpp
../../kdebugnamespace.cpp
)
qt4_add_dbus_interface(
......@@ -35,14 +16,7 @@ qt4_add_dbus_interface(
kde4_add_plugin(kdeconnect_mpriscontrol ${kdeconnect_mpriscontrol_SRCS})
target_link_libraries(kdeconnect_mpriscontrol
${KDE4_KDECORE_LIBS}
${KDE4_KDEUI_LIBS}
${KDE4_KIO_LIBS}
${QT_QTNETWORK_LIBRARY}
${QJSON_LIBRARIES}
${QCA2_LIBRARIES}
)
target_link_libraries(kdeconnect_mpriscontrol kdeconnectcore)
install(TARGETS kdeconnect_mpriscontrol DESTINATION ${PLUGIN_INSTALL_DIR} )
install(FILES kdeconnect_mpriscontrol.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
......
find_package(KDE4 REQUIRED)
find_package(QJSON REQUIRED)
find_package(QCA2 REQUIRED)
include(KDE4Defaults)
include_directories(
${QJSON_INCLUDE_DIR}
${QCA2_INCLUDE_DIR}
${KDE4_INCLUDES}
${CMAKE_SOURCE_DIR}
)
set(kdeconnect_notifications_SRCS
notification.cpp
notificationsplugin.cpp
notificationsdbusinterface.cpp
../kdeconnectplugin.cpp
../pluginloader.cpp
../../networkpackage.cpp
../../filetransferjob.cpp
../../device.cpp
../../kdebugnamespace.cpp
)
kde4_add_plugin(kdeconnect_notifications ${kdeconnect_notifications_SRCS})
target_link_libraries(kdeconnect_notifications
${KDE4_KDECORE_LIBS}
${KDE4_KDEUI_LIBS}
${KDE4_KIO_LIBS}
${QT_QTNETWORK_LIBRARY}
${QJSON_LIBRARIES}
${QCA2_LIBRARIES}
)
target_link_libraries(kdeconnect_notifications kdeconnectcore ${KDE4_KDEUI_LIBS})
install(TARGETS kdeconnect_notifications DESTINATION ${PLUGIN_INSTALL_DIR} )
install(FILES kdeconnect_notifications.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
......
find_package(KDE4 REQUIRED)
find_package(QJSON REQUIRED)
find_package(QCA2 REQUIRED)
include(KDE4Defaults)
include_directories(
${QJSON_INCLUDE_DIR}
${QCA2_INCLUDE_DIR}
${KDE4_INCLUDES}
${CMAKE_SOURCE_DIR}
)
set(kdeconnect_pausemusic_SRCS
pausemusicplugin.cpp
../kdeconnectplugin.cpp
......
find_package(KDE4 REQUIRED)
find_package(QJSON REQUIRED)
find_package(QCA2 REQUIRED)
include(KDE4Defaults)
include_directories(
${QJSON_INCLUDE_DIR}
${QCA2_INCLUDE_DIR}
${KDE4_INCLUDES}
${CMAKE_SOURCE_DIR}
)
set(kdeconnect_ping_SRCS
pingplugin.cpp
../kdeconnectplugin.cpp
../../kdebugnamespace.cpp
)
kde4_add_plugin(kdeconnect_ping ${kdeconnect_ping_SRCS})
target_link_libraries(kdeconnect_ping
${KDE4_KDECORE_LIBS}
${KDE4_KDEUI_LIBS}
${QT_QTNETWORK_LIBRARY}
${QJSON_LIBRARIES}
${QCA2_LIBRARIES}
)
target_link_libraries(kdeconnect_ping kdeconnectcore ${KDE4_KDEUI_LIBS})
install(TARGETS kdeconnect_ping DESTINATION ${PLUGIN_INSTALL_DIR} )
install(FILES kdeconnect_ping.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
find_package(KDE4 REQUIRED)
find_package(QJSON REQUIRED)
find_package(QCA2 REQUIRED)
include(KDE4Defaults)
include_directories(
${QJSON_INCLUDE_DIR}
${QCA2_INCLUDE_DIR}
${KDE4_INCLUDES}
${CMAKE_SOURCE_DIR}
)
set(kdeconnect_sftp_SRCS
mounter.cpp
mountloop.cpp
sftpplugin.cpp
../kdeconnectplugin.cpp
../pluginloader.cpp
../../networkpackage.cpp
../../filetransferjob.cpp
../../device.cpp
../../kdebugnamespace.cpp
)
kde4_add_plugin(kdeconnect_sftp ${kdeconnect_sftp_SRCS})
target_link_libraries(kdeconnect_sftp
${KDE4_KDECORE_LIBS}
${KDE4_KDEUI_LIBS}
${KDE4_KIO_LIBS}
${KDE4_KFILE_LIBS}
${QT_QTNETWORK_LIBRARY}
${QJSON_LIBRARIES}
${QCA2_LIBRARIES}
)
target_link_libraries(kdeconnect_sftp kdeconnectcore ${KDE4_KFILE_LIBS})
install(TARGETS kdeconnect_sftp DESTINATION ${PLUGIN_INSTALL_DIR} )
install(FILES kdeconnect_sftp.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
......
find_package(KDE4 REQUIRED)
find_package(QJSON REQUIRED)
find_package(QCA2 REQUIRED)
include(KDE4Defaults)
include_directories(
${QJSON_INCLUDE_DIR}
${QCA2_INCLUDE_DIR}
${KDE4_INCLUDES}
${CMAKE_SOURCE_DIR}
)
set(kdeconnect_share_SRCS
shareplugin.cpp
autoclosingqfile.cpp
../kdeconnectplugin.cpp
../pluginloader.cpp
../../filetransferjob.cpp
../../networkpackage.cpp
../../device.cpp
../../kdebugnamespace.cpp
)
kde4_add_plugin(kdeconnect_share ${kdeconnect_share_SRCS})
target_link_libraries(kdeconnect_share
${KDE4_KDECORE_LIBS}
${KDE4_KDEUI_LIBS}
${KDE4_KIO_LIBS}
${QT_QTNETWORK_LIBRARY}
${QJSON_LIBRARIES}
${QCA2_LIBRARIES}
)
target_link_libraries(kdeconnect_share kdeconnectcore ${KDE4_KFILE_LIBS} ${KDE4_KIO_LIBS})
install(TARGETS kdeconnect_share DESTINATION ${PLUGIN_INSTALL_DIR} )
install(FILES kdeconnect_share.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
......
find_package(KDE4 REQUIRED)
find_package(QJSON REQUIRED)
find_package(QCA2 REQUIRED)
include_directories(
${QJSON_INCLUDE_DIR}
${QCA2_INCLUDE_DIR}
)
include(KDE4Defaults)
include_directories(${KDE4_INCLUDES})
set(kdeconnect_telephony_SRCS
telephonyplugin.cpp
../kdeconnectplugin.cpp
../../kdebugnamespace.cpp
)
kde4_add_plugin(kdeconnect_telephony ${kdeconnect_telephony_SRCS})
target_link_libraries(kdeconnect_telephony
${KDE4_KDECORE_LIBS}
${KDE4_KDEUI_LIBS}
${QT_QTNETWORK_LIBRARY}
${QJSON_LIBRARIES}
${QCA2_LIBRARIES}
)
target_link_libraries(kdeconnect_telephony kdeconnectcore ${KDE4_KDEUI_LIBS})
install(TARGETS kdeconnect_telephony DESTINATION ${PLUGIN_INSTALL_DIR} )
install(FILES kdeconnect_telephony.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} )
include(KDE4Defaults)
find_package(KDE4 REQUIRED)
find_package(QJSON 0.8.1 REQUIRED)
find_package(QCA2 REQUIRED)
include_directories(
${QJSON_INCLUDE_DIR}
${QCA2_INCLUDE_DIR}
${KDE4_INCLUDES}
${CMAKE_SOURCE_DIR}
${KDEConnectCore_BINARY_DIR}
)
set(kdeconnect_libraries
......@@ -21,15 +13,13 @@ set(kdeconnect_libraries
${QJSON_LIBRARIES}
${QCA2_LIBRARIES}
${QT_QTTEST_LIBRARY}
kdeconnectcore
)
#NetworkPackage
kde4_add_unit_test(kdeconnect_tests ../kded/networkpackage.cpp ../kded/kdebugnamespace.cpp ../kded/filetransferjob.cpp networkpackagetests.cpp)
kde4_add_unit_test(kdeconnect_tests networkpackagetests.cpp)
target_link_libraries(kdeconnect_tests ${kdeconnect_libraries})
#Socketlinereader
set(_testname testsocketlinereader)
qt4_generate_moc(${_testname}.cpp ${CMAKE_CURRENT_BINARY_DIR}/${_testname}.moc)
include_directories(${QT_INCLUDES} ${KDE4_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR})
kde4_add_unit_test(${_testname} ${_testname}.cpp ${_testname}.moc ../kded/backends/lan/socketlinereader.cpp ../kded/kdebugnamespace.cpp)
target_link_libraries(${_testname} ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY} ${QT_QTCORE_LIBRARY} ${QT_QTNETWORK_LIBRARY})
kde4_add_unit_test(testsocketlinereader testsocketlinereader.cpp ../kded/backends/lan/socketlinereader.cpp)
target_link_libraries(testsocketlinereader ${kdeconnect_libraries})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment