forked from TelepathyIM/telepathy-morse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
executable file
·116 lines (94 loc) · 2.63 KB
/
CMakeLists.txt
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
project(telepathy-morse)
cmake_minimum_required(VERSION 2.8)
if (USE_QT4)
find_package(TelepathyQt4 0.9.7 REQUIRED)
find_package(TelepathyQt4Service 0.9.7 REQUIRED)
find_package(TelegramQt4 REQUIRED)
find_package(Qt4 4.6.0 REQUIRED QtCore QtNetwork)
if (TELEPATHY_QT4_VERSION VERSION_LESS "0.9.8")
set(USE_BUNDLED_GROUPS_IFACE TRUE)
endif()
else()
find_package(TelepathyQt5 0.9.7 REQUIRED)
find_package(TelepathyQt5Service 0.9.7 REQUIRED)
find_package(TelegramQt5 REQUIRED)
find_package(Qt5 REQUIRED COMPONENTS Core DBus Xml Network)
if (TELEPATHY_QT5_VERSION VERSION_LESS "0.9.8")
set(USE_BUNDLED_GROUPS_IFACE TRUE)
endif()
endif()
include(GNUInstallDirs)
include_directories(
${CMAKE_SOURCE_DIR}
${CMAKE_BINARY_DIR}
)
add_definitions(-DQT_NO_CAST_FROM_ASCII)
set(morse_SOURCES
main.cpp
connection.cpp
connection.hpp
debug.cpp
debug.hpp
identifier.cpp
identifier.hpp
protocol.cpp
protocol.hpp
textchannel.cpp
textchannel.hpp
)
if (USE_BUNDLED_GROUPS_IFACE)
list(APPEND morse_SOURCES
contactgroups.cpp
contactgroups.hpp
)
endif()
add_executable(telepathy-morse ${morse_SOURCES})
set_target_properties(telepathy-morse PROPERTIES AUTOMOC TRUE)
if (USE_QT4)
target_include_directories(telepathy-morse PRIVATE
${QT_INCLUDES}
${TELEPATHY_QT4_INCLUDE_DIR}
${TELEGRAM_QT4_INCLUDE_DIR})
target_link_libraries(telepathy-morse
${QT_QTCORE_LIBRARY}
${QT_QTDBUS_LIBRARY}
${QT_QTNETWORK_LIBRARY}
${QT_QTGUI_LIBRARY}
${TELEPATHY_QT4_LIBRARIES}
${TELEPATHY_QT4_SERVICE_LIBRARIES}
${TELEGRAM_QT4_LIBRARIES}
-lcrypto
-lz
)
else()
target_include_directories(telepathy-morse PRIVATE
${TELEPATHY_QT5_INCLUDE_DIR}
${TELEGRAM_QT5_INCLUDE_DIR})
target_link_libraries(telepathy-morse
Qt5::Core
Qt5::DBus
Qt5::Network
${TELEPATHY_QT5_LIBRARIES}
${TELEPATHY_QT5_SERVICE_LIBRARIES}
${TELEGRAM_QT5_LIBRARIES}
-lcrypto
-lz
)
endif()
configure_file(morse.service.in org.freedesktop.Telepathy.ConnectionManager.morse.service)
install(
TARGETS telepathy-morse
DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}
)
install(
FILES morse.manager
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/telepathy/managers
)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/org.freedesktop.Telepathy.ConnectionManager.morse.service
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/dbus-1/services
)
#install(
# FILES morse.png
# DESTINATION share/icons/hicolor/48x48/apps
#)