| 1 |
cmake_minimum_required(VERSION 3.11...3.13) |
| 2 |
|
| 3 |
|
| 4 |
set( |
| 5 |
CMAKE_TOOLCHAIN_FILE |
| 6 |
"${CMAKE_CURRENT_LIST_DIR}/toolchain.cmake" |
| 7 |
CACHE |
| 8 |
FILEPATH |
| 9 |
"Default toolchain" |
| 10 |
) |
| 11 |
set(CMAKE_CXX_STANDARD 20 CACHE STRING "C++ standard") |
| 12 |
set(CMAKE_CXX_STANDARD_REQUIRED ON CACHE BOOL "Require C++ standard to be supported") |
| 13 |
set(CMAKE_POSITION_INDEPENDENT_CODE ON CACHE BOOL "compile as PIC by default") |
| 14 |
|
| 15 |
option(HUNTER_ENABLED "Enable Hunter package manager" OFF) |
| 16 |
include("cmake/HunterGate.cmake") |
| 17 |
HunterGate( |
| 18 |
URL "https://github.com/cpp-pm/hunter/archive/v0.25.2.tar.gz" |
| 19 |
SHA1 "560c000d5b6c972d41c2caf44f24189c868cc404" |
| 20 |
LOCAL |
| 21 |
) |
| 22 |
|
| 23 |
option(USE_BUNDLED_SPDLOG "Use the bundled version of spdlog." |
| 24 |
${HUNTER_ENABLED}) |
| 25 |
option(USE_BUNDLED_OLM "Use the bundled version of libolm." ${HUNTER_ENABLED}) |
| 26 |
option(USE_BUNDLED_GTEST "Use the bundled version of Google Test." |
| 27 |
${HUNTER_ENABLED}) |
| 28 |
option(USE_BUNDLED_JSON "Use the bundled version of nlohmann json." |
| 29 |
${HUNTER_ENABLED}) |
| 30 |
option(USE_BUNDLED_OPENSSL "Use the bundled version of OpenSSL." |
| 31 |
${HUNTER_ENABLED}) |
| 32 |
option(USE_BUNDLED_COEURL "Use a bundled version of the Curl wrapper" |
| 33 |
${HUNTER_ENABLED}) |
| 34 |
option(USE_BUNDLED_LIBEVENT "Use the bundled version of libevent." ${HUNTER_ENABLED}) |
| 35 |
option(USE_BUNDLED_LIBCURL "Use the bundled version of libcurl." ${HUNTER_ENABLED}) |
| 36 |
option(USE_BUNDLED_RE2 "Use the bundled version of re2." ${HUNTER_ENABLED}) |
| 37 |
|
| 38 |
|
| 39 |
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.12) |
| 40 |
project(matrix_client |
| 41 |
VERSION 0.10.1 |
| 42 |
DESCRIPTION "Client API library for Matrix." |
| 43 |
HOMEPAGE_URL https://github.com/Nheko-Reborn/mtxclient) |
| 44 |
else() |
| 45 |
project(matrix_client |
| 46 |
VERSION 0.10.1 |
| 47 |
DESCRIPTION "Client API library for Matrix.") |
| 48 |
endif() |
| 49 |
|
| 50 |
|
| 51 |
option(ASAN "Compile with address sanitizers" OFF) |
| 52 |
option(BUILD_LIB_TESTS "Build tests" ON) |
| 53 |
option(BUILD_LIB_EXAMPLES "Build examples" ON) |
| 54 |
option(COVERAGE "Calculate test coverage" OFF) |
| 55 |
option(IWYU "Check headers with include-what-you-use" OFF) |
| 56 |
option(BUILD_SHARED_LIBS "Specifies whether to build mtxclient as a shared library lib or not" ON) |
| 57 |
option(JSON_ImplicitConversions "Disable implicit conversions in nlohmann/json" ON) |
| 58 |
|
| 59 |
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") |
| 60 |
|
| 61 |
if(NOT MSVC AND NOT CLANG_TIDY_WORKAROUND) |
| 62 |
set( |
| 63 |
CMAKE_CXX_FLAGS |
| 64 |
"${CMAKE_CXX_FLAGS} \ |
| 65 |
-Wall \ |
| 66 |
-Wextra \ |
| 67 |
-Wconversion \ |
| 68 |
-pipe \ |
| 69 |
-pedantic \ |
| 70 |
-fsized-deallocation \ |
| 71 |
-fdiagnostics-color=always \ |
| 72 |
-Wno-attributes \ |
| 73 |
-Wunreachable-code" |
| 74 |
) |
| 75 |
endif() |
| 76 |
|
| 77 |
if(MSVC) |
| 78 |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj -bigobj") |
| 79 |
endif() |
| 80 |
|
| 81 |
if(ASAN) |
| 82 |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address,undefined") |
| 83 |
endif() |
| 84 |
|
| 85 |
add_library(matrix_client) |
| 86 |
|
| 87 |
if(NOT MSVC AND NOT APPLE) |
| 88 |
set(THREADS_PREFER_PTHREAD_FLAG ON) |
| 89 |
find_package(Threads REQUIRED) |
| 90 |
endif() |
| 91 |
|
| 92 |
include(FeatureSummary) |
| 93 |
|
| 94 |
if(USE_BUNDLED_OPENSSL) |
| 95 |
hunter_add_package(OpenSSL) |
| 96 |
endif() |
| 97 |
find_package(OpenSSL 1.1.0 REQUIRED) |
| 98 |
set_package_properties(OpenSSL PROPERTIES |
| 99 |
DESCRIPTION "Open source SSL and TLS implementation and cryptographic library" |
| 100 |
URL "https://www.openssl.org/" |
| 101 |
TYPE REQUIRED |
| 102 |
) |
| 103 |
|
| 104 |
if(USE_BUNDLED_OLM) |
| 105 |
include(FetchContent) |
| 106 |
FetchContent_Declare( |
| 107 |
Olm |
| 108 |
GIT_REPOSITORY https://gitlab.matrix.org/matrix-org/olm.git |
| 109 |
GIT_TAG 3.2.14 |
| 110 |
) |
| 111 |
FetchContent_MakeAvailable(Olm) |
| 112 |
else() |
| 113 |
find_package(Olm 3.2.7 REQUIRED) |
| 114 |
set_package_properties(Olm PROPERTIES |
| 115 |
DESCRIPTION "An implementation of the Double Ratchet cryptographic ratchet" |
| 116 |
URL "https://git.matrix.org/git/olm/about/" |
| 117 |
TYPE REQUIRED |
| 118 |
) |
| 119 |
endif() |
| 120 |
|
| 121 |
if(USE_BUNDLED_JSON) |
| 122 |
hunter_add_package(nlohmann_json) |
| 123 |
endif() |
| 124 |
find_package(nlohmann_json 3.11.0 CONFIG REQUIRED) |
| 125 |
set_package_properties(nlohmann_json PROPERTIES |
| 126 |
DESCRIPTION "JSON for Modern C++, a C++11 header-only JSON class" |
| 127 |
URL "https://nlohmann.github.io/json/" |
| 128 |
TYPE REQUIRED |
| 129 |
) |
| 130 |
|
| 131 |
if(USE_BUNDLED_RE2) |
| 132 |
hunter_add_package(re2) |
| 133 |
find_package(re2 CONFIG REQUIRED) |
| 134 |
target_link_libraries(matrix_client PRIVATE re2::re2) |
| 135 |
else() |
| 136 |
find_package(PkgConfig REQUIRED) |
| 137 |
pkg_check_modules(re2 REQUIRED IMPORTED_TARGET re2) |
| 138 |
target_link_libraries(matrix_client PRIVATE PkgConfig::re2) |
| 139 |
endif() |
| 140 |
|
| 141 |
## Need to repeat all libevent deps?!? |
| 142 |
# libevent |
| 143 |
if (USE_BUNDLED_LIBEVENT) |
| 144 |
hunter_add_package(Libevent) |
| 145 |
find_package(Libevent CONFIG REQUIRED) |
| 146 |
else() |
| 147 |
find_package(PkgConfig REQUIRED) |
| 148 |
pkg_check_modules(libevent_core REQUIRED IMPORTED_TARGET libevent_core) |
| 149 |
if (WIN32) |
| 150 |
pkg_check_modules(libevent_windows REQUIRED IMPORTED_TARGET libevent_windows) |
| 151 |
else() |
| 152 |
pkg_check_modules(libevent_pthreads REQUIRED IMPORTED_TARGET |
| 153 |
libevent_pthreads) |
| 154 |
endif() |
| 155 |
endif() |
| 156 |
|
| 157 |
# curl |
| 158 |
if (USE_BUNDLED_LIBCURL) |
| 159 |
hunter_add_package(CURL) |
| 160 |
find_package(CURL CONFIG REQUIRED) |
| 161 |
else() |
| 162 |
find_package(PkgConfig REQUIRED) |
| 163 |
pkg_check_modules(libcurl REQUIRED IMPORTED_TARGET libcurl) |
| 164 |
endif() |
| 165 |
|
| 166 |
# spdlog |
| 167 |
if(USE_BUNDLED_SPDLOG) |
| 168 |
hunter_add_package(spdlog) |
| 169 |
endif() |
| 170 |
find_package(spdlog 1.0.0 CONFIG) |
| 171 |
set_package_properties(spdlog PROPERTIES |
| 172 |
DESCRIPTION "Very fast, header only, C++ logging library" |
| 173 |
URL "https://github.com/gabime/spdlog" |
| 174 |
TYPE REQUIRED |
| 175 |
) |
| 176 |
target_link_libraries(matrix_client PUBLIC spdlog::spdlog) |
| 177 |
|
| 178 |
if(USE_BUNDLED_COEURL) |
| 179 |
include(FetchContent) |
| 180 |
FetchContent_Declare( |
| 181 |
coeurl |
| 182 |
GIT_REPOSITORY https://nheko.im/Nheko-Reborn/coeurl.git |
| 183 |
GIT_TAG v0.3.1 |
| 184 |
) |
| 185 |
FetchContent_MakeAvailable(coeurl) |
| 186 |
target_link_libraries(matrix_client PUBLIC coeurl::coeurl) |
| 187 |
elseif(coeurl_DIR) |
| 188 |
find_package(coeurl CONFIG REQUIRED) |
| 189 |
target_link_libraries(matrix_client PUBLIC coeurl::coeurl) |
| 190 |
else() |
| 191 |
find_package(PkgConfig REQUIRED) |
| 192 |
pkg_check_modules(coeurl REQUIRED IMPORTED_TARGET coeurl>=0.3.0) |
| 193 |
target_link_libraries(matrix_client PUBLIC PkgConfig::coeurl) |
| 194 |
endif() |
| 195 |
|
| 196 |
|
| 197 |
target_sources(matrix_client |
| 198 |
PRIVATE |
| 199 |
lib/http/client.cpp |
| 200 |
lib/crypto/client.cpp |
| 201 |
lib/crypto/encoding.cpp |
| 202 |
lib/crypto/types.cpp |
| 203 |
lib/crypto/utils.cpp |
| 204 |
lib/utils.cpp |
| 205 |
lib/log.cpp |
| 206 |
lib/structs/common.cpp |
| 207 |
lib/structs/errors.cpp |
| 208 |
lib/structs/events.cpp |
| 209 |
lib/structs/identifiers.cpp |
| 210 |
lib/structs/pushrules.cpp |
| 211 |
lib/structs/requests.cpp |
| 212 |
lib/structs/secret_storage.cpp |
| 213 |
lib/structs/user_interactive.cpp |
| 214 |
lib/structs/events/aliases.cpp |
| 215 |
lib/structs/events/avatar.cpp |
| 216 |
lib/structs/events/canonical_alias.cpp |
| 217 |
lib/structs/events/collections.cpp |
| 218 |
lib/structs/events/common.cpp |
| 219 |
lib/structs/events/create.cpp |
| 220 |
lib/structs/events/encrypted.cpp |
| 221 |
lib/structs/events/encryption.cpp |
| 222 |
lib/structs/events/guest_access.cpp |
| 223 |
lib/structs/events/history_visibility.cpp |
| 224 |
lib/structs/events/join_rules.cpp |
| 225 |
lib/structs/events/member.cpp |
| 226 |
lib/structs/events/name.cpp |
| 227 |
lib/structs/events/pinned_events.cpp |
| 228 |
lib/structs/events/policy_rules.cpp |
| 229 |
lib/structs/events/power_levels.cpp |
| 230 |
lib/structs/events/presence.cpp |
| 231 |
lib/structs/events/reaction.cpp |
| 232 |
lib/structs/events/redaction.cpp |
| 233 |
lib/structs/events/server_acl.cpp |
| 234 |
lib/structs/events/spaces.cpp |
| 235 |
lib/structs/events/tag.cpp |
| 236 |
lib/structs/events/tombstone.cpp |
| 237 |
lib/structs/events/topic.cpp |
| 238 |
lib/structs/events/unknown.cpp |
| 239 |
lib/structs/events/voip.cpp |
| 240 |
lib/structs/events/widget.cpp |
| 241 |
lib/structs/events/account_data/direct.cpp |
| 242 |
lib/structs/events/account_data/fully_read.cpp |
| 243 |
lib/structs/events/account_data/ignored_users.cpp |
| 244 |
lib/structs/events/ephemeral/receipt.cpp |
| 245 |
lib/structs/events/ephemeral/typing.cpp |
| 246 |
lib/structs/events/nheko_extensions/event_expiry.cpp |
| 247 |
lib/structs/events/nheko_extensions/hidden_events.cpp |
| 248 |
lib/structs/events/nheko_extensions/invite_permissions.cpp |
| 249 |
lib/structs/events/messages/audio.cpp |
| 250 |
lib/structs/events/messages/elementeffect.cpp |
| 251 |
lib/structs/events/messages/emote.cpp |
| 252 |
lib/structs/events/messages/file.cpp |
| 253 |
lib/structs/events/messages/image.cpp |
| 254 |
lib/structs/events/messages/location.cpp |
| 255 |
lib/structs/events/messages/notice.cpp |
| 256 |
lib/structs/events/messages/text.cpp |
| 257 |
lib/structs/events/messages/unknown.cpp |
| 258 |
lib/structs/events/messages/video.cpp |
| 259 |
lib/structs/events/mscs/image_packs.cpp |
| 260 |
lib/structs/responses/capabilities.cpp |
| 261 |
lib/structs/responses/common.cpp |
| 262 |
lib/structs/responses/create_room.cpp |
| 263 |
lib/structs/responses/crypto.cpp |
| 264 |
lib/structs/responses/device.cpp |
| 265 |
lib/structs/responses/empty.cpp |
| 266 |
lib/structs/responses/login.cpp |
| 267 |
lib/structs/responses/media.cpp |
| 268 |
lib/structs/responses/members.cpp |
| 269 |
lib/structs/responses/messages.cpp |
| 270 |
lib/structs/responses/notifications.cpp |
| 271 |
lib/structs/responses/profile.cpp |
| 272 |
lib/structs/responses/register.cpp |
| 273 |
lib/structs/responses/sync.cpp |
| 274 |
lib/structs/responses/turn_server.cpp |
| 275 |
lib/structs/responses/users.cpp |
| 276 |
lib/structs/responses/version.cpp |
| 277 |
lib/structs/responses/well-known.cpp |
| 278 |
lib/structs/responses/public_rooms.cpp) |
| 279 |
add_library(MatrixClient::MatrixClient ALIAS matrix_client) |
| 280 |
set_property(TARGET matrix_client PROPERTY CXX_STANDARD 20) |
| 281 |
set_property(TARGET matrix_client PROPERTY CXX_EXTENSIONS OFF) |
| 282 |
target_include_directories( |
| 283 |
matrix_client |
| 284 |
PUBLIC |
| 285 |
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> |
| 286 |
$<INSTALL_INTERFACE:include>) |
| 287 |
|
| 288 |
if (NOT JSON_ImplicitConversions) |
| 289 |
set_target_properties(nlohmann_json::nlohmann_json PROPERTIES |
| 290 |
INTERFACE_COMPILE_DEFINITIONS "JSON_USE_IMPLICIT_CONVERSIONS=\$<BOOL:OFF>;JSON_DIAGNOSTICS=\$<BOOL:OFF>" |
| 291 |
) |
| 292 |
target_compile_definitions(matrix_client PUBLIC JSON_USE_IMPLICIT_CONVERSIONS=0) |
| 293 |
endif() |
| 294 |
|
| 295 |
target_link_libraries(matrix_client |
| 296 |
PUBLIC |
| 297 |
OpenSSL::Crypto |
| 298 |
OpenSSL::SSL |
| 299 |
Olm::Olm |
| 300 |
nlohmann_json::nlohmann_json) |
| 301 |
|
| 302 |
if(NOT MSVC AND NOT APPLE) |
| 303 |
target_link_libraries(matrix_client PUBLIC Threads::Threads) |
| 304 |
elseif(MSVC) |
| 305 |
target_compile_options(matrix_client PUBLIC /Zc:__cplusplus /utf-8 /MP /Gm- /EHsc) |
| 306 |
elseif(APPLE) |
| 307 |
target_link_libraries(matrix_client PUBLIC "-framework CoreFoundation" "-framework Security") |
| 308 |
endif() |
| 309 |
|
| 310 |
if(COVERAGE) |
| 311 |
include(CodeCoverage) |
| 312 |
add_custom_target(ctest COMMAND ${CMAKE_CTEST_COMMAND}) |
| 313 |
target_compile_options(matrix_client PUBLIC |
| 314 |
-O0 # no optimization |
| 315 |
-g # generate debug info |
| 316 |
--coverage # sets all required flags |
| 317 |
-fprofile-arcs -ftest-coverage # just to be sure, for clang! |
| 318 |
) |
| 319 |
target_link_options(matrix_client PUBLIC --coverage) |
| 320 |
setup_target_for_coverage(test_coverage ctest coverage) |
| 321 |
endif() |
| 322 |
|
| 323 |
|
| 324 |
if(IWYU) |
| 325 |
find_program(iwyu_path NAMES include-what-you-use iwyu) |
| 326 |
if(iwyu_path) |
| 327 |
set_property(TARGET matrix_client |
| 328 |
PROPERTY CXX_INCLUDE_WHAT_YOU_USE ${iwyu_path}) |
| 329 |
else() |
| 330 |
message(WARNING "Could not find the program include-what-you-use") |
| 331 |
endif() |
| 332 |
endif() |
| 333 |
|
| 334 |
if(BUILD_LIB_EXAMPLES) |
| 335 |
add_subdirectory(examples) |
| 336 |
endif() |
| 337 |
|
| 338 |
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) |
| 339 |
|
| 340 |
# |
| 341 |
# Installation & Target configuration. |
| 342 |
# |
| 343 |
include(GNUInstallDirs) |
| 344 |
set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/MatrixClient) |
| 345 |
|
| 346 |
install(TARGETS matrix_client |
| 347 |
EXPORT matrix_client-targets |
| 348 |
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} |
| 349 |
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) |
| 350 |
|
| 351 |
set_target_properties(matrix_client PROPERTIES EXPORT_NAME MatrixClient) |
| 352 |
|
| 353 |
install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) |
| 354 |
install(EXPORT matrix_client-targets |
| 355 |
FILE |
| 356 |
MatrixClientTargets.cmake |
| 357 |
NAMESPACE |
| 358 |
MatrixClient:: |
| 359 |
DESTINATION |
| 360 |
${INSTALL_CONFIGDIR}) |
| 361 |
|
| 362 |
include(CMakePackageConfigHelpers) |
| 363 |
write_basic_package_version_file( |
| 364 |
${CMAKE_CURRENT_BINARY_DIR}/MatrixClientConfigVersion.cmake |
| 365 |
VERSION |
| 366 |
${PROJECT_VERSION} |
| 367 |
COMPATIBILITY |
| 368 |
AnyNewerVersion) |
| 369 |
|
| 370 |
configure_package_config_file( |
| 371 |
${CMAKE_CURRENT_LIST_DIR}/cmake/MatrixClientConfig.cmake.in |
| 372 |
${CMAKE_CURRENT_BINARY_DIR}/MatrixClientConfig.cmake |
| 373 |
INSTALL_DESTINATION |
| 374 |
${INSTALL_CONFIGDIR}) |
| 375 |
|
| 376 |
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/MatrixClientConfig.cmake |
| 377 |
${CMAKE_CURRENT_BINARY_DIR}/MatrixClientConfigVersion.cmake |
| 378 |
DESTINATION |
| 379 |
${INSTALL_CONFIGDIR}) |
| 380 |
|
| 381 |
export(EXPORT |
| 382 |
matrix_client-targets |
| 383 |
FILE |
| 384 |
${CMAKE_CURRENT_BINARY_DIR}/MatrixClientTargets.cmake |
| 385 |
NAMESPACE |
| 386 |
MatrixClient::) |
| 387 |
export(PACKAGE MatrixClient) |
| 388 |
|
| 389 |
set_property(TARGET matrix_client PROPERTY SOVERSION ${PROJECT_VERSION}) |
| 390 |
|
| 391 |
if(BUILD_LIB_TESTS) |
| 392 |
enable_testing() |
| 393 |
|
| 394 |
if(USE_BUNDLED_GTEST) |
| 395 |
hunter_add_package(GTest) |
| 396 |
endif() |
| 397 |
find_package(GTest REQUIRED) |
| 398 |
|
| 399 |
file(COPY tests/fixtures DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) |
| 400 |
|
| 401 |
add_executable(client_api tests/client_api.cpp) |
| 402 |
target_link_libraries(client_api |
| 403 |
MatrixClient::MatrixClient |
| 404 |
GTest::GTest |
| 405 |
GTest::Main) |
| 406 |
target_include_directories(client_api PRIVATE |
| 407 |
${CMAKE_CURRENT_SOURCE_DIR}/tests) |
| 408 |
|
| 409 |
add_executable(media_api tests/media_api.cpp) |
| 410 |
target_link_libraries(media_api |
| 411 |
MatrixClient::MatrixClient |
| 412 |
GTest::GTest |
| 413 |
GTest::Main) |
| 414 |
target_include_directories(media_api PRIVATE |
| 415 |
${CMAKE_CURRENT_SOURCE_DIR}/tests) |
| 416 |
|
| 417 |
add_executable(e2ee tests/e2ee.cpp) |
| 418 |
target_link_libraries(e2ee |
| 419 |
MatrixClient::MatrixClient |
| 420 |
GTest::GTest |
| 421 |
GTest::Main) |
| 422 |
target_include_directories(e2ee PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests) |
| 423 |
|
| 424 |
add_executable(device tests/device.cpp) |
| 425 |
target_link_libraries(device |
| 426 |
MatrixClient::MatrixClient |
| 427 |
GTest::GTest |
| 428 |
GTest::Main) |
| 429 |
target_include_directories(device PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests) |
| 430 |
|
| 431 |
add_executable(utils tests/utils.cpp) |
| 432 |
target_link_libraries(utils |
| 433 |
MatrixClient::MatrixClient |
| 434 |
GTest::GTest |
| 435 |
GTest::Main) |
| 436 |
target_include_directories(utils PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests) |
| 437 |
|
| 438 |
add_executable(pushrules tests/pushrules.cpp) |
| 439 |
target_link_libraries(pushrules |
| 440 |
MatrixClient::MatrixClient |
| 441 |
GTest::GTest |
| 442 |
GTest::Main) |
| 443 |
target_include_directories(pushrules PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests) |
| 444 |
|
| 445 |
add_executable(connection tests/connection.cpp) |
| 446 |
target_link_libraries(connection |
| 447 |
MatrixClient::MatrixClient |
| 448 |
GTest::GTest |
| 449 |
GTest::Main) |
| 450 |
target_include_directories(connection PRIVATE |
| 451 |
${CMAKE_CURRENT_SOURCE_DIR}/tests) |
| 452 |
|
| 453 |
add_executable(identifiers tests/identifiers.cpp) |
| 454 |
target_link_libraries(identifiers |
| 455 |
MatrixClient::MatrixClient |
| 456 |
GTest::GTest |
| 457 |
GTest::Main) |
| 458 |
|
| 459 |
add_executable(events tests/events.cpp) |
| 460 |
target_link_libraries(events |
| 461 |
MatrixClient::MatrixClient |
| 462 |
GTest::GTest |
| 463 |
GTest::Main) |
| 464 |
|
| 465 |
add_executable(messages tests/messages.cpp) |
| 466 |
target_link_libraries(messages |
| 467 |
MatrixClient::MatrixClient |
| 468 |
GTest::GTest |
| 469 |
GTest::Main) |
| 470 |
|
| 471 |
add_executable(voip tests/voip.cpp) |
| 472 |
target_link_libraries(voip |
| 473 |
MatrixClient::MatrixClient |
| 474 |
GTest::GTest |
| 475 |
GTest::Main) |
| 476 |
|
| 477 |
add_executable(responses tests/responses.cpp) |
| 478 |
target_link_libraries(responses |
| 479 |
MatrixClient::MatrixClient |
| 480 |
GTest::GTest |
| 481 |
GTest::Main) |
| 482 |
|
| 483 |
add_executable(requests tests/requests.cpp) |
| 484 |
target_link_libraries(requests |
| 485 |
MatrixClient::MatrixClient |
| 486 |
GTest::GTest |
| 487 |
GTest::Main) |
| 488 |
|
| 489 |
add_executable(errors tests/errors.cpp) |
| 490 |
target_link_libraries(errors |
| 491 |
MatrixClient::MatrixClient |
| 492 |
GTest::GTest |
| 493 |
GTest::Main) |
| 494 |
|
| 495 |
add_executable(crypto tests/crypto.cpp) |
| 496 |
target_link_libraries(crypto |
| 497 |
MatrixClient::MatrixClient |
| 498 |
GTest::GTest |
| 499 |
GTest::Main) |
| 500 |
|
| 501 |
add_test(BasicConnectivity connection) |
| 502 |
add_test(ClientAPI client_api) |
| 503 |
add_test(MediaAPI media_api) |
| 504 |
add_test(Encryption e2ee) |
| 505 |
add_test(Devices device) |
| 506 |
add_test(Utilities utils) |
| 507 |
add_test(Pushrules pushrules) |
| 508 |
add_test(Identifiers identifiers) |
| 509 |
add_test(Errors errors) |
| 510 |
add_test(CryptoStructs crypto) |
| 511 |
add_test(StateEvents events) |
| 512 |
add_test(RoomEvents messages) |
| 513 |
add_test(VoIPEvents voip) |
| 514 |
add_test(Responses responses) |
| 515 |
add_test(Requests requests) |
| 516 |
endif() |