Commit 807f90f1 authored by Albert Vaca Cintora's avatar Albert Vaca Cintora

Merge branch 'export-headers'

parents 8777cc9d 1401e029
......@@ -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,26 +28,26 @@ 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 ${kded_kdeconnect_SRCS})
kde4_add_plugin(kded_kdeconnect kded.cpp)
target_link_libraries(kded_kdeconnect
${KDE4_KDECORE_LIBS}
${KDE4_KDEUI_LIBS}
${KDE4_KIO_LIBS}
${QT_QTNETWORK_LIBRARY}
${QJSON_LIBRARIES}
${QCA2_LIBRARIES}
)
include(../macros.cmake)
......@@ -77,22 +77,3 @@ install(TARGETS kdeconnectd DESTINATION ${LIBEXEC_INSTALL_DIR})
install(TARGETS kded_kdeconnect DESTINATION ${PLUGIN_INSTALL_DIR})
install(FILES kdeconnect.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kded)
install(FILES kdeconnect.notifyrc DESTINATION ${DATA_INSTALL_DIR}/kdeconnect)
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(kdeconnect_standalone_SRCS
${kded_kdeconnect_SRCS}
main.cpp
)
kde4_add_executable(kdeconnect_standalone ${kdeconnect_standalone_SRCS})
target_link_libraries(kdeconnect_standalone
${KDE4_KDECORE_LIBS}
${KDE4_KDEUI_LIBS}
${KDE4_KIO_LIBS}
${QT_QTNETWORK_LIBRARY}
${QJSON_LIBRARIES}
${QCA2_LIBRARIES}
)
install(TARGETS kdeconnect_standalone ${INSTALL_TARGETS_DEFAULT_ARGS})
endif()
\ No newline at end of file
......@@ -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
......@@ -27,6 +27,8 @@
#include "kdebugnamespace.h"
int theArea = KDebug::registerArea("kdeconnect-kded");
K_PLUGIN_FACTORY(KdeConnectFactory, registerPlugin<Kded>();)
K_EXPORT_PLUGIN(KdeConnectFactory("kdeconnect", "kdeconnect-kded"))
......@@ -35,13 +37,13 @@ Kded::Kded(QObject *parent, const QList<QVariant>&)
, m_daemon(0)
{
QMetaObject::invokeMethod(this, "start", Qt::QueuedConnection);
kDebug(kdeconnect_kded()) << "kded_kdeconnect started";
kDebug(theArea) << "kded_kdeconnect started";
}
Kded::~Kded()
{
stop();
kDebug(kdeconnect_kded()) << "kded_kdeconnect stopped";
kDebug(theArea) << "kded_kdeconnect stopped";
}
void Kded::start()
......@@ -51,7 +53,7 @@ void Kded::start()
}
const QString daemon = KStandardDirs::locate("exe", "kdeconnectd");
kDebug(kdeconnect_kded()) << "Starting daemon " << daemon;
kDebug(theArea) << "Starting daemon " << daemon;
m_daemon = new KProcess(this);
connect(m_daemon, SIGNAL(started()), SLOT(daemonStarted()));
connect(m_daemon, SIGNAL(error(QProcess::ProcessError)), this, SLOT(onError(QProcess::ProcessError)));
......@@ -83,24 +85,24 @@ void Kded::restart()
void Kded::onError(QProcess::ProcessError errorCode)
{
kError(kdeconnect_kded()) << "Process error code=" << errorCode;
kError(theArea) << "Process error code=" << errorCode;
}
void Kded::daemonStarted()
{
kDebug(kdeconnect_kded()) << "Daemon successfuly started";
kDebug(theArea) << "Daemon successfuly started";
Q_EMIT started();
}
void Kded::onFinished(int exitCode, QProcess::ExitStatus status)
{
if (status == QProcess::CrashExit) {
kError(kdeconnect_kded()) << "Process crashed with code=" << exitCode;
kError(kdeconnect_kded()) << m_daemon->readAllStandardError();
kWarning(kdeconnect_kded()) << "Restarting in 5 sec...";
kError(theArea) << "Process crashed with code=" << exitCode;
kError(theArea) << m_daemon->readAllStandardError();
kWarning(theArea) << "Restarting in 5 sec...";
QTimer::singleShot(5000, this, SLOT(start()));
} else {
kWarning(kdeconnect_kded()) << "Process finished with code=" << exitCode;
kWarning(theArea) << "Process finished with code=" << exitCode;
}
Q_EMIT stopped();
......@@ -114,5 +116,5 @@ void Kded::checkIfDaemonTerminated()
}
m_daemon->kill();
kWarning(kdeconnect_kded()) << "Daemon killed";
kWarning(theArea) << "Daemon killed";
}
......@@ -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