CMakeLists.txt 2.8 KB
Newer Older
1 2 3
function(geninterface source_h output_h)
    set(xml_file ${CMAKE_CURRENT_BINARY_DIR}/${output_h}.xml)
    qt5_generate_dbus_interface( ${source_h} ${xml_file})
4

5 6
    set_source_files_properties(${xml_file} PROPERTIES NO_NAMESPACE true)

Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
7
    qt5_add_dbus_interface(libkdeconnect_SRC ${xml_file} ${output_h})
8 9
    set(libkdeconnect_SRC ${libkdeconnect_SRC} PARENT_SCOPE)
endfunction()
10

11 12 13 14
set(libkdeconnect_SRC
    dbusinterfaces.cpp
    devicesmodel.cpp
    notificationsmodel.cpp
15
    devicessortproxymodel.cpp
16
    conversationmessage.cpp
17
    remotecommandsmodel.cpp
18
    remotesinksmodel.cpp
19
#    modeltest.cpp
20 21
)

22 23 24 25 26 27 28
ecm_qt_declare_logging_category(
    libkdeconnect_SRC
    HEADER interfaces_debug.h
    IDENTIFIER KDECONNECT_INTERFACES
    CATEGORY_NAME kdeconnect.interfaces
)

Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
29 30 31 32 33
geninterface(${CMAKE_SOURCE_DIR}/core/daemon.h daemoninterface)
geninterface(${CMAKE_SOURCE_DIR}/core/device.h deviceinterface)
geninterface(${CMAKE_SOURCE_DIR}/plugins/battery/batterydbusinterface.h devicebatteryinterface)
geninterface(${CMAKE_SOURCE_DIR}/plugins/sftp/sftpplugin.h devicesftpinterface)
geninterface(${CMAKE_SOURCE_DIR}/plugins/notifications/notificationsdbusinterface.h devicenotificationsinterface)
David Edmundson's avatar
David Edmundson committed
34
geninterface(${CMAKE_SOURCE_DIR}/plugins/findmyphone/findmyphoneplugin.h devicefindmyphoneinterface)
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
35
geninterface(${CMAKE_SOURCE_DIR}/plugins/notifications/notification.h notificationinterface)
36
geninterface(${CMAKE_SOURCE_DIR}/plugins/mprisremote/mprisremoteplugin.h mprisremoteinterface)
37
geninterface(${CMAKE_SOURCE_DIR}/plugins/remotecontrol/remotecontrolplugin.h remotecontrolinterface)
38
geninterface(${CMAKE_SOURCE_DIR}/plugins/lockdevice/lockdeviceplugin.h lockdeviceinterface)
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
39
geninterface(${CMAKE_SOURCE_DIR}/plugins/remotecommands/remotecommandsplugin.h remotecommandsinterface)
Holger Kaelberer's avatar
Holger Kaelberer committed
40
geninterface(${CMAKE_SOURCE_DIR}/plugins/remotekeyboard/remotekeyboardplugin.h remotekeyboardinterface)
41 42
geninterface(${CMAKE_SOURCE_DIR}/plugins/sms/smsplugin.h smsinterface)
geninterface(${CMAKE_SOURCE_DIR}/plugins/sms/conversationsdbusinterface.h conversationsinterface)
Billy Laws's avatar
Billy Laws committed
43
geninterface(${CMAKE_SOURCE_DIR}/plugins/share/shareplugin.h shareinterface)
44 45
geninterface(${CMAKE_SOURCE_DIR}/plugins/remotesystemvolume/remotesystemvolumeplugin.h remotesystemvolumeinterface)

46
add_library(kdeconnectinterfaces SHARED ${libkdeconnect_SRC})
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
47
set_target_properties(kdeconnectinterfaces PROPERTIES
48 49
    VERSION ${KDECONNECT_VERSION}
    SOVERSION ${KDECONNECT_VERSION_MAJOR}
50 51
)

Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
52 53 54
generate_export_header(kdeconnectinterfaces EXPORT_FILE_NAME ${CMAKE_CURRENT_BINARY_DIR}/kdeconnectinterfaces_export.h BASE_NAME KDEConnectInterfaces)

target_link_libraries(kdeconnectinterfaces
55
LINK_PUBLIC
56
    Qt5::Gui
57
    Qt5::DBus
58
LINK_PRIVATE
59
    KF5::ConfigCore
Albert Vaca Cintora's avatar
Albert Vaca Cintora committed
60
    KF5::I18n
61
    kdeconnectcore
62 63
)

64
install(TARGETS kdeconnectinterfaces EXPORT kdeconnectLibraryTargets ${INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP)