From d9452a731a1983d9b5d3f8cd419b09299c30996e Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Wed, 13 Mar 2019 18:10:36 +0900 Subject: Bump API_VERSION to 0.6 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index d2d8c218..e01f1f6c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -145,7 +145,7 @@ add_library(QMatrixClient ${libqmatrixclient_SRCS} ${libqmatrixclient_job_SRCS} ${libqmatrixclient_csdef_SRCS} ${libqmatrixclient_cswellknown_SRCS} ${libqmatrixclient_asdef_SRCS} ${libqmatrixclient_isdef_SRCS}) -set(API_VERSION "0.5") +set(API_VERSION "0.6") set_property(TARGET QMatrixClient PROPERTY VERSION "${API_VERSION}.0") set_property(TARGET QMatrixClient PROPERTY SOVERSION ${API_VERSION} ) set_property(TARGET QMatrixClient PROPERTY -- cgit v1.2.3 From 3ea5915d864040dd7f1b1cdffcacd67850a644bf Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 31 Mar 2019 18:45:11 +0900 Subject: CMakeLists.txt: slightly better version management --- CMakeLists.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index e01f1f6c..e4642f3a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -146,7 +146,8 @@ add_library(QMatrixClient ${libqmatrixclient_SRCS} ${libqmatrixclient_cswellknown_SRCS} ${libqmatrixclient_asdef_SRCS} ${libqmatrixclient_isdef_SRCS}) set(API_VERSION "0.6") -set_property(TARGET QMatrixClient PROPERTY VERSION "${API_VERSION}.0") +set(FULL_VERSION "${API_VERSION}.0") +set_property(TARGET QMatrixClient PROPERTY VERSION "${FULL_VERSION}") set_property(TARGET QMatrixClient PROPERTY SOVERSION ${API_VERSION} ) set_property(TARGET QMatrixClient PROPERTY INTERFACE_QMatrixClient_MAJOR_VERSION ${API_VERSION}) @@ -174,10 +175,12 @@ install(DIRECTORY lib/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} FILES_MATCHING PATTERN "*.h") include(CMakePackageConfigHelpers) +# NB: SameMajorVersion doesn't really work yet, as we're within 0.x trail. +# Maybe consider jumping the gun and releasing 1.0, as semver advises? write_basic_package_version_file( "${CMAKE_CURRENT_BINARY_DIR}/QMatrixClient/QMatrixClientConfigVersion.cmake" - VERSION ${API_VERSION} - COMPATIBILITY AnyNewerVersion + VERSION ${FULL_VERSION} + COMPATIBILITY SameMajorVersion ) export(PACKAGE QMatrixClient) -- cgit v1.2.3 From 5fcbbe4939f5bd9c64fc399d0d7ec43044f41c0c Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sat, 6 Apr 2019 20:55:29 +0900 Subject: CMakeLists.txt: use project() to set the version --- CMakeLists.txt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index e4642f3a..ca597469 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(qmatrixclient CXX) +set(API_VERSION "0.6") +project(qmatrixclient VERSION "${API_VERSION}.0" LANGUAGES CXX) option(QMATRIXCLIENT_INSTALL_EXAMPLE "install qmc-example application" ON) @@ -58,6 +59,7 @@ message( STATUS ) message( STATUS "=============================================================================" ) message( STATUS " libqmatrixclient Build Information" ) message( STATUS "=============================================================================" ) +message( STATUS "Version: ${PROJECT_VERSION}, API version: ${API_VERSION}") if (CMAKE_BUILD_TYPE) message( STATUS "Build type: ${CMAKE_BUILD_TYPE}") endif(CMAKE_BUILD_TYPE) @@ -145,9 +147,7 @@ add_library(QMatrixClient ${libqmatrixclient_SRCS} ${libqmatrixclient_job_SRCS} ${libqmatrixclient_csdef_SRCS} ${libqmatrixclient_cswellknown_SRCS} ${libqmatrixclient_asdef_SRCS} ${libqmatrixclient_isdef_SRCS}) -set(API_VERSION "0.6") -set(FULL_VERSION "${API_VERSION}.0") -set_property(TARGET QMatrixClient PROPERTY VERSION "${FULL_VERSION}") +set_property(TARGET QMatrixClient PROPERTY VERSION "${PROJECT_VERSION}") set_property(TARGET QMatrixClient PROPERTY SOVERSION ${API_VERSION} ) set_property(TARGET QMatrixClient PROPERTY INTERFACE_QMatrixClient_MAJOR_VERSION ${API_VERSION}) @@ -179,7 +179,6 @@ include(CMakePackageConfigHelpers) # Maybe consider jumping the gun and releasing 1.0, as semver advises? write_basic_package_version_file( "${CMAKE_CURRENT_BINARY_DIR}/QMatrixClient/QMatrixClientConfigVersion.cmake" - VERSION ${FULL_VERSION} COMPATIBILITY SameMajorVersion ) -- cgit v1.2.3 From 30004700fbfe84a51a651174105c5ae4391db159 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 23 Jun 2019 19:47:12 +0900 Subject: Use clang-format to autoformat generated API files --- CMakeLists.txt | 61 ++++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 44 insertions(+), 17 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index d2d8c218..faaa6a34 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.5) project(qmatrixclient CXX) @@ -48,11 +48,17 @@ find_package(Qt5 5.4.1 REQUIRED Network Gui Multimedia) get_filename_component(Qt5_Prefix "${Qt5_DIR}/../../../.." ABSOLUTE) if (GTAD_PATH) - get_filename_component(ABS_GTAD_PATH "${GTAD_PATH}" ABSOLUTE) + get_filename_component(ABS_GTAD_PATH "${GTAD_PATH}" PROGRAM) endif () if (MATRIX_DOC_PATH) - get_filename_component(ABS_API_DEF_PATH "${MATRIX_DOC_PATH}/api" ABSOLUTE) + get_filename_component(ABS_API_DEF_PATH "${MATRIX_DOC_PATH}/api" REALPATH) endif () +if (ABS_GTAD_PATH AND ABS_API_DEF_PATH) + if (NOT CLANG_FORMAT) + set(CLANG_FORMAT clang-format) + endif() + get_filename_component(ABS_CLANG_FORMAT "${CLANG_FORMAT}" PROGRAM) +endif() message( STATUS ) message( STATUS "=============================================================================" ) @@ -63,10 +69,15 @@ if (CMAKE_BUILD_TYPE) endif(CMAKE_BUILD_TYPE) message( STATUS "Using compiler: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}" ) message( STATUS "Using Qt ${Qt5_VERSION} at ${Qt5_Prefix}" ) -if (MATRIX_DOC_PATH AND GTAD_PATH) - message( STATUS "Generating API stubs enabled" ) +if (ABS_API_DEF_PATH AND ABS_GTAD_PATH) + message( STATUS "Generating API stubs enabled (use --target update-api)" ) message( STATUS " Using GTAD at ${ABS_GTAD_PATH}" ) message( STATUS " Using API files at ${ABS_API_DEF_PATH}" ) + if (ABS_CLANG_FORMAT) + message( STATUS "clang-format is at ${ABS_CLANG_FORMAT}") + else () + message( STATUS "${CLANG_FORMAT} is NOT FOUND; --target update-format-api disabled") + endif () endif () message( STATUS "=============================================================================" ) message( STATUS ) @@ -109,11 +120,23 @@ set(libqmatrixclient_SRCS ) set(CSAPI_DIR csapi) -set(FULL_CSAPI_DIR lib/${CSAPI_DIR}) -set(FULL_CSAPI_SRC_DIR ${ABS_API_DEF_PATH}/client-server) set(ASAPI_DEF_DIR application-service/definitions) set(ISAPI_DEF_DIR identity/definitions) + +foreach (D ${CSAPI_DIR} ${ASAPI_DEF_DIR} ${ISAPI_DEF_DIR}) + aux_source_directory(lib/${D} api_SRCS) +endforeach() + +# Make no mistake: CMake cannot run gtad first and then populate the list of +# resulting api_SRCS files. In other words, placing the above foreach after +# the custom targets definition won't bring the desired result: +# CMake will execute it at cmake invocation and gtad will only run later +# when building the update-api target. If you see that gtad has created +# new files you have to re-run cmake. +# TODO: check `file(GLOB_RECURSE ... CONFIGURE_DEPENDS)` (from CMake 3.14) if (MATRIX_DOC_PATH AND GTAD_PATH) + set(FULL_CSAPI_DIR lib/${CSAPI_DIR}) + set(FULL_CSAPI_SRC_DIR ${ABS_API_DEF_PATH}/client-server) file(GLOB_RECURSE API_DEFS RELATIVE ${PROJECT_SOURCE_DIR} ${FULL_CSAPI_SRC_DIR}/*.yaml ${ABS_API_DEF_PATH}/${ASAPI_DEF_DIR}/*.yaml @@ -131,20 +154,24 @@ if (MATRIX_DOC_PATH AND GTAD_PATH) ${API_DEFS} VERBATIM ) + if (CLANG_FORMAT) + set(api_HDRS ${api_SRCS}) + list(TRANSFORM api_HDRS REPLACE ".cpp$" ".h") + set(CLANG_FORMAT_ARGS -i -sort-includes -verbose) + add_custom_target(update-format-api + COMMAND ${ABS_CLANG_FORMAT} ${CLANG_FORMAT_ARGS} ${api_SRCS} + COMMAND ${ABS_CLANG_FORMAT} ${CLANG_FORMAT_ARGS} ${api_HDRS} + DEPENDS update-api + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + VERBATIM + SOURCES .clang-format + ) + endif() endif() -aux_source_directory(${FULL_CSAPI_DIR} libqmatrixclient_job_SRCS) -aux_source_directory(${FULL_CSAPI_DIR}/definitions libqmatrixclient_csdef_SRCS) -aux_source_directory(${FULL_CSAPI_DIR}/definitions/wellknown libqmatrixclient_cswellknown_SRCS) -aux_source_directory(lib/${ASAPI_DEF_DIR} libqmatrixclient_asdef_SRCS) -aux_source_directory(lib/${ISAPI_DEF_DIR} libqmatrixclient_isdef_SRCS) - set(example_SRCS examples/qmc-example.cpp) -add_library(QMatrixClient ${libqmatrixclient_SRCS} - ${libqmatrixclient_job_SRCS} ${libqmatrixclient_csdef_SRCS} - ${libqmatrixclient_cswellknown_SRCS} - ${libqmatrixclient_asdef_SRCS} ${libqmatrixclient_isdef_SRCS}) +add_library(QMatrixClient ${libqmatrixclient_SRCS} ${api_SRCS}) set(API_VERSION "0.5") set_property(TARGET QMatrixClient PROPERTY VERSION "${API_VERSION}.0") set_property(TARGET QMatrixClient PROPERTY SOVERSION ${API_VERSION} ) -- cgit v1.2.3 From 8d96901ff455e4072dd4b050cf9c17a5780bfacb Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Mon, 24 Jun 2019 07:37:35 +0900 Subject: CMakeLists.txt: Re-add parts of CSAPI that accidentally went missing --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index da9bb66d..91236ec6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -125,7 +125,8 @@ set(CSAPI_DIR csapi) set(ASAPI_DEF_DIR application-service/definitions) set(ISAPI_DEF_DIR identity/definitions) -foreach (D ${CSAPI_DIR} ${ASAPI_DEF_DIR} ${ISAPI_DEF_DIR}) +foreach (D ${CSAPI_DIR} ${CSAPI_DIR}/definitions + ${CSAPI_DIR}/definitions/wellknown ${ASAPI_DEF_DIR} ${ISAPI_DEF_DIR}) aux_source_directory(lib/${D} api_SRCS) endforeach() -- cgit v1.2.3 From 08c424d4e853b4dc67d966ca0336892e580f9d20 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Tue, 25 Jun 2019 07:45:41 +0900 Subject: CMakeLists: use REALPATH instead of PROGRAM to find gtad PROGRAM doesn't seem to work right with relative paths. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 91236ec6..54082671 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,7 +49,7 @@ find_package(Qt5 5.4.1 REQUIRED Network Gui Multimedia) get_filename_component(Qt5_Prefix "${Qt5_DIR}/../../../.." ABSOLUTE) if (GTAD_PATH) - get_filename_component(ABS_GTAD_PATH "${GTAD_PATH}" PROGRAM) + get_filename_component(ABS_GTAD_PATH "${GTAD_PATH}" REALPATH) endif () if (MATRIX_DOC_PATH) get_filename_component(ABS_API_DEF_PATH "${MATRIX_DOC_PATH}/api" REALPATH) -- cgit v1.2.3 From 553acc9d234140fd94e768679756077271902e6f Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Tue, 25 Jun 2019 08:03:08 +0900 Subject: CMakeLists: replace list(TRANSFORM) with foreach/list(APPEND) list(TRANSFORM) is only available from CMake 3.12. --- CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 54082671..874594e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -158,8 +158,11 @@ if (MATRIX_DOC_PATH AND GTAD_PATH) VERBATIM ) if (CLANG_FORMAT) - set(api_HDRS ${api_SRCS}) - list(TRANSFORM api_HDRS REPLACE ".cpp$" ".h") + # TODO: list(TRANSFORM) is available from CMake 3.12 + foreach (S ${api_SRCS}) + string (REGEX REPLACE ".cpp$" ".h" H ${S}) + list(APPEND api_HDRS ${H}) + endforeach() set(CLANG_FORMAT_ARGS -i -sort-includes -verbose) add_custom_target(update-format-api COMMAND ${ABS_CLANG_FORMAT} ${CLANG_FORMAT_ARGS} ${api_SRCS} -- cgit v1.2.3 From 90623dd4a191d4cce2ddd514f313f689d0a135b0 Mon Sep 17 00:00:00 2001 From: Felix Rohrbach Date: Sun, 2 Oct 2016 08:01:22 +0900 Subject: Include olm via cmake (should work on Linux and MinGW) --- CMakeLists.txt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index ca597469..6718000c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,12 @@ if (NOT WIN32) include(GNUInstallDirs) endif(NOT WIN32) +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) +include(cmake/FindOlm.cmake) + +# Find includes in corresponding build directories +set(CMAKE_INCLUDE_CURRENT_DIR ON) + # Instruct CMake to run moc automatically when needed. set(CMAKE_AUTOMOC ON) @@ -47,6 +53,8 @@ endforeach () # upstream Qt 5.4 is required. find_package(Qt5 5.4.1 REQUIRED Network Gui Multimedia) get_filename_component(Qt5_Prefix "${Qt5_DIR}/../../../.." ABSOLUTE) +find_package(Olm REQUIRED) +get_filename_component(Olm_Prefix "${Olm_INCLUDE_DIRS}/.." ABSOLUTE) if (GTAD_PATH) get_filename_component(ABS_GTAD_PATH "${GTAD_PATH}" ABSOLUTE) @@ -64,11 +72,13 @@ if (CMAKE_BUILD_TYPE) message( STATUS "Build type: ${CMAKE_BUILD_TYPE}") endif(CMAKE_BUILD_TYPE) message( STATUS "Using compiler: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}" ) +message( STATUS "Install Prefix: ${CMAKE_INSTALL_PREFIX}" ) message( STATUS "Using Qt ${Qt5_VERSION} at ${Qt5_Prefix}" ) if (MATRIX_DOC_PATH AND GTAD_PATH) message( STATUS "Generating API stubs enabled" ) message( STATUS " Using GTAD at ${ABS_GTAD_PATH}" ) message( STATUS " Using API files at ${ABS_API_DEF_PATH}" ) + message( STATUS "Using libolm at ${Olm_Prefix}" ) endif () message( STATUS "=============================================================================" ) message( STATUS ) @@ -157,8 +167,9 @@ set_property(TARGET QMatrixClient APPEND PROPERTY target_include_directories(QMatrixClient PUBLIC $ $ + "${Olm_INCLUDE_DIRS}" ) -target_link_libraries(QMatrixClient Qt5::Core Qt5::Network Qt5::Gui Qt5::Multimedia) +target_link_libraries(QMatrixClient Qt5::Core Qt5::Network Qt5::Gui Qt5::Multimedia ${Olm_LIBRARIES}) add_executable(qmc-example ${example_SRCS}) target_link_libraries(qmc-example Qt5::Core QMatrixClient) -- cgit v1.2.3 From 1cf67730a0880a520ae04bdf4ef61592daa9fe06 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Tue, 26 Sep 2017 20:57:28 +0900 Subject: Introduce EncryptionEvent class This allows to detect if a room has been encrypted (no room state, just an event as of yet). Closes #84. --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 6718000c..92d8a969 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -113,6 +113,7 @@ set(libqmatrixclient_SRCS lib/events/callhangupevent.cpp lib/events/callinviteevent.cpp lib/events/directchatevent.cpp + lib/events/encryptionevent.cpp lib/jobs/requestdata.cpp lib/jobs/basejob.cpp lib/jobs/syncjob.cpp -- cgit v1.2.3 From 8ddf663ac60332cfa83f829b8d40596f9fe1c926 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 30 Jun 2019 14:13:14 +0900 Subject: CMakeLists.txt: add clang-format invocation to update-api target ...instead of using a separate update-format-api target. --- CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 874594e8..eafa95f1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -164,13 +164,11 @@ if (MATRIX_DOC_PATH AND GTAD_PATH) list(APPEND api_HDRS ${H}) endforeach() set(CLANG_FORMAT_ARGS -i -sort-includes -verbose) - add_custom_target(update-format-api + add_custom_command(TARGET update-api POST_BUILD COMMAND ${ABS_CLANG_FORMAT} ${CLANG_FORMAT_ARGS} ${api_SRCS} COMMAND ${ABS_CLANG_FORMAT} ${CLANG_FORMAT_ARGS} ${api_HDRS} - DEPENDS update-api WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} VERBATIM - SOURCES .clang-format ) endif() endif() -- cgit v1.2.3 From af623d68df8cec92277e9a40f18beac617b5d397 Mon Sep 17 00:00:00 2001 From: Alexey Andreyev Date: Fri, 24 May 2019 15:18:14 +0300 Subject: Add libQtOlm --- CMakeLists.txt | 39 +++++++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 6 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 92d8a969..6b6cd0f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,6 @@ if (NOT WIN32) endif(NOT WIN32) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) -include(cmake/FindOlm.cmake) # Find includes in corresponding build directories set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -53,8 +52,24 @@ endforeach () # upstream Qt 5.4 is required. find_package(Qt5 5.4.1 REQUIRED Network Gui Multimedia) get_filename_component(Qt5_Prefix "${Qt5_DIR}/../../../.." ABSOLUTE) -find_package(Olm REQUIRED) -get_filename_component(Olm_Prefix "${Olm_INCLUDE_DIRS}/.." ABSOLUTE) + +if ((NOT DEFINED USE_INTREE_LIBQOLM OR USE_INTREE_LIBQOLM) + AND EXISTS ${PROJECT_SOURCE_DIR}/lib/libQtOlm/lib/utils.h) + add_subdirectory(lib/libQtOlm EXCLUDE_FROM_ALL) + include_directories(lib/libQtOlm) + if (NOT DEFINED USE_INTREE_LIBQOLM) + set (USE_INTREE_LIBQOLM 1) + endif () +endif () +if (NOT USE_INTREE_LIBQOLM) + find_package(QtOlm 0.1.0 REQUIRED) + if (NOT QtOlm_FOUND) + message( WARNING "libQtOlm not found; configuration will most likely fail.") + message( WARNING "Make sure you have installed libQtOlm development files") + message( WARNING "as a package or checked out the library sources in lib/.") + message( WARNING "See also BUILDING.md") + endif () +endif () if (GTAD_PATH) get_filename_component(ABS_GTAD_PATH "${GTAD_PATH}" ABSOLUTE) @@ -78,7 +93,20 @@ if (MATRIX_DOC_PATH AND GTAD_PATH) message( STATUS "Generating API stubs enabled" ) message( STATUS " Using GTAD at ${ABS_GTAD_PATH}" ) message( STATUS " Using API files at ${ABS_API_DEF_PATH}" ) - message( STATUS "Using libolm at ${Olm_Prefix}" ) +endif () +find_package(Git) +if (USE_INTREE_LIBQOLM) + message( STATUS "Using in-tree libQtOlm") + if (GIT_FOUND) + execute_process(COMMAND + "${GIT_EXECUTABLE}" rev-parse -q HEAD + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib/libQtOlm/lib + OUTPUT_VARIABLE LIB_GIT_SHA1 + OUTPUT_STRIP_TRAILING_WHITESPACE) + message( STATUS " Library git SHA1: ${LIB_GIT_SHA1}") + endif (GIT_FOUND) +else () + message( STATUS "Using libQtOlm ${QtOlm_VERSION} at ${QtOlm_DIR}") endif () message( STATUS "=============================================================================" ) message( STATUS ) @@ -168,9 +196,8 @@ set_property(TARGET QMatrixClient APPEND PROPERTY target_include_directories(QMatrixClient PUBLIC $ $ - "${Olm_INCLUDE_DIRS}" ) -target_link_libraries(QMatrixClient Qt5::Core Qt5::Network Qt5::Gui Qt5::Multimedia ${Olm_LIBRARIES}) +target_link_libraries(QMatrixClient QtOlm Qt5::Core Qt5::Network Qt5::Gui Qt5::Multimedia) add_executable(qmc-example ${example_SRCS}) target_link_libraries(qmc-example Qt5::Core QMatrixClient) -- cgit v1.2.3 From 69ba71cca36b4a90328d169c845195f39c041a3a Mon Sep 17 00:00:00 2001 From: Alexey Andreyev Date: Sat, 22 Jun 2019 19:57:18 +0300 Subject: Add EncryptionManager class. Add AccountSettings::encryptionAccountPickle logic. --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b6cd0f3..d3906ffb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -125,6 +125,7 @@ set(libqmatrixclient_SRCS lib/networksettings.cpp lib/converters.cpp lib/util.cpp + lib/encryptionmanager.cpp lib/eventitem.cpp lib/events/event.cpp lib/events/roomevent.cpp -- cgit v1.2.3 From b5f9e1bd20f985c18ec630fa496510018547b728 Mon Sep 17 00:00:00 2001 From: Alexey Andreyev Date: Wed, 26 Jun 2019 16:36:45 +0300 Subject: Change libQtOlm location. Fix .travis.yml and .appveyor.yml --- CMakeLists.txt | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index d3906ffb..19fbdcbe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,11 +10,6 @@ if (NOT WIN32) include(GNUInstallDirs) endif(NOT WIN32) -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) - -# Find includes in corresponding build directories -set(CMAKE_INCLUDE_CURRENT_DIR ON) - # Instruct CMake to run moc automatically when needed. set(CMAKE_AUTOMOC ON) @@ -54,9 +49,9 @@ find_package(Qt5 5.4.1 REQUIRED Network Gui Multimedia) get_filename_component(Qt5_Prefix "${Qt5_DIR}/../../../.." ABSOLUTE) if ((NOT DEFINED USE_INTREE_LIBQOLM OR USE_INTREE_LIBQOLM) - AND EXISTS ${PROJECT_SOURCE_DIR}/lib/libQtOlm/lib/utils.h) - add_subdirectory(lib/libQtOlm EXCLUDE_FROM_ALL) - include_directories(lib/libQtOlm) + AND EXISTS ${PROJECT_SOURCE_DIR}/3rdparty/libQtOlm/lib/utils.h) + add_subdirectory(3rdparty/libQtOlm EXCLUDE_FROM_ALL) + include_directories(3rdparty/libQtOlm) if (NOT DEFINED USE_INTREE_LIBQOLM) set (USE_INTREE_LIBQOLM 1) endif () @@ -100,10 +95,10 @@ if (USE_INTREE_LIBQOLM) if (GIT_FOUND) execute_process(COMMAND "${GIT_EXECUTABLE}" rev-parse -q HEAD - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib/libQtOlm/lib - OUTPUT_VARIABLE LIB_GIT_SHA1 + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/3rdparty/libQtOlm + OUTPUT_VARIABLE QTOLM_GIT_SHA1 OUTPUT_STRIP_TRAILING_WHITESPACE) - message( STATUS " Library git SHA1: ${LIB_GIT_SHA1}") + message( STATUS " Library git SHA1: ${QTOLM_GIT_SHA1}") endif (GIT_FOUND) else () message( STATUS "Using libQtOlm ${QtOlm_VERSION} at ${QtOlm_DIR}") -- cgit v1.2.3 From 6c4e78e8a55eab681393faff888448c887bb7127 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Tue, 9 Jul 2019 12:32:48 +0900 Subject: CMakeLists.txt: fix things around clang-format, inherit CLANG_FORMAT_ARGS --- CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 13f6fcfb..a40d4385 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,7 +97,7 @@ if (ABS_API_DEF_PATH AND ABS_GTAD_PATH) if (ABS_CLANG_FORMAT) message( STATUS "clang-format is at ${ABS_CLANG_FORMAT}") else () - message( STATUS "${CLANG_FORMAT} is NOT FOUND; --target update-format-api disabled") + message( STATUS "${CLANG_FORMAT} is NOT FOUND; API files won't be reformatted") endif () endif () find_package(Git) @@ -192,18 +192,19 @@ if (MATRIX_DOC_PATH AND GTAD_PATH) ${API_DEFS} VERBATIM ) - if (CLANG_FORMAT) + if (ABS_CLANG_FORMAT) # TODO: list(TRANSFORM) is available from CMake 3.12 foreach (S ${api_SRCS}) string (REGEX REPLACE ".cpp$" ".h" H ${S}) list(APPEND api_HDRS ${H}) endforeach() - set(CLANG_FORMAT_ARGS -i -sort-includes -verbose) + set(CLANG_FORMAT_ARGS -i -sort-includes ${CLANG_FORMAT_ARGS}) add_custom_command(TARGET update-api POST_BUILD COMMAND ${ABS_CLANG_FORMAT} ${CLANG_FORMAT_ARGS} ${api_SRCS} COMMAND ${ABS_CLANG_FORMAT} ${CLANG_FORMAT_ARGS} ${api_HDRS} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} VERBATIM + COMMENT Formatting files ) endif() endif() -- cgit v1.2.3 From 2737dc00334ad3a56c1b311435dbe84453ee389e Mon Sep 17 00:00:00 2001 From: Alexey Andreyev Date: Sun, 14 Jul 2019 03:54:19 +0300 Subject: E2EE: introduce EncryptedEvent --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 19fbdcbe..75314a91 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -138,6 +138,7 @@ set(libqmatrixclient_SRCS lib/events/callinviteevent.cpp lib/events/directchatevent.cpp lib/events/encryptionevent.cpp + lib/events/encryptedevent.cpp lib/jobs/requestdata.cpp lib/jobs/basejob.cpp lib/jobs/syncjob.cpp -- cgit v1.2.3 From b89d5c43746ed672d98bf350db2a9e1b0878e2d0 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sat, 18 May 2019 13:52:54 +0900 Subject: Support for receiving m.reaction events * struct EventRelation; class ReactionEvent; Room::relatedEvents() * Reaction events are processed in both history and sync batches * Redacting a reaction removes it from the list of related events * QMCTest::sendReaction() --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 19fbdcbe..225c22d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -132,6 +132,7 @@ set(libqmatrixclient_SRCS lib/events/roommemberevent.cpp lib/events/typingevent.cpp lib/events/receiptevent.cpp + lib/events/reactionevent.cpp lib/events/callanswerevent.cpp lib/events/callcandidatesevent.cpp lib/events/callhangupevent.cpp -- cgit v1.2.3 From 7a5b359b8823646ce97cbaf05c251cb04c291466 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 7 Jul 2019 18:16:30 +0900 Subject: Rename zero-impact strings --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 996e76d4..44f4df9c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -81,7 +81,7 @@ endif() message( STATUS ) message( STATUS "=============================================================================" ) -message( STATUS " libqmatrixclient Build Information" ) +message( STATUS " libQuotient Build Information" ) message( STATUS "=============================================================================" ) message( STATUS "Version: ${PROJECT_VERSION}, API version: ${API_VERSION}") if (CMAKE_BUILD_TYPE) -- cgit v1.2.3 From a18cfa5877798e50e4222726fa63fcef5ee248bb Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Fri, 9 Aug 2019 10:16:26 +0900 Subject: Rename CMake/pkg-config related parts --- CMakeLists.txt | 63 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 32 insertions(+), 31 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 44f4df9c..e0ff6f19 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,9 @@ cmake_minimum_required(VERSION 3.5) set(API_VERSION "0.6") -project(qmatrixclient VERSION "${API_VERSION}.0" LANGUAGES CXX) +project(Quotient VERSION "${API_VERSION}.0" LANGUAGES CXX) -option(QMATRIXCLIENT_INSTALL_EXAMPLE "install qmc-example application" ON) +option(QUOTIENT_INSTALL_EXAMPLE "install qmc-example application" ON) include(CheckCXXCompilerFlag) if (NOT WIN32) @@ -81,7 +81,7 @@ endif() message( STATUS ) message( STATUS "=============================================================================" ) -message( STATUS " libQuotient Build Information" ) +message( STATUS " ${PROJECT_NAME} Build Information" ) message( STATUS "=============================================================================" ) message( STATUS "Version: ${PROJECT_VERSION}, API version: ${API_VERSION}") if (CMAKE_BUILD_TYPE) @@ -118,7 +118,7 @@ message( STATUS "=============================================================== message( STATUS ) # Set up source files -set(libqmatrixclient_SRCS +set(lib_SRCS lib/networkaccessmanager.cpp lib/connectiondata.cpp lib/connection.cpp @@ -213,27 +213,27 @@ endif() set(example_SRCS examples/qmc-example.cpp) -add_library(QMatrixClient ${libqmatrixclient_SRCS} ${api_SRCS}) -set_property(TARGET QMatrixClient PROPERTY VERSION "${PROJECT_VERSION}") -set_property(TARGET QMatrixClient PROPERTY SOVERSION ${API_VERSION} ) -set_property(TARGET QMatrixClient PROPERTY - INTERFACE_QMatrixClient_MAJOR_VERSION ${API_VERSION}) -set_property(TARGET QMatrixClient APPEND PROPERTY - COMPATIBLE_INTERFACE_STRING QMatrixClient_MAJOR_VERSION) +add_library(${PROJECT_NAME} ${lib_SRCS} ${api_SRCS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY VERSION "${PROJECT_VERSION}") +set_property(TARGET ${PROJECT_NAME} PROPERTY SOVERSION ${API_VERSION} ) +set_property(TARGET ${PROJECT_NAME} PROPERTY + INTERFACE_${PROJECT_NAME}_MAJOR_VERSION ${API_VERSION}) +set_property(TARGET ${PROJECT_NAME} APPEND PROPERTY + COMPATIBLE_INTERFACE_STRING ${PROJECT_NAME}_MAJOR_VERSION) -target_include_directories(QMatrixClient PUBLIC +target_include_directories(${PROJECT_NAME} PUBLIC $ $ ) -target_link_libraries(QMatrixClient QtOlm Qt5::Core Qt5::Network Qt5::Gui Qt5::Multimedia) +target_link_libraries(${PROJECT_NAME} QtOlm Qt5::Core Qt5::Network Qt5::Gui Qt5::Multimedia) add_executable(qmc-example ${example_SRCS}) -target_link_libraries(qmc-example Qt5::Core QMatrixClient) -configure_file(QMatrixClient.pc.in ${CMAKE_CURRENT_BINARY_DIR}/QMatrixClient.pc @ONLY NEWLINE_STYLE UNIX) +target_link_libraries(qmc-example Qt5::Core Quotient) +configure_file(Quotient.pc.in ${CMAKE_CURRENT_BINARY_DIR}/Quotient.pc @ONLY NEWLINE_STYLE UNIX) # Installation -install(TARGETS QMatrixClient EXPORT QMatrixClientTargets +install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}Targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} @@ -245,37 +245,38 @@ include(CMakePackageConfigHelpers) # NB: SameMajorVersion doesn't really work yet, as we're within 0.x trail. # Maybe consider jumping the gun and releasing 1.0, as semver advises? write_basic_package_version_file( - "${CMAKE_CURRENT_BINARY_DIR}/QMatrixClient/QMatrixClientConfigVersion.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/QuotientConfigVersion.cmake" COMPATIBILITY SameMajorVersion ) -export(PACKAGE QMatrixClient) -export(EXPORT QMatrixClientTargets - FILE "${CMAKE_CURRENT_BINARY_DIR}/QMatrixClient/QMatrixClientTargets.cmake") -configure_file(cmake/QMatrixClientConfig.cmake - "${CMAKE_CURRENT_BINARY_DIR}/QMatrixClient/QMatrixClientConfig.cmake" +export(PACKAGE ${PROJECT_NAME}) +export(EXPORT ${PROJECT_NAME}Targets + FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}Targets.cmake") +configure_file(cmake/QuotientConfig.cmake + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/QuotientConfig.cmake" COPYONLY ) -set(ConfigFilesLocation "${CMAKE_INSTALL_LIBDIR}/cmake/QMatrixClient") -install(EXPORT QMatrixClientTargets - FILE QMatrixClientTargets.cmake DESTINATION ${ConfigFilesLocation}) +set(ConfigFilesLocation "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}") +install(EXPORT ${PROJECT_NAME}Targets + FILE ${PROJECT_NAME}Targets.cmake DESTINATION ${ConfigFilesLocation}) -install(FILES cmake/QMatrixClientConfig.cmake - "${CMAKE_CURRENT_BINARY_DIR}/QMatrixClient/QMatrixClientConfigVersion.cmake" +install(FILES cmake/QuotientConfig.cmake + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/QuotientConfigVersion.cmake" DESTINATION ${ConfigFilesLocation} ) # Only available from CMake 3.7; reserved for future use -#install(EXPORT_ANDROID_MK QMatrixClientTargets DESTINATION share/ndk-modules) +#install(EXPORT_ANDROID_MK QuotientTargets DESTINATION share/ndk-modules) if (WIN32) install(FILES mime/packages/freedesktop.org.xml DESTINATION mime/packages) endif (WIN32) -if (QMATRIXCLIENT_INSTALL_EXAMPLE) +if (QUOTIENT_INSTALL_EXAMPLE) install(TARGETS qmc-example RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif (QMATRIXCLIENT_INSTALL_EXAMPLE) +endif (QUOTIENT_INSTALL_EXAMPLE) if (UNIX AND NOT APPLE) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QMatrixClient.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Quotient.pc + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) endif() -- cgit v1.2.3 From 0ecc5d4992ad2086ee9e399a23f233b653b74ee3 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 11 Aug 2019 13:17:31 +0900 Subject: Officially bump requirements: CMake 3.10, C++17, Qt 5.9 --- CMakeLists.txt | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index e0ff6f19..d0ce98a6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.10) set(API_VERSION "0.6") project(Quotient VERSION "${API_VERSION}.0" LANGUAGES CXX) @@ -34,7 +34,7 @@ if (NOT CMAKE_INSTALL_INCLUDEDIR) set(CMAKE_INSTALL_INCLUDEDIR "include") endif() -set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD 17) foreach (FLAG all "" pedantic extra error=return-type no-unused-parameter no-gnu-zero-variadic-macro-arguments) CHECK_CXX_COMPILER_FLAG("-W${FLAG}" WARN_${FLAG}_SUPPORTED) @@ -43,9 +43,7 @@ foreach (FLAG all "" pedantic extra error=return-type no-unused-parameter no-gnu endif () endforeach () -# Qt 5.6+ is the formal requirement but for the sake of supporting UBPorts -# upstream Qt 5.4 is required. -find_package(Qt5 5.4.1 REQUIRED Network Gui Multimedia) +find_package(Qt5 5.9 REQUIRED Network Gui Multimedia) get_filename_component(Qt5_Prefix "${Qt5_DIR}/../../../.." ABSOLUTE) if ((NOT DEFINED USE_INTREE_LIBQOLM OR USE_INTREE_LIBQOLM) @@ -265,8 +263,7 @@ install(FILES cmake/QuotientConfig.cmake "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/QuotientConfigVersion.cmake" DESTINATION ${ConfigFilesLocation} ) -# Only available from CMake 3.7; reserved for future use -#install(EXPORT_ANDROID_MK QuotientTargets DESTINATION share/ndk-modules) +install(EXPORT_ANDROID_MK QuotientTargets DESTINATION share/ndk-modules) if (WIN32) install(FILES mime/packages/freedesktop.org.xml DESTINATION mime/packages) -- cgit v1.2.3 From 35d9c4dd6743d706ed9382c021923ef790e7c446 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 11 Aug 2019 15:47:10 +0900 Subject: Configure MSVC warnings in CMakeLists.txt; build in AppVeyor with Qt 5.13 --- CMakeLists.txt | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index d0ce98a6..d90b2d88 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,12 +36,16 @@ endif() set(CMAKE_CXX_STANDARD 17) -foreach (FLAG all "" pedantic extra error=return-type no-unused-parameter no-gnu-zero-variadic-macro-arguments) - CHECK_CXX_COMPILER_FLAG("-W${FLAG}" WARN_${FLAG}_SUPPORTED) - if ( WARN_${FLAG}_SUPPORTED AND NOT CMAKE_CXX_FLAGS MATCHES "(^| )-W?${FLAG}($| )") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W${FLAG}") - endif () -endforeach () +if (MSVC) + add_compile_options(/EHsc /W4) +else() + foreach (FLAG all "" pedantic extra error=return-type no-unused-parameter no-gnu-zero-variadic-macro-arguments) + CHECK_CXX_COMPILER_FLAG("-W${FLAG}" WARN_${FLAG}_SUPPORTED) + if ( WARN_${FLAG}_SUPPORTED AND NOT CMAKE_CXX_FLAGS MATCHES "(^| )-W?${FLAG}($| )") + add_compile_options(-W${FLAG}) + endif () + endforeach () +endif() find_package(Qt5 5.9 REQUIRED Network Gui Multimedia) get_filename_component(Qt5_Prefix "${Qt5_DIR}/../../../.." ABSOLUTE) -- cgit v1.2.3 From 0f10255cf20df9415cbafa71b1d131af713f4b82 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 11 Aug 2019 16:05:48 +0900 Subject: CMakeLists.txt: suppress some MSVC warnings --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index d90b2d88..da38bc78 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,7 +37,9 @@ endif() set(CMAKE_CXX_STANDARD 17) if (MSVC) - add_compile_options(/EHsc /W4) + add_compile_options(/EHsc /W4 + /Wd4100 /Wd4242 /Wd4245 /Wd4267 /Wd4365 /Wd4571 /Wd4625 /Wd4626 /Wd4820 + /Wd5026 /Wd5027) else() foreach (FLAG all "" pedantic extra error=return-type no-unused-parameter no-gnu-zero-variadic-macro-arguments) CHECK_CXX_COMPILER_FLAG("-W${FLAG}" WARN_${FLAG}_SUPPORTED) -- cgit v1.2.3 From 56a180e1f99ab8f0c5c2e5fb0d3ea326e5838888 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 11 Aug 2019 16:08:27 +0900 Subject: CMakeLists.txt: fixed typos --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index da38bc78..aba46a8b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,8 +38,8 @@ set(CMAKE_CXX_STANDARD 17) if (MSVC) add_compile_options(/EHsc /W4 - /Wd4100 /Wd4242 /Wd4245 /Wd4267 /Wd4365 /Wd4571 /Wd4625 /Wd4626 /Wd4820 - /Wd5026 /Wd5027) + /wd4100 /wd4242 /wd4245 /wd4267 /wd4365 /wd4571 /wd4625 /wd4626 /wd4820 + /wd5026 /wd5027) else() foreach (FLAG all "" pedantic extra error=return-type no-unused-parameter no-gnu-zero-variadic-macro-arguments) CHECK_CXX_COMPILER_FLAG("-W${FLAG}" WARN_${FLAG}_SUPPORTED) -- cgit v1.2.3 From f2e958b4becb9021546d0355026fefce8557c7b6 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 11 Aug 2019 16:12:20 +0900 Subject: CMakeLists.txt: suppress more MSVC warnings --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index aba46a8b..8627d177 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,8 +38,8 @@ set(CMAKE_CXX_STANDARD 17) if (MSVC) add_compile_options(/EHsc /W4 - /wd4100 /wd4242 /wd4245 /wd4267 /wd4365 /wd4571 /wd4625 /wd4626 /wd4820 - /wd5026 /wd5027) + /wd4100 /wd4242 /wd4244 /wd4245 /wd4267 /wd4365 /wd4514 /wd4571 /wd4625 + /wd4626 /wd4774 /wd4820 /wd5026 /wd5027) else() foreach (FLAG all "" pedantic extra error=return-type no-unused-parameter no-gnu-zero-variadic-macro-arguments) CHECK_CXX_COMPILER_FLAG("-W${FLAG}" WARN_${FLAG}_SUPPORTED) -- cgit v1.2.3 From a3223e749d6f6c72b7c0ef638a1314d8bc77bc06 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 11 Aug 2019 16:41:23 +0900 Subject: CMakeLists.txt: more MSVC warning suppresions --- CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 8627d177..f9bdef64 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,8 +38,9 @@ set(CMAKE_CXX_STANDARD 17) if (MSVC) add_compile_options(/EHsc /W4 - /wd4100 /wd4242 /wd4244 /wd4245 /wd4267 /wd4365 /wd4514 /wd4571 /wd4625 - /wd4626 /wd4774 /wd4820 /wd5026 /wd5027) + /wd4100 /wd4127 /wd4242 /wd4244 /wd4245 /wd4267 /wd4365 /wd4459 /wd4514 + /wd4571 /wd4619 /wd4623 /wd4625 /wd4626 /wd4710 /wd4774 /wd4820 /wd4946 + /wd5026 /wd5027) else() foreach (FLAG all "" pedantic extra error=return-type no-unused-parameter no-gnu-zero-variadic-macro-arguments) CHECK_CXX_COMPILER_FLAG("-W${FLAG}" WARN_${FLAG}_SUPPORTED) -- cgit v1.2.3 From 1803e79038a8f8ab966c40572c039b10bf51072e Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 11 Aug 2019 17:02:25 +0900 Subject: More MSVC suppresions; switch to C++17 in qmake as well --- CMakeLists.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index f9bdef64..dee30bc2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,11 +38,12 @@ set(CMAKE_CXX_STANDARD 17) if (MSVC) add_compile_options(/EHsc /W4 - /wd4100 /wd4127 /wd4242 /wd4244 /wd4245 /wd4267 /wd4365 /wd4459 /wd4514 - /wd4571 /wd4619 /wd4623 /wd4625 /wd4626 /wd4710 /wd4774 /wd4820 /wd4946 - /wd5026 /wd5027) + /wd4100 /wd4127 /wd4242 /wd4244 /wd4245 /wd4267 /wd4365 /wd4456 /wd4459 + /wd4464 /wd4505 /wd4514 /wd4571 /wd4619 /wd4623 /wd4625 /wd4626 /wd4706 + /wd4710 /wd4774 /wd4820 /wd4946 /wd5026 /wd5027) else() - foreach (FLAG all "" pedantic extra error=return-type no-unused-parameter no-gnu-zero-variadic-macro-arguments) + foreach (FLAG all "" pedantic extra error=return-type no-unused-parameter + no-gnu-zero-variadic-macro-arguments) CHECK_CXX_COMPILER_FLAG("-W${FLAG}" WARN_${FLAG}_SUPPORTED) if ( WARN_${FLAG}_SUPPORTED AND NOT CMAKE_CXX_FLAGS MATCHES "(^| )-W?${FLAG}($| )") add_compile_options(-W${FLAG}) -- cgit v1.2.3 From 9758dfad6d08edf7ae67b38ad59651e33b7e6465 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 11 Aug 2019 18:13:41 +0900 Subject: CMakeLists.txt: tell CMake to not add /W3 flag for MSVC ...because /W4 is explicitly added instead. --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index dee30bc2..1bc49868 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,7 @@ cmake_minimum_required(VERSION 3.10) +if (POLICY CMP0092) +cmake_policy(SET CMP0092 NEW) +endif() set(API_VERSION "0.6") project(Quotient VERSION "${API_VERSION}.0" LANGUAGES CXX) -- cgit v1.2.3 From 473686bf953aa8726c7b747935d260be5d9f8ba1 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Wed, 11 Sep 2019 18:39:13 +0900 Subject: CMakeLists.txt: use set_target_properties(); specify C++ std per-target --- CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 1bc49868..951ef8c9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,8 +37,6 @@ if (NOT CMAKE_INSTALL_INCLUDEDIR) set(CMAKE_INSTALL_INCLUDEDIR "include") endif() -set(CMAKE_CXX_STANDARD 17) - if (MSVC) add_compile_options(/EHsc /W4 /wd4100 /wd4127 /wd4242 /wd4244 /wd4245 /wd4267 /wd4365 /wd4456 /wd4459 @@ -223,10 +221,12 @@ endif() set(example_SRCS examples/qmc-example.cpp) add_library(${PROJECT_NAME} ${lib_SRCS} ${api_SRCS}) -set_property(TARGET ${PROJECT_NAME} PROPERTY VERSION "${PROJECT_VERSION}") -set_property(TARGET ${PROJECT_NAME} PROPERTY SOVERSION ${API_VERSION} ) -set_property(TARGET ${PROJECT_NAME} PROPERTY - INTERFACE_${PROJECT_NAME}_MAJOR_VERSION ${API_VERSION}) +set_target_properties(${PROJECT_NAME} PROPERTIES + VERSION "${PROJECT_VERSION}" + SOVERSION ${API_VERSION} + INTERFACE_${PROJECT_NAME}_MAJOR_VERSION ${API_VERSION} + CXX_STANDARD 17 +) set_property(TARGET ${PROJECT_NAME} APPEND PROPERTY COMPATIBLE_INTERFACE_STRING ${PROJECT_NAME}_MAJOR_VERSION) -- cgit v1.2.3 From d0a0f8cda88d644ca38b2b90024303fbe362602c Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Mon, 30 Sep 2019 08:11:24 +0900 Subject: Move C++ standard requirement to target_compile_features ...so that users of the library wouldn't need to redefine that they need C++17. --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 951ef8c9..ce4af9a8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -225,11 +225,12 @@ set_target_properties(${PROJECT_NAME} PROPERTIES VERSION "${PROJECT_VERSION}" SOVERSION ${API_VERSION} INTERFACE_${PROJECT_NAME}_MAJOR_VERSION ${API_VERSION} - CXX_STANDARD 17 ) set_property(TARGET ${PROJECT_NAME} APPEND PROPERTY COMPATIBLE_INTERFACE_STRING ${PROJECT_NAME}_MAJOR_VERSION) +target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) + target_include_directories(${PROJECT_NAME} PUBLIC $ $ -- cgit v1.2.3 From d59ca7ac194e8d57177afb1ac89603e22b61b4ec Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Thu, 3 Oct 2019 08:16:29 +0900 Subject: qmc-example -> quotest, QMCTest -> TestManager Also: some bits of refactoring in the test code to make it more extensible. Closes #352. --- CMakeLists.txt | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index ce4af9a8..58509eae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ endif() set(API_VERSION "0.6") project(Quotient VERSION "${API_VERSION}.0" LANGUAGES CXX) -option(QUOTIENT_INSTALL_EXAMPLE "install qmc-example application" ON) +option(${PROJECT_NAME}_INSTALL_TESTS "install quotest (former qmc-example) application" ON) include(CheckCXXCompilerFlag) if (NOT WIN32) @@ -52,7 +52,7 @@ else() endforeach () endif() -find_package(Qt5 5.9 REQUIRED Network Gui Multimedia) +find_package(Qt5 5.9 REQUIRED Network Gui Multimedia Test) get_filename_component(Qt5_Prefix "${Qt5_DIR}/../../../.." ABSOLUTE) if ((NOT DEFINED USE_INTREE_LIBQOLM OR USE_INTREE_LIBQOLM) @@ -218,7 +218,7 @@ if (MATRIX_DOC_PATH AND GTAD_PATH) endif() endif() -set(example_SRCS examples/qmc-example.cpp) +set(tests_SRCS tests/quotest.cpp) add_library(${PROJECT_NAME} ${lib_SRCS} ${api_SRCS}) set_target_properties(${PROJECT_NAME} PROPERTIES @@ -237,8 +237,10 @@ target_include_directories(${PROJECT_NAME} PUBLIC ) target_link_libraries(${PROJECT_NAME} QtOlm Qt5::Core Qt5::Network Qt5::Gui Qt5::Multimedia) -add_executable(qmc-example ${example_SRCS}) -target_link_libraries(qmc-example Qt5::Core Quotient) +set(TEST_BINARY quotest) +add_executable(${TEST_BINARY} ${tests_SRCS}) +target_link_libraries(${TEST_BINARY} Qt5::Core Qt5::Test Quotient) + configure_file(Quotient.pc.in ${CMAKE_CURRENT_BINARY_DIR}/Quotient.pc @ONLY NEWLINE_STYLE UNIX) # Installation @@ -281,9 +283,9 @@ if (WIN32) install(FILES mime/packages/freedesktop.org.xml DESTINATION mime/packages) endif (WIN32) -if (QUOTIENT_INSTALL_EXAMPLE) - install(TARGETS qmc-example RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif (QUOTIENT_INSTALL_EXAMPLE) +if (QUOTIENT_INSTALL_TESTS) + install(TARGETS ${TEST_BINARY} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +endif () if (UNIX AND NOT APPLE) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Quotient.pc -- cgit v1.2.3 From 60bb1cf942ad0815dcf42cbfe8acd1e076d848cf Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Tue, 29 Oct 2019 22:04:40 +0900 Subject: Derive Omittable<> from std::optional<> That breaks API all over the place but: 1. The fixes are trivial. 2. More of std:: is used instead of home-baking the same stuff. --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 58509eae..11d7d194 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -193,6 +193,7 @@ if (MATRIX_DOC_PATH AND GTAD_PATH) ${ABS_GTAD_PATH} --config ${CSAPI_DIR}/gtad.yaml --out ${CSAPI_DIR} ${FULL_CSAPI_SRC_DIR} old_sync.yaml- room_initial_sync.yaml- # deprecated + search.yaml- # current GTAD is limited in handling move-only data sync.yaml- # we have a better handcrafted implementation WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/lib SOURCES ${FULL_CSAPI_DIR}/gtad.yaml -- cgit v1.2.3 From e0c01b6fee5027211bd44a39860e40a2b7b226ad Mon Sep 17 00:00:00 2001 From: Black Hat Date: Sun, 29 Dec 2019 21:29:16 +0800 Subject: Add RoomPowerLevelEvent type --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index ce4af9a8..f4720f25 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -148,6 +148,7 @@ set(lib_SRCS lib/events/roomtombstoneevent.cpp lib/events/roommessageevent.cpp lib/events/roommemberevent.cpp + lib/events/roompowerlevelsevent.cpp lib/events/typingevent.cpp lib/events/receiptevent.cpp lib/events/reactionevent.cpp -- cgit v1.2.3 From 17c89693811a4aa27db700d8f9f278393c8e0926 Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Tue, 18 Feb 2020 20:41:22 +0300 Subject: [quotest] Refactor Cmake files with variable project name Signed-off-by: Alexey Andreev --- CMakeLists.txt | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 9a17e1f9..9fbf3a9b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -241,9 +241,9 @@ target_link_libraries(${PROJECT_NAME} QtOlm Qt5::Core Qt5::Network Qt5::Gui Qt5: set(TEST_BINARY quotest) add_executable(${TEST_BINARY} ${tests_SRCS}) -target_link_libraries(${TEST_BINARY} Qt5::Core Qt5::Test Quotient) +target_link_libraries(${TEST_BINARY} Qt5::Core Qt5::Test ${PROJECT_NAME}) -configure_file(Quotient.pc.in ${CMAKE_CURRENT_BINARY_DIR}/Quotient.pc @ONLY NEWLINE_STYLE UNIX) +configure_file(${PROJECT_NAME}.pc.in ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc @ONLY NEWLINE_STYLE UNIX) # Installation @@ -259,15 +259,15 @@ include(CMakePackageConfigHelpers) # NB: SameMajorVersion doesn't really work yet, as we're within 0.x trail. # Maybe consider jumping the gun and releasing 1.0, as semver advises? write_basic_package_version_file( - "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/QuotientConfigVersion.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}ConfigVersion.cmake" COMPATIBILITY SameMajorVersion ) export(PACKAGE ${PROJECT_NAME}) export(EXPORT ${PROJECT_NAME}Targets FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}Targets.cmake") -configure_file(cmake/QuotientConfig.cmake - "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/QuotientConfig.cmake" +configure_file(cmake/${PROJECT_NAME}Config.cmake + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}Config.cmake" COPYONLY ) @@ -275,21 +275,21 @@ set(ConfigFilesLocation "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}") install(EXPORT ${PROJECT_NAME}Targets FILE ${PROJECT_NAME}Targets.cmake DESTINATION ${ConfigFilesLocation}) -install(FILES cmake/QuotientConfig.cmake - "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/QuotientConfigVersion.cmake" +install(FILES cmake/${PROJECT_NAME}Config.cmake + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}ConfigVersion.cmake" DESTINATION ${ConfigFilesLocation} ) -install(EXPORT_ANDROID_MK QuotientTargets DESTINATION share/ndk-modules) +install(EXPORT_ANDROID_MK ${PROJECT_NAME}Targets DESTINATION share/ndk-modules) if (WIN32) install(FILES mime/packages/freedesktop.org.xml DESTINATION mime/packages) endif (WIN32) -if (QUOTIENT_INSTALL_TESTS) +if (${PROJECT_NAME}_INSTALL_TESTS) install(TARGETS ${TEST_BINARY} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif () if (UNIX AND NOT APPLE) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Quotient.pc + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) endif() -- cgit v1.2.3 From 60c0f079f0366e501de6658b5fb56ec905da0c31 Mon Sep 17 00:00:00 2001 From: Alexey Andreyev Date: Fri, 23 Aug 2019 13:23:42 +0300 Subject: E2EE: introduce RoomKeyEvent Signed-off-by: Alexey Andreev --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 9fbf3a9b..9fc1ee6c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -159,6 +159,7 @@ set(lib_SRCS lib/events/directchatevent.cpp lib/events/encryptionevent.cpp lib/events/encryptedevent.cpp + lib/events/roomkeyevent.cpp lib/jobs/requestdata.cpp lib/jobs/basejob.cpp lib/jobs/syncjob.cpp -- cgit v1.2.3 From 56d9a0addaabf2cec78e1c82a9846997a3669736 Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Tue, 25 Feb 2020 20:06:19 +0300 Subject: E2EE: Make building E2EE optional. Contributes to #369 Signed-off-by: Alexey Andreev --- CMakeLists.txt | 68 +++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 41 insertions(+), 27 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 9fc1ee6c..26394c9d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,8 @@ set(API_VERSION "0.6") project(Quotient VERSION "${API_VERSION}.0" LANGUAGES CXX) option(${PROJECT_NAME}_INSTALL_TESTS "install quotest (former qmc-example) application" ON) +# https://github.com/quotient-im/libQuotient/issues/369 +option(${PROJECT_NAME}_ENABLE_E2EE "end-to-end encryption (E2EE) support" OFF) include(CheckCXXCompilerFlag) if (NOT WIN32) @@ -55,22 +57,26 @@ endif() find_package(Qt5 5.9 REQUIRED Network Gui Multimedia Test) get_filename_component(Qt5_Prefix "${Qt5_DIR}/../../../.." ABSOLUTE) -if ((NOT DEFINED USE_INTREE_LIBQOLM OR USE_INTREE_LIBQOLM) - AND EXISTS ${PROJECT_SOURCE_DIR}/3rdparty/libQtOlm/lib/utils.h) - add_subdirectory(3rdparty/libQtOlm EXCLUDE_FROM_ALL) - include_directories(3rdparty/libQtOlm) - if (NOT DEFINED USE_INTREE_LIBQOLM) - set (USE_INTREE_LIBQOLM 1) +if (${PROJECT_NAME}_ENABLE_E2EE) + if ((NOT DEFINED USE_INTREE_LIBQOLM OR USE_INTREE_LIBQOLM) + AND EXISTS ${PROJECT_SOURCE_DIR}/3rdparty/libQtOlm/lib/utils.h) + add_subdirectory(3rdparty/libQtOlm EXCLUDE_FROM_ALL) + include_directories(3rdparty/libQtOlm) + if (NOT DEFINED USE_INTREE_LIBQOLM) + set (USE_INTREE_LIBQOLM 1) + endif () endif () -endif () -if (NOT USE_INTREE_LIBQOLM) - find_package(QtOlm 0.1.0 REQUIRED) - if (NOT QtOlm_FOUND) - message( WARNING "libQtOlm not found; configuration will most likely fail.") - message( WARNING "Make sure you have installed libQtOlm development files") - message( WARNING "as a package or checked out the library sources in lib/.") - message( WARNING "See also BUILDING.md") + if (NOT USE_INTREE_LIBQOLM) + find_package(QtOlm 0.1.0 REQUIRED) + if (NOT QtOlm_FOUND) + message( WARNING "libQtOlm not found; configuration will most likely fail.") + message( WARNING "Make sure you have installed libQtOlm development files") + message( WARNING "as a package or checked out the library sources in lib/.") + message( WARNING "See also BUILDING.md") + endif () endif () +else () + message( WARNING "End-to-end encryption (E2EE) support is turned off.") endif () if (GTAD_PATH) @@ -108,18 +114,20 @@ if (ABS_API_DEF_PATH AND ABS_GTAD_PATH) endif () endif () find_package(Git) -if (USE_INTREE_LIBQOLM) - message( STATUS "Using in-tree libQtOlm") - if (GIT_FOUND) - execute_process(COMMAND - "${GIT_EXECUTABLE}" rev-parse -q HEAD - WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/3rdparty/libQtOlm - OUTPUT_VARIABLE QTOLM_GIT_SHA1 - OUTPUT_STRIP_TRAILING_WHITESPACE) - message( STATUS " Library git SHA1: ${QTOLM_GIT_SHA1}") - endif (GIT_FOUND) -else () - message( STATUS "Using libQtOlm ${QtOlm_VERSION} at ${QtOlm_DIR}") +if (${PROJECT_NAME}_ENABLE_E2EE) + if (USE_INTREE_LIBQOLM) + message( STATUS "Using in-tree libQtOlm") + if (GIT_FOUND) + execute_process(COMMAND + "${GIT_EXECUTABLE}" rev-parse -q HEAD + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/3rdparty/libQtOlm + OUTPUT_VARIABLE QTOLM_GIT_SHA1 + OUTPUT_STRIP_TRAILING_WHITESPACE) + message( STATUS " Library git SHA1: ${QTOLM_GIT_SHA1}") + endif (GIT_FOUND) + else () + message( STATUS "Using libQtOlm ${QtOlm_VERSION} at ${QtOlm_DIR}") + endif () endif () message( STATUS "=============================================================================" ) message( STATUS ) @@ -224,6 +232,9 @@ endif() set(tests_SRCS tests/quotest.cpp) add_library(${PROJECT_NAME} ${lib_SRCS} ${api_SRCS}) +if (${PROJECT_NAME}_ENABLE_E2EE) + target_compile_definitions(${PROJECT_NAME} PUBLIC ${PROJECT_NAME}_E2EE_ENABLED) +endif() set_target_properties(${PROJECT_NAME} PROPERTIES VERSION "${PROJECT_VERSION}" SOVERSION ${API_VERSION} @@ -238,7 +249,10 @@ target_include_directories(${PROJECT_NAME} PUBLIC $ $ ) -target_link_libraries(${PROJECT_NAME} QtOlm Qt5::Core Qt5::Network Qt5::Gui Qt5::Multimedia) +if (${PROJECT_NAME}_ENABLE_E2EE) + target_link_libraries(${PROJECT_NAME} QtOlm) +endif() +target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Network Qt5::Gui Qt5::Multimedia) set(TEST_BINARY quotest) add_executable(${TEST_BINARY} ${tests_SRCS}) -- cgit v1.2.3 From ab3d0263b770e30de673c63740a5c26bcbf33e58 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Wed, 18 Mar 2020 09:51:27 +0100 Subject: SsoSession and Connection::prepareForSso() The response in the web browser is quite barebone, just enough to give feedback that things are alright. Closes #386. Closes #388. --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 26394c9d..9975af91 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -137,6 +137,7 @@ set(lib_SRCS lib/networkaccessmanager.cpp lib/connectiondata.cpp lib/connection.cpp + lib/ssosession.cpp lib/logging.cpp lib/room.cpp lib/user.cpp -- cgit v1.2.3 From 72e12a84cefa86758153ad20f6c8da63e1829ba4 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sat, 28 Mar 2020 16:08:27 +0100 Subject: CMakeLists.txt: don't EXCLUDE_FROM_ALL if QtOlm is in-tree --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 9975af91..5d33f2ba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,7 +60,7 @@ get_filename_component(Qt5_Prefix "${Qt5_DIR}/../../../.." ABSOLUTE) if (${PROJECT_NAME}_ENABLE_E2EE) if ((NOT DEFINED USE_INTREE_LIBQOLM OR USE_INTREE_LIBQOLM) AND EXISTS ${PROJECT_SOURCE_DIR}/3rdparty/libQtOlm/lib/utils.h) - add_subdirectory(3rdparty/libQtOlm EXCLUDE_FROM_ALL) + add_subdirectory(3rdparty/libQtOlm) include_directories(3rdparty/libQtOlm) if (NOT DEFINED USE_INTREE_LIBQOLM) set (USE_INTREE_LIBQOLM 1) -- cgit v1.2.3 From 51a85fa0e8814dfe47bb5174fa09a0e216d17d19 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 29 Mar 2020 10:49:53 +0200 Subject: Fix building tests with installed Quotient in E2EE configuration --- CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 5d33f2ba..46ce64c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -252,6 +252,7 @@ target_include_directories(${PROJECT_NAME} PUBLIC ) if (${PROJECT_NAME}_ENABLE_E2EE) target_link_libraries(${PROJECT_NAME} QtOlm) + set(FIND_DEPS "find_dependency(QtOlm)") # For QuotientConfig.cmake.in endif() target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Network Qt5::Gui Qt5::Multimedia) @@ -282,16 +283,17 @@ write_basic_package_version_file( export(PACKAGE ${PROJECT_NAME}) export(EXPORT ${PROJECT_NAME}Targets FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}Targets.cmake") -configure_file(cmake/${PROJECT_NAME}Config.cmake +configure_file(cmake/${PROJECT_NAME}Config.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}Config.cmake" - COPYONLY + @ONLY ) set(ConfigFilesLocation "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}") install(EXPORT ${PROJECT_NAME}Targets FILE ${PROJECT_NAME}Targets.cmake DESTINATION ${ConfigFilesLocation}) -install(FILES cmake/${PROJECT_NAME}Config.cmake +install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}Config.cmake" "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}ConfigVersion.cmake" DESTINATION ${ConfigFilesLocation} ) -- cgit v1.2.3 From ab9996fc62767d61da779d869e68bfc966ffce8f Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Mon, 6 Apr 2020 20:53:26 +0200 Subject: CMakeLists: install header files to a subdirectory This is a Quotient part of #328 fix; QtOlm part is pending. --- CMakeLists.txt | 43 +++++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 18 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 46ce64c5..6fac4672 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,9 +11,25 @@ option(${PROJECT_NAME}_INSTALL_TESTS "install quotest (former qmc-example) appli option(${PROJECT_NAME}_ENABLE_E2EE "end-to-end encryption (E2EE) support" OFF) include(CheckCXXCompilerFlag) -if (NOT WIN32) +if (WIN32) + if (NOT CMAKE_INSTALL_LIBDIR) + set(CMAKE_INSTALL_LIBDIR ".") + endif () + + if (NOT CMAKE_INSTALL_BINDIR) + set(CMAKE_INSTALL_BINDIR ".") + endif () + + if (NOT CMAKE_INSTALL_INCLUDEDIR) + set(CMAKE_INSTALL_INCLUDEDIR "include") + endif () +else() include(GNUInstallDirs) -endif(NOT WIN32) + set(INCLUDEDIR_INIT ${PROJECT_NAME}) +endif(WIN32) +set(${PROJECT_NAME}_INSTALL_INCLUDEDIR + "${CMAKE_INSTALL_INCLUDEDIR}/${INCLUDEDIR_INIT}" CACHE PATH + "directory to install ${PROJECT_NAME} include files to") # Instruct CMake to run moc automatically when needed. set(CMAKE_AUTOMOC ON) @@ -27,18 +43,6 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) "MinSizeRel" "RelWithDebInfo") endif() -if (NOT CMAKE_INSTALL_LIBDIR) - set(CMAKE_INSTALL_LIBDIR ".") -endif() - -if (NOT CMAKE_INSTALL_BINDIR) - set(CMAKE_INSTALL_BINDIR ".") -endif() - -if (NOT CMAKE_INSTALL_INCLUDEDIR) - set(CMAKE_INSTALL_INCLUDEDIR "include") -endif() - if (MSVC) add_compile_options(/EHsc /W4 /wd4100 /wd4127 /wd4242 /wd4244 /wd4245 /wd4267 /wd4365 /wd4456 /wd4459 @@ -67,6 +71,8 @@ if (${PROJECT_NAME}_ENABLE_E2EE) endif () endif () if (NOT USE_INTREE_LIBQOLM) + set(SAVED_CMAKE_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR}) + set(CMAKE_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR}) find_package(QtOlm 0.1.0 REQUIRED) if (NOT QtOlm_FOUND) message( WARNING "libQtOlm not found; configuration will most likely fail.") @@ -76,7 +82,7 @@ if (${PROJECT_NAME}_ENABLE_E2EE) endif () endif () else () - message( WARNING "End-to-end encryption (E2EE) support is turned off.") + message( STATUS "End-to-end encryption (E2EE) support is turned off.") endif () if (GTAD_PATH) @@ -102,6 +108,7 @@ if (CMAKE_BUILD_TYPE) endif(CMAKE_BUILD_TYPE) message( STATUS "Using compiler: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}" ) message( STATUS "Install Prefix: ${CMAKE_INSTALL_PREFIX}" ) +message( STATUS " Header files will be installed to ${CMAKE_INSTALL_PREFIX}/${${PROJECT_NAME}_INSTALL_INCLUDEDIR}" ) message( STATUS "Using Qt ${Qt5_VERSION} at ${Qt5_Prefix}" ) if (ABS_API_DEF_PATH AND ABS_GTAD_PATH) message( STATUS "Generating API stubs enabled (use --target update-api)" ) @@ -248,7 +255,7 @@ target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) target_include_directories(${PROJECT_NAME} PUBLIC $ - $ + $ ) if (${PROJECT_NAME}_ENABLE_E2EE) target_link_libraries(${PROJECT_NAME} QtOlm) @@ -267,9 +274,9 @@ configure_file(${PROJECT_NAME}.pc.in ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME} install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}Targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + INCLUDES DESTINATION ${${PROJECT_NAME}_INSTALL_INCLUDEDIR} ) -install(DIRECTORY lib/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +install(DIRECTORY lib/ DESTINATION ${${PROJECT_NAME}_INSTALL_INCLUDEDIR} FILES_MATCHING PATTERN "*.h") include(CMakePackageConfigHelpers) -- cgit v1.2.3 From e4b0165aa004e469ade8e24cc16a989affd3d782 Mon Sep 17 00:00:00 2001 From: Bart Ribbers Date: Mon, 6 Apr 2020 13:21:16 +0200 Subject: CMakeLists.txt: update libQtOlm to 3.0.1 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 6fac4672..68e49a67 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -73,7 +73,7 @@ if (${PROJECT_NAME}_ENABLE_E2EE) if (NOT USE_INTREE_LIBQOLM) set(SAVED_CMAKE_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR}) set(CMAKE_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR}) - find_package(QtOlm 0.1.0 REQUIRED) + find_package(QtOlm 3.0.1 REQUIRED) if (NOT QtOlm_FOUND) message( WARNING "libQtOlm not found; configuration will most likely fail.") message( WARNING "Make sure you have installed libQtOlm development files") -- cgit v1.2.3 From 51d27f3bcaacefda78dc033021b6a85152ab972e Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Mon, 1 Jun 2020 14:53:59 +0200 Subject: GTAD parts: new home and format updates for GTAD 0.7 All GTAD-related files (gtad.yaml and templates) from now live in their dedicated gtad/ directory - this helps against removing them accidentally along with the rest of the generated files. The format to list generated files in gtad.yaml has changed a bit before GTAD 0.7 beta2; gtad.yaml in this commit conforms to the new structure. --- CMakeLists.txt | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 68e49a67..1e336673 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -200,7 +200,6 @@ endforeach() # new files you have to re-run cmake. # TODO: check `file(GLOB_RECURSE ... CONFIGURE_DEPENDS)` (from CMake 3.14) if (MATRIX_DOC_PATH AND GTAD_PATH) - set(FULL_CSAPI_DIR lib/${CSAPI_DIR}) set(FULL_CSAPI_SRC_DIR ${ABS_API_DEF_PATH}/client-server) file(GLOB_RECURSE API_DEFS RELATIVE ${PROJECT_SOURCE_DIR} ${FULL_CSAPI_SRC_DIR}/*.yaml @@ -208,15 +207,15 @@ if (MATRIX_DOC_PATH AND GTAD_PATH) ${ABS_API_DEF_PATH}/${ISAPI_DEF_DIR}/*.yaml ) add_custom_target(update-api - ${ABS_GTAD_PATH} --config ${CSAPI_DIR}/gtad.yaml --out ${CSAPI_DIR} + ${ABS_GTAD_PATH} --config ../gtad/gtad.yaml --out ${CSAPI_DIR} ${FULL_CSAPI_SRC_DIR} old_sync.yaml- room_initial_sync.yaml- # deprecated search.yaml- # current GTAD is limited in handling move-only data sync.yaml- # we have a better handcrafted implementation WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/lib - SOURCES ${FULL_CSAPI_DIR}/gtad.yaml - ${FULL_CSAPI_DIR}/{{base}}.h.mustache - ${FULL_CSAPI_DIR}/{{base}}.cpp.mustache + SOURCES gtad/gtad.yaml + gtad/template.h.mustache + gtad/template.cpp.mustache ${API_DEFS} VERBATIM ) @@ -232,7 +231,7 @@ if (MATRIX_DOC_PATH AND GTAD_PATH) COMMAND ${ABS_CLANG_FORMAT} ${CLANG_FORMAT_ARGS} ${api_HDRS} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} VERBATIM - COMMENT Formatting files + COMMENT "Formatting files" ) endif() endif() -- cgit v1.2.3 From a0430b1fb722a77ad7cbd28f181727d46d92b3a2 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sat, 6 Jun 2020 20:47:56 +0200 Subject: gtad/*: optimise and use latest GTAD features - The generated code is updated to be compatible with the BaseJob changes introduced in the previous commit. This includes greatly reducing the number of header files that have to be explicitly #included, as basejob.h now #includes converters.h. Also, thanks to the changes in BaseJob, none of generated job classes needs a pimpl Private class. - gtad/template.*.mustache files are replaced with data.h.mustache for data structures (entirely defined in header files from now on) and operation.*.mustache for API operations (also massively moved to header files, possibly also becoming header-only in the future). - New variable-dropping and title-overring features in GTAD 0.7 allow to use the upstream matrix-doc repo to generate the code. - CMakeLists.txt makes use of file globbing with CONFIGURE_DEPENDS where possible to alleviate build reconfiguration after a GTAD call. --- CMakeLists.txt | 51 ++++++++++++++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 23 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e336673..c61c2682 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -184,21 +184,21 @@ set(lib_SRCS ) set(CSAPI_DIR csapi) +set(FULL_CSAPI_DIR lib/${CSAPI_DIR}) set(ASAPI_DEF_DIR application-service/definitions) set(ISAPI_DEF_DIR identity/definitions) -foreach (D ${CSAPI_DIR} ${CSAPI_DIR}/definitions - ${CSAPI_DIR}/definitions/wellknown ${ASAPI_DEF_DIR} ${ISAPI_DEF_DIR}) - aux_source_directory(lib/${D} api_SRCS) -endforeach() +if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.12.0") + set(add_CONFIGURE_DEPENDS "CONFIGURE_DEPENDS") +endif() +file(GLOB_RECURSE api_SRCS ${add_CONFIGURE_DEPENDS} ${FULL_CSAPI_DIR}/*.cpp) # Make no mistake: CMake cannot run gtad first and then populate the list of -# resulting api_SRCS files. In other words, placing the above foreach after -# the custom targets definition won't bring the desired result: +# resulting api_SRCS files. In other words, placing the above statement after +# the add_custom_target() call below won't bring the desired result: # CMake will execute it at cmake invocation and gtad will only run later # when building the update-api target. If you see that gtad has created -# new files you have to re-run cmake. -# TODO: check `file(GLOB_RECURSE ... CONFIGURE_DEPENDS)` (from CMake 3.14) +# new files you have to re-run cmake. CONFIGURE_DEPENDS somewhat helps that. if (MATRIX_DOC_PATH AND GTAD_PATH) set(FULL_CSAPI_SRC_DIR ${ABS_API_DEF_PATH}/client-server) file(GLOB_RECURSE API_DEFS RELATIVE ${PROJECT_SOURCE_DIR} @@ -206,7 +206,7 @@ if (MATRIX_DOC_PATH AND GTAD_PATH) ${ABS_API_DEF_PATH}/${ASAPI_DEF_DIR}/*.yaml ${ABS_API_DEF_PATH}/${ISAPI_DEF_DIR}/*.yaml ) - add_custom_target(update-api + add_custom_target(generate-unformatted-api ${ABS_GTAD_PATH} --config ../gtad/gtad.yaml --out ${CSAPI_DIR} ${FULL_CSAPI_SRC_DIR} old_sync.yaml- room_initial_sync.yaml- # deprecated @@ -214,25 +214,30 @@ if (MATRIX_DOC_PATH AND GTAD_PATH) sync.yaml- # we have a better handcrafted implementation WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/lib SOURCES gtad/gtad.yaml - gtad/template.h.mustache - gtad/template.cpp.mustache + gtad/data.h.mustache + gtad/operation.h.mustache + gtad/operation.cpp.mustache ${API_DEFS} VERBATIM ) if (ABS_CLANG_FORMAT) - # TODO: list(TRANSFORM) is available from CMake 3.12 - foreach (S ${api_SRCS}) - string (REGEX REPLACE ".cpp$" ".h" H ${S}) - list(APPEND api_HDRS ${H}) - endforeach() set(CLANG_FORMAT_ARGS -i -sort-includes ${CLANG_FORMAT_ARGS}) - add_custom_command(TARGET update-api POST_BUILD - COMMAND ${ABS_CLANG_FORMAT} ${CLANG_FORMAT_ARGS} ${api_SRCS} - COMMAND ${ABS_CLANG_FORMAT} ${CLANG_FORMAT_ARGS} ${api_HDRS} - WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} - VERBATIM - COMMENT "Formatting files" - ) + # FIXME: the list of files should be produced after GTAD has run. + # For now it's produced at CMake invocation; and if file() doesn't file + # any files clang-format chokes; also, + file(GLOB_RECURSE api_ALL_SRCS ${add_CONFIGURE_DEPENDS} + ${FULL_CSAPI_DIR}/*.* + lib/${ASAPI_DEF_DIR}/*.* + lib/${ISAPI_DEF_DIR}/*.*) + if (api_ALL_SRCS) + add_custom_target(format-api + ${ABS_CLANG_FORMAT} ${CLANG_FORMAT_ARGS} ${api_ALL_SRCS} + DEPENDS generate-unformatted-api + VERBATIM) + add_custom_target(update-api DEPENDS format-api) + else() + add_custom_target(update-api DEPENDS generate-unformatted-api) + endif() endif() endif() -- cgit v1.2.3 From 0ad4e7da9f561b158cecf793ab34f2968b457ca8 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Wed, 10 Jun 2020 21:21:38 +0200 Subject: CMakeLists.txt: exclude key_backup.yaml from API As of now, it's a bit immature for code generation. Will be reincluded once it gets better. --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index c61c2682..8e56e856 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -211,6 +211,7 @@ if (MATRIX_DOC_PATH AND GTAD_PATH) ${FULL_CSAPI_SRC_DIR} old_sync.yaml- room_initial_sync.yaml- # deprecated search.yaml- # current GTAD is limited in handling move-only data + key_backup.yaml- # immature and buggy in terms of API definition sync.yaml- # we have a better handcrafted implementation WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/lib SOURCES gtad/gtad.yaml -- cgit v1.2.3 From b1f050da4f6df4f6c563d36356bce9be36619ddd Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Thu, 11 Jun 2020 14:43:12 +0200 Subject: CMakeLists.txt: only use CONFIGURE_DEPENDS when needed --- CMakeLists.txt | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e56e856..9451b8ee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -188,18 +188,16 @@ set(FULL_CSAPI_DIR lib/${CSAPI_DIR}) set(ASAPI_DEF_DIR application-service/definitions) set(ISAPI_DEF_DIR identity/definitions) -if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.12.0") - set(add_CONFIGURE_DEPENDS "CONFIGURE_DEPENDS") -endif() -file(GLOB_RECURSE api_SRCS ${add_CONFIGURE_DEPENDS} ${FULL_CSAPI_DIR}/*.cpp) - -# Make no mistake: CMake cannot run gtad first and then populate the list of -# resulting api_SRCS files. In other words, placing the above statement after -# the add_custom_target() call below won't bring the desired result: -# CMake will execute it at cmake invocation and gtad will only run later -# when building the update-api target. If you see that gtad has created -# new files you have to re-run cmake. CONFIGURE_DEPENDS somewhat helps that. if (MATRIX_DOC_PATH AND GTAD_PATH) + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.12.0") + # We use globbing with CONFIGURE_DEPENDS to produce two file lists: + # one of all API files for clang-format and another of just .cpp + # files to supply for library source files. Since we expect these + # file lists to only change due to GTAD invocation, we only use + # CONFIGURE_DEPENDS when pre-requisites to update API are met. + # Read comments next to each file(GLOB_RECURSE) for caveats. + set(add_CONFIGURE_DEPENDS "CONFIGURE_DEPENDS") + endif() set(FULL_CSAPI_SRC_DIR ${ABS_API_DEF_PATH}/client-server) file(GLOB_RECURSE API_DEFS RELATIVE ${PROJECT_SOURCE_DIR} ${FULL_CSAPI_SRC_DIR}/*.yaml @@ -224,8 +222,12 @@ if (MATRIX_DOC_PATH AND GTAD_PATH) if (ABS_CLANG_FORMAT) set(CLANG_FORMAT_ARGS -i -sort-includes ${CLANG_FORMAT_ARGS}) # FIXME: the list of files should be produced after GTAD has run. - # For now it's produced at CMake invocation; and if file() doesn't file - # any files clang-format chokes; also, + # For now it's produced at CMake invocation. If file() hasn't found + # any files at that moment, clang-format will be called with an empty + # list of files and choke. Taking outfiles.txt from GTAD could be + # an option but this, too, must be done during the build stage, and + # there's no crossplatform way to use the contents of a file as + # input for a build target command. file(GLOB_RECURSE api_ALL_SRCS ${add_CONFIGURE_DEPENDS} ${FULL_CSAPI_DIR}/*.* lib/${ASAPI_DEF_DIR}/*.* @@ -242,6 +244,15 @@ if (MATRIX_DOC_PATH AND GTAD_PATH) endif() endif() +# Make no mistake: CMake cannot run gtad first and then populate the list of +# resulting api_SRCS files. In other words, placing the below statement after +# the block above will not lead to CMake magically reconfiguring the build +# after building the update-api target. CONFIGURE_DEPENDS somewhat helps, +# at least forcing the build system to reevaluate the glob before building +# the next target. Otherwise, you have to watch out if gtad has created +# new files and if it has, re-run cmake. +file(GLOB_RECURSE api_SRCS ${add_CONFIGURE_DEPENDS} ${FULL_CSAPI_DIR}/*.cpp) + set(tests_SRCS tests/quotest.cpp) add_library(${PROJECT_NAME} ${lib_SRCS} ${api_SRCS}) -- cgit v1.2.3 From 9ef0a32c2273d617b81fe47e1557f9d2754f0930 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Fri, 12 Jun 2020 12:55:33 +0200 Subject: CMakeLists.txt: fix update-api target when there's no clang-format --- CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e56e856..3eef0384 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -221,6 +221,7 @@ if (MATRIX_DOC_PATH AND GTAD_PATH) ${API_DEFS} VERBATIM ) + add_custom_target(update-api DEPENDS generate-unformatted-api) if (ABS_CLANG_FORMAT) set(CLANG_FORMAT_ARGS -i -sort-includes ${CLANG_FORMAT_ARGS}) # FIXME: the list of files should be produced after GTAD has run. @@ -235,9 +236,7 @@ if (MATRIX_DOC_PATH AND GTAD_PATH) ${ABS_CLANG_FORMAT} ${CLANG_FORMAT_ARGS} ${api_ALL_SRCS} DEPENDS generate-unformatted-api VERBATIM) - add_custom_target(update-api DEPENDS format-api) - else() - add_custom_target(update-api DEPENDS generate-unformatted-api) + add_dependencies(update-api DEPENDS format-api) endif() endif() endif() -- cgit v1.2.3 From 1e9ebbe5d5e0fa210f15277e4973a85bdb6d0d67 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Fri, 12 Jun 2020 13:12:36 +0200 Subject: CMakeLists.txt: fix a typo --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 3eef0384..cb51563c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -236,7 +236,7 @@ if (MATRIX_DOC_PATH AND GTAD_PATH) ${ABS_CLANG_FORMAT} ${CLANG_FORMAT_ARGS} ${api_ALL_SRCS} DEPENDS generate-unformatted-api VERBATIM) - add_dependencies(update-api DEPENDS format-api) + add_dependencies(update-api format-api) endif() endif() endif() -- cgit v1.2.3 From e7bf4f3e4fc059ef9ea0e0b253a1953a91fd77d8 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 31 May 2020 13:24:05 +0200 Subject: ResourceResolver Introducing the uniform way to resolve Matrix URIs and identifiers to Room/User objects, passing an optional event id (if supplied) to the client-defined handler. Just call ResourceResolver::visitResource() or ResourceResolver::openResource() and you'll have that string parsed and dispatched where you need. --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b6410f1..83075196 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -149,6 +149,7 @@ set(lib_SRCS lib/room.cpp lib/user.cpp lib/avatar.cpp + lib/resourceresolver.cpp lib/syncdata.cpp lib/settings.cpp lib/networksettings.cpp -- cgit v1.2.3 From af329351289606f3cb1ef865cb0cbe61c1d1711b Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 19 Jul 2020 16:12:09 +0200 Subject: MatrixUri->Uri: Extend to non-Matrix URIs --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 83075196..808899ba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -149,7 +149,8 @@ set(lib_SRCS lib/room.cpp lib/user.cpp lib/avatar.cpp - lib/resourceresolver.cpp + lib/uri.cpp + lib/uriresolver.cpp lib/syncdata.cpp lib/settings.cpp lib/networksettings.cpp -- cgit v1.2.3 From b0f6671d212b8c8d0c9e310cf72f45445c261bf6 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 30 Aug 2020 18:38:20 +0200 Subject: Bump version in CMakeLists.txt to 0.6.1 The new release upcoming. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 808899ba..bc296481 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_policy(SET CMP0092 NEW) endif() set(API_VERSION "0.6") -project(Quotient VERSION "${API_VERSION}.0" LANGUAGES CXX) +project(Quotient VERSION "${API_VERSION}.1" LANGUAGES CXX) option(${PROJECT_NAME}_INSTALL_TESTS "install quotest (former qmc-example) application" ON) # https://github.com/quotient-im/libQuotient/issues/369 -- cgit v1.2.3 From bc342225ebf6f6cee966684558422b5142662901 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Fri, 23 Oct 2020 18:20:41 +0200 Subject: 0.6.2 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index bc296481..83337343 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_policy(SET CMP0092 NEW) endif() set(API_VERSION "0.6") -project(Quotient VERSION "${API_VERSION}.1" LANGUAGES CXX) +project(Quotient VERSION "${API_VERSION}.2" LANGUAGES CXX) option(${PROJECT_NAME}_INSTALL_TESTS "install quotest (former qmc-example) application" ON) # https://github.com/quotient-im/libQuotient/issues/369 -- cgit v1.2.3 From 58e260ef9b081344db8b375d20dbbf015350a3c8 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Thu, 24 Dec 2020 19:27:43 +0100 Subject: Bump the version to 0.6.3 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 83337343..2ee1cb43 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_policy(SET CMP0092 NEW) endif() set(API_VERSION "0.6") -project(Quotient VERSION "${API_VERSION}.2" LANGUAGES CXX) +project(Quotient VERSION "${API_VERSION}.3" LANGUAGES CXX) option(${PROJECT_NAME}_INSTALL_TESTS "install quotest (former qmc-example) application" ON) # https://github.com/quotient-im/libQuotient/issues/369 -- cgit v1.2.3 From a4e78956f105875625b572d8b98459ffa86fafe5 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Fri, 15 Jan 2021 16:53:46 +0100 Subject: CMakeLists.txt: 0.6.4 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 2ee1cb43..4e5fed7b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_policy(SET CMP0092 NEW) endif() set(API_VERSION "0.6") -project(Quotient VERSION "${API_VERSION}.3" LANGUAGES CXX) +project(Quotient VERSION "${API_VERSION}.4" LANGUAGES CXX) option(${PROJECT_NAME}_INSTALL_TESTS "install quotest (former qmc-example) application" ON) # https://github.com/quotient-im/libQuotient/issues/369 -- cgit v1.2.3