summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: 2aed64b0947693d1598864cd81393cf7ac1eb423 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135

project(krdc-telepathy)

if(NOT INSIDE_KDENETWORK)
    message("Not building inside KDENetwork, loading KDE CMake Macros.")

    set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})

    find_package(KDE4 REQUIRED)

    include(KDE4Defaults)
    include(MacroLibrary)

    include(CheckIncludeFile)
    include(CheckIncludeFiles)
    include(CheckSymbolExists)
    include(CheckFunctionExists)
    include(CheckLibraryExists)
    include(CheckPrototypeExists)
    include(CheckTypeSize)
    include(MacroBoolTo01)
    include(MacroOptionalAddSubdirectory)

    macro_optional_find_package(TelepathyQt4)
    macro_log_feature(TELEPATHY_QT4_FOUND "telepathy-qt4" "Telepathy Qt Bindings" "https://telepathy.freedesktop.org" FALSE "0.18" "Needed to build Telepathy protocol plugin.")

#    macro_optional_find_package(LibKNotificationItem-1)
#    macro_log_feature(LIBKNOTIFICATIONITEM-1_FOUND "libknotificationitem" "The KDE4 implementation of the experimental next-gen systray protocol" "" FALSE "" "Provides enhanced systray in KGet.")

    set(CMAKE_REQUIRED_DEFINITIONS ${_KDE4_PLATFORM_DEFINITIONS})
    if(WIN32)
       set(CMAKE_REQUIRED_LIBRARIES ${KDEWIN32_LIBRARIES})
       set(CMAKE_REQUIRED_INCLUDES  ${KDEWIN32_INCLUDES})
    endif(WIN32)
    add_definitions(${QT_DEFINITIONS} ${QT_QTDBUS_DEFINITIONS} ${KDE4_DEFINITIONS})
    include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES} ${LIBKNOTIFICATIONITEM-1_INCLUDE_DIR})

    macro_optional_find_package(LibVNCServer)
    macro_log_feature(LIBVNCSERVER_FOUND "libvncserver" "VNC Server library" "http://libvncserver.sourceforge.net/" FALSE "0.9" "Needed to build Krfb and VNC support in Krdc")

    # NX support is not ready for KDE 4.2; disabled (uwolfer)
    # macro_optional_find_package(LibNXCL)
    # macro_log_feature(LIBNXCL_FOUND "libnxcl" "NX X compression client library" "http://svn.berlios.de/svnroot/repos/freenx/trunk/freenx-client/nxcl/" FALSE "1.0" "Needed to build Krdc with NX support")
endif(NOT INSIDE_KDENETWORK)

include_directories(
    ${CMAKE_CURRENT_SOURCE_DIR}
    ${CMAKE_CURRENT_SOURCE_DIR}/core/
    ${CMAKE_CURRENT_BINARY_DIR}/core/
    ${CMAKE_CURRENT_BINARY_DIR}
)

if(TELEPATHY_QT4_FOUND)
    add_definitions(-DTELEPATHY_SUPPORT)
    include_directories(${TELEPATHY_QT4_INCLUDE_DIR})
endif(TELEPATHY_QT4_FOUND)

include_directories(${LIBKNOTIFICATIONITEM-1_INCLUDE_DIR})

add_subdirectory(core)
add_subdirectory(vnc)
add_subdirectory(nx)
add_subdirectory(rdp)
add_subdirectory(test)

if(TELEPATHY_QT4_FOUND)
    add_subdirectory(krdc_approver)
endif(TELEPATHY_QT4_FOUND)

add_definitions(-DKDE_DEFAULT_DEBUG_AREA=5010)

add_definitions(-DBUILD_ZEROCONF)
set(krdc_zeroconf_SRCS
    zeroconf/zeroconfpage.cpp
)

set(krdc_SRCS ${krdc_zeroconf_SRCS}
    config/hostpreferenceslist.cpp
    config/preferencesdialog.cpp
    floatingtoolbar.cpp
    bookmarkmanager.cpp
    remotedesktopsitem.cpp
    remotedesktopsmodel.cpp
    systemtrayicon.cpp
    mainwindow.cpp
    main.cpp
)

if(TELEPATHY_QT4_FOUND)
    set(krdc_SRCS ${krdc_SRCS}
        tubesmanager.cpp
        tube.cpp
    )
endif(TELEPATHY_QT4_FOUND)

kde4_add_ui_files(krdc_SRCS
    config/general.ui
)

kde4_add_executable(krdc ${krdc_SRCS})

target_link_libraries(krdc
    ${KDE4_KFILE_LIBS}
    ${KDE4_KIO_LIBS}
    ${KDE4_KNOTIFYCONFIG_LIBS}
    ${KDE4_KUTILS_LIBS}
    ${LIBKNOTIFICATIONITEM-1_LIBRARY}
    krdccore
)

if(TELEPATHY_QT4_FOUND)
    target_link_libraries(krdc
        ${TELEPATHY_QT4_LIBRARIES}
    )
endif(TELEPATHY_QT4_FOUND)

target_link_libraries(krdc ${KDE4_KDNSSD_LIBS})

install(TARGETS krdc ${INSTALL_TARGETS_DEFAULT_ARGS})
install(FILES krdcui.rc DESTINATION ${DATA_INSTALL_DIR}/krdc)
install(FILES krdc.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
install(FILES pointcursor.png pointcursormask.png DESTINATION ${DATA_INSTALL_DIR}/krdc/pics)

if(TELEPATHY_QT4_FOUND)
    configure_file(org.freedesktop.Telepathy.Client.krdc_rfb_handler.service.in
                    org.freedesktop.Telepathy.Client.krdc_rfb_handler.service)
    install(FILES ${CMAKE_BINARY_DIR}/org.freedesktop.Telepathy.Client.krdc_rfb_handler.service
            DESTINATION ${DBUS_SERVICES_INSTALL_DIR})

    install(FILES krdc_rfb_handler.client DESTINATION ${CMAKE_INSTALL_PREFIX}/share/telepathy/clients/)
endif(TELEPATHY_QT4_FOUND)

if(NOT INSIDE_KDENETWORK)
    macro_display_feature_log()
endif(NOT INSIDE_KDENETWORK)