-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
CMakeLists.txt
306 lines (248 loc) · 9.35 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
# SPDX-FileCopyrightText: 2020-2024 Laurent Montel <montel@kde.org>
# SPDX-License-Identifier: BSD-3-Clause
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
set(RUQOLA_VERSION "2.4.40")
# TODO: update it in each release version
set(RUQOLA_RELEASE_VERSION "24.12.27") # yy.MM.dd
# Use true if stable version => we will check specific version
set(RUQOLA_STABLE_VERSION false)
project(Ruqola VERSION ${RUQOLA_VERSION})
set(QT_REQUIRED_VERSION "6.7.0")
set(KF_MIN_VERSION "6.8.0")
set(CMAKE_CXX_STANDARD 20)
# Do NOT add quote
set(RUQOLA_DEV_VERSION alpha)
# add an extra space
if(DEFINED RUQOLA_DEV_VERSION)
set(RUQOLA_DEV_VERSION " ${RUQOLA_DEV_VERSION}")
endif()
set(RUQOLA_VERSION_STRING "${RUQOLA_VERSION}${RUQOLA_DEV_VERSION}")
find_package(ECM ${KF_MIN_VERSION} CONFIG REQUIRED)
set(CMAKE_MODULE_PATH ${Ruqola_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH})
include(KDECompilerSettings NO_POLICY_SCOPE)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(ECMInstallIcons)
include(ECMQtDeclareLoggingCategory)
include(ECMAddTests)
include(GenerateExportHeader)
include(FeatureSummary)
include(CheckIncludeFileCXX)
include(KDEGitCommitHooks)
include(ECMDeprecationSettings)
include(KDEClangFormat)
file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES src/widgets/*.cpp src/widgets/*.h src/rocketchatrestapi-qt/*.cpp src/rocketchatrestapi-qt/*.h src/core/*.cpp src/core/*.h src/plugins/*.cpp src/plugins/*.h tests/*.cpp tests/*.h)
kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
include(ECMGenerateHeaders)
include(ECMSetupVersion)
include(ECMCheckOutboundLicense)
option(OPTION_USE_SIZEHINT_CACHE_SUPPORT "Add sizehint cache" ON)
option(OPTION_USE_ROUNDED_RECT_PIXMAP "Show avatar in a rounded rect" ON)
option(OPTION_USE_PLASMA_ACTIVITIES "Activate plasma activities" ON)
option(OPTION_USE_E2E_SUPPORT "E2E support (experimental)" OFF)
option(OPTION_DISABLE_NETWORKMANAGER "Disable Network Manager support (mainly for debugging)" OFF)
# -fhardened increase compilation time and produce a lot of warning
option(OPTION_DISABLE_HARDENED_OPTIMIZATION "Disable -fhardened" OFF)
if(OPTION_USE_PLASMA_ACTIVITIES)
if(NOT WIN32 AND NOT APPLE)
set(OPTION_USE_PLASMA_ACTIVITIES true)
else()
set(OPTION_USE_PLASMA_ACTIVITIES false)
endif()
endif()
if(OPTION_USE_E2E_SUPPORT)
set(USE_E2E_SUPPORT true)
find_package(OpenSSL REQUIRED COMPONENTS Crypto)
endif()
if(OPTION_USE_ROUNDED_RECT_PIXMAP)
set(USE_ROUNDED_RECT_PIXMAP true)
endif()
if(OPTION_USE_SIZEHINT_CACHE_SUPPORT)
set(USE_SIZEHINT_CACHE_SUPPORT true)
endif()
option(USE_UNITY_CMAKE_SUPPORT "Use UNITY cmake support (speedup compile time)" OFF)
set(COMPILE_WITH_UNITY_CMAKE_SUPPORT false)
if(USE_UNITY_CMAKE_SUPPORT)
set(COMPILE_WITH_UNITY_CMAKE_SUPPORT true)
endif()
option(PLUGINS_AUTHENTICATION_BASED_ON_O2 "Build authentication based on o2 lib (experimental)" OFF)
if(NOT WIN32 AND NOT APPLE)
option(UNITY_SUPPORT "Build unity support" ON)
else()
set(UNITY_SUPPORT OFF)
endif()
if(UNITY_SUPPORT)
set(HAVE_UNITY_SUPPORT true)
endif()
set(KTEXTADDONS_MIN_VERSION "1.5.4")
set(KLLMWIDGETS_VERSION "0.1.0")
set(QT6KEYCHAIN_LIB_VERSION "0.14.2")
find_package(Qt6 ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS Core Gui Widgets WebSockets Network NetworkAuth MultimediaWidgets Sql)
find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS
CoreAddons
I18n
Crash
Notifications
IconThemes
SyntaxHighlighting
NotifyConfig
ItemViews
IdleTime
Prison
Archive
ColorScheme
Codecs # KEmailAddress
)
if(OPTION_USE_PLASMA_ACTIVITIES)
if(NOT WIN32 AND NOT APPLE)
find_package(PlasmaActivities "6.1.0")
set_package_properties(PlasmaActivities PROPERTIES DESCRIPTION
"Allow to compile with plasma activities"
TYPE OPTIONAL
)
endif()
endif()
if(TARGET Plasma::Activities)
set(HAVE_ACTIVITY_SUPPORT TRUE)
endif()
find_package(KF6TextTranslator ${KTEXTADDONS_MIN_VERSION} CONFIG)
set_package_properties(KF6TextTranslator PROPERTIES DESCRIPTION
"Add support for text translation (ktextaddons)"
TYPE OPTIONAL
)
if(TARGET KF6::TextTranslator)
set(HAVE_TEXT_TRANSLATOR TRUE)
endif()
find_package(KF6TextAutoCorrectionWidgets ${KTEXTADDONS_MIN_VERSION} CONFIG)
set_package_properties(KF6TextAutoCorrectionWidgets PROPERTIES DESCRIPTION
"Add support for text auto correction (ktextaddons)"
TYPE OPTIONAL
)
if(TARGET KF6::TextAutoCorrectionWidgets)
set(HAVE_TEXT_AUTOCORRECTION_WIDGETS TRUE)
endif()
find_package(KF6TextEditTextToSpeech ${KTEXTADDONS_MIN_VERSION} CONFIG)
set_package_properties(KF6TextEditTextToSpeech PROPERTIES DESCRIPTION
"Add support for text to speech (ktextaddons)"
TYPE OPTIONAL
)
if(TARGET KF6::TextEditTextToSpeech)
set(HAVE_TEXT_TO_SPEECH TRUE)
endif()
find_package(KF6TextEmoticonsWidgets ${KTEXTADDONS_MIN_VERSION} CONFIG)
set_package_properties(KF6TextEmoticonsWidgets PROPERTIES DESCRIPTION
"Add text emoticons support (ktextaddons)"
TYPE REQUIRED
)
if(${KF6TextEmoticonsWidgets_VERSION} VERSION_GREATER_EQUAL 1.5.44)
set(HAVE_TEXTADDONS_TEXTEMOTICON_EXCLUDEEMOTICON_SUPPORT TRUE)
else()
if(${KF6TextEmoticonsWidgets_VERSION} VERSION_GREATER_EQUAL 1.5.3)
if(${KF6TextEmoticonsWidgets_VERSION} VERSION_LESS_EQUAL 1.5.30)
set(HAVE_TEXTADDONS_TEXTEMOTICON_EXCLUDEEMOTICON_SUPPORT TRUE)
endif()
endif()
endif()
find_package(KF6TextUtils ${KTEXTADDONS_MIN_VERSION} CONFIG)
set_package_properties(KF6TextUtils PROPERTIES DESCRIPTION
"Add utils text functions (ktextaddons)"
TYPE OPTIONAL
)
if(TARGET KF6::TextUtils)
set(HAVE_TEXT_UTILS TRUE)
endif()
find_package(KF6TextCustomEditor ${KTEXTADDONS_MIN_VERSION} CONFIG)
set_package_properties(KF6TextCustomEditor PROPERTIES DESCRIPTION
"Add text custom editor (ktextaddons)"
TYPE OPTIONAL
)
if(TARGET KF6::TextCustomEditor)
set(HAVE_TEXT_CUSTOM_EDITOR TRUE)
endif()
# shall we use DBus?
# enabled per default on Linux & BSD systems
set(USE_DBUS_DEFAULT OFF)
if(UNIX AND NOT APPLE AND NOT HAIKU)
set(USE_DBUS_DEFAULT ON)
endif()
option(USE_DBUS "Build components using DBus" ${USE_DBUS_DEFAULT})
if(USE_DBUS)
set(WITH_DBUS TRUE)
find_package(KF6DBusAddons ${KF_MIN_VERSION} CONFIG REQUIRED)
endif()
find_package(KF6XmlGui ${KF_MIN_VERSION} CONFIG REQUIRED)
find_package(KF6Config ${KF_MIN_VERSION} CONFIG REQUIRED)
find_package(KF6KIO ${KF_MIN_VERSION} CONFIG REQUIRED)
find_package(KF6Sonnet ${KF_MIN_VERSION} CONFIG REQUIRED)
find_package(KF6TextWidgets ${KF_MIN_VERSION} CONFIG REQUIRED)
if(NOT APPLE)
find_package(KF6Purpose ${KF_MIN_VERSION} CONFIG)
endif()
find_package(KF6DocTools ${KF_MIN_VERSION})
set_package_properties(KF6DocTools PROPERTIES DESCRIPTION
"Tools to generate documentation"
TYPE OPTIONAL
)
find_package(KLLMWidgets ${KLLMWIDGETS_VERSION})
set_package_properties(KLLMWidgets PROPERTIES
TYPE OPTIONAL
PURPOSE "Required for building IA plugins support"
DESCRIPTION "Use local IA plugin"
URL https://invent.kde.org/utilities/alpaka
)
find_package(KF6StatusNotifierItem ${KF_MIN_VERSION} REQUIRED)
find_package(Qt6Keychain ${QT6KEYCHAIN_LIB_VERSION} CONFIG)
set_package_properties(Qt6Keychain PROPERTIES
DESCRIPTION "Provides support for secure credentials storage"
URL "https://github.com/frankosterfeld/qtkeychain"
TYPE REQUIRED)
find_package(KF6UserFeedback ${KF_MIN_VERSION} CONFIG)
set(HAVE_KUSERFEEDBACK ${KF6UserFeedback_FOUND})
set_package_properties(KF6UserFeedback PROPERTIES DESCRIPTION "User Feedback lib" TYPE OPTIONAL PURPOSE "Allow to send Telemetry Information (optional).")
if(OPTION_DISABLE_NETWORKMANAGER)
set(HAVE_NETWORKMANAGER FALSE)
else()
find_package(KF6NetworkManagerQt ${KF_MIN_VERSION} CONFIG)
set(HAVE_NETWORKMANAGER ${KF6NetworkManagerQt_FOUND})
set_package_properties(KF6NetworkManagerQt PROPERTIES DESCRIPTION "Network management lib" TYPE OPTIONAL PURPOSE "Allows detecting network state changes.")
endif()
if (NOT USE_DBUS)
find_package(KDSingleApplication-qt6 CONFIG REQUIRED)
endif()
include_directories(${CMAKE_CURRENT_BINARY_DIR})
ecm_set_disabled_deprecation_versions(QT 6.8.1
KF 6.10.0
)
set(RUQOLA_LIB_VERSION "${RUQOLA_VERSION}")
set(RUQOLA_LIB_SOVERSION "0")
configure_file(config-ruqola.h.in ${CMAKE_CURRENT_BINARY_DIR}/config-ruqola.h)
add_definitions(-DQT_NO_CONTEXTLESS_CONNECT)
if(BUILD_TESTING)
find_package(Qt6 ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS Test)
add_definitions(-DBUILD_TESTING)
endif()
if(PLUGINS_AUTHENTICATION_BASED_ON_O2)
find_package(o2)
endif()
if(OPTION_DISABLE_HARDENED_OPTIMIZATION)
string(REPLACE "-fhardened" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
string(REPLACE "-fhardened" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ")
endif()
add_subdirectory(src)
if(BUILD_TESTING)
add_subdirectory(tests)
endif()
ecm_qt_install_logging_categories(
EXPORT RUQOLA
FILE ruqola.categories
DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
)
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
ki18n_install(po)
if(KF6DocTools_FOUND)
kdoctools_install(po)
add_subdirectory(doc)
endif()
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
file(GLOB_RECURSE ALL_SOURCE_FILES src/widgets/*.cpp src/widgets/*.h src/rocketchatrestapi-qt/*.cpp src/rocketchatrestapi-qt/*.h src/core/*.cpp src/core/*.h src/plugins/*.cpp src/plugins/*.h tests/*.cpp tests/*.h)
ecm_check_outbound_license(LICENSES GPL-2.0-only FILES ${ALL_SOURCE_FILES})