forked from TelepathyIM/telepathy-morse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
executable file
·108 lines (85 loc) · 2.41 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
project(telepathy-morse)
cmake_minimum_required(VERSION 2.8)
find_package(TelepathyQt5 0.9.6 REQUIRED)
find_package(TelepathyQt5Service 0.9.6 REQUIRED)
set(TELEPATHY_QT_VERSION ${TELEPATHY_QT5_VERSION})
find_package(TelegramQt5 REQUIRED)
find_package(Qt5 REQUIRED COMPONENTS Core DBus Xml Network)
include(GNUInstallDirs)
include_directories(
${CMAKE_SOURCE_DIR}
${CMAKE_BINARY_DIR}
)
add_definitions(-DQT_NO_CAST_FROM_ASCII)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall")
set(morse_SOURCES
main.cpp
connection.cpp
connection.hpp
protocol.cpp
protocol.hpp
textchannel.cpp
textchannel.hpp
)
if (TELEPATHY_QT_VERSION VERSION_LESS "0.9.7")
message(WARNING "TelepathyQt version < 0.9.7, so group chat and debug interface support will be disabled.")
else()
set(ENABLE_GROUP_CHAT TRUE)
set(ENABLE_DEBUG_IFACE TRUE)
endif()
if (ENABLE_DEBUG_IFACE)
add_definitions(-DENABLE_DEBUG_IFACE)
list(APPEND morse_SOURCES
debug.cpp
debug.hpp
)
endif()
if (ENABLE_GROUP_CHAT)
add_definitions(-DENABLE_GROUP_CHAT)
if (TELEPATHY_QT_VERSION VERSION_LESS "0.9.8")
add_definitions(-DUSE_BUNDLED_GROUPS_IFACE)
set(USE_BUNDLED_GROUPS_IFACE TRUE)
endif()
endif()
if (USE_BUNDLED_GROUPS_IFACE)
list(APPEND morse_SOURCES
contactgroups.cpp
contactgroups.hpp
)
endif()
# 'Unstable' stuff which is not a part of TelegramQt yet
list(APPEND morse_SOURCES
extras/CFileManager.cpp
)
add_executable(telepathy-morse ${morse_SOURCES})
set_target_properties(telepathy-morse PROPERTIES AUTOMOC TRUE)
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
)
configure_file(dbus-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
#)