From baabe61cc2e5a2afc00f02ae55465c21b2915bd8 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Sat, 14 Nov 2020 14:58:36 +0100 Subject: Add feature summary to cmake file --- CMakeLists.txt | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index d3bede48..2b77e262 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,9 +6,14 @@ endif() set(API_VERSION "0.7") project(Quotient VERSION "${API_VERSION}.0" LANGUAGES CXX) +include(FeatureSummary) + option(${PROJECT_NAME}_INSTALL_TESTS "install quotest (former qmc-example) application" ON) +add_feature_info(InstallQuotest ${PROJECT_NAME}_INSTALL_TESTS "Install Quotest") + # https://github.com/quotient-im/libQuotient/issues/369 option(${PROJECT_NAME}_ENABLE_E2EE "end-to-end encryption (E2EE) support" OFF) +add_feature_info(EnableE2EE ${PROJECT_NAME}_ENABLE_E2EE "Enable end-to-end encryption (E2EE)") include(CheckCXXCompilerFlag) if (WIN32) @@ -59,7 +64,7 @@ else() endforeach () endif() -find_package(Qt5 5.9 REQUIRED Network Gui Multimedia Test) +find_package(Qt5 5.9 REQUIRED Core Network Gui Multimedia Test) get_filename_component(Qt5_Prefix "${Qt5_DIR}/../../../.." ABSOLUTE) if (${PROJECT_NAME}_ENABLE_E2EE) @@ -75,15 +80,12 @@ if (${PROJECT_NAME}_ENABLE_E2EE) set(SAVED_CMAKE_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR}) set(CMAKE_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR}) 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") - message( WARNING "as a package or checked out the library sources in lib/.") - message( WARNING "See also BUILDING.md") - endif () + set_package_properties(QtOlm PROPERTIES + DESCRIPTION "QtOlm is a Qt wrapper around libOlm" + PURPOSE "libQtOlm is required to support end-to-end encryption. See also BUILDING.md" + URL "https://gitlab.com/b0/libqtolm" + ) endif () -else () - message( STATUS "End-to-end encryption (E2EE) support is turned off.") endif () if (GTAD_PATH) @@ -99,11 +101,6 @@ if (ABS_GTAD_PATH AND ABS_API_DEF_PATH) get_filename_component(ABS_CLANG_FORMAT "${CLANG_FORMAT}" PROGRAM) endif() -message( STATUS ) -message( STATUS "=============================================================================" ) -message( STATUS " ${PROJECT_NAME} 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) @@ -341,3 +338,5 @@ if (UNIX AND NOT APPLE) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) endif() + +feature_summary(WHAT ALL) -- cgit v1.2.3 From 57c46baaea2384c1caed46033f6bdb3c5c3a75da Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Thu, 3 Dec 2020 20:19:46 +0100 Subject: CMakeLists.txt: reworked configuration logging Notably, screen-wide ==== fences are gone, and the status messages are now located next to where the relevant piece of configuration occurs, instead of having a configuration summary block. Also, features related to code generation have been added for feature_summary(). --- CMakeLists.txt | 127 ++++++++++++++++++++++++++++++--------------------------- 1 file changed, 67 insertions(+), 60 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 2773c9da..393ee94f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,38 +6,19 @@ endif() set(API_VERSION "0.7") project(Quotient VERSION "${API_VERSION}.0" LANGUAGES CXX) +message(STATUS) +message(STATUS "Configuring ${PROJECT_NAME} ${PROJECT_VERSION} ==>") + include(FeatureSummary) option(${PROJECT_NAME}_INSTALL_TESTS "install quotest (former qmc-example) application" ON) -add_feature_info(InstallQuotest ${PROJECT_NAME}_INSTALL_TESTS "Install Quotest") +add_feature_info(InstallQuotest ${PROJECT_NAME}_INSTALL_TESTS + "the library functional test suite") # https://github.com/quotient-im/libQuotient/issues/369 option(${PROJECT_NAME}_ENABLE_E2EE "end-to-end encryption (E2EE) support" OFF) -add_feature_info(EnableE2EE ${PROJECT_NAME}_ENABLE_E2EE "Enable end-to-end encryption (E2EE)") - -include(CheckCXXCompilerFlag) -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) - 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) +add_feature_info(EnableE2EE ${PROJECT_NAME}_ENABLE_E2EE + "end-to-end encryption (WORK IN PROGRESS)") # Set a default build type if none was specified if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) @@ -47,7 +28,12 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") endif() +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}" ) +include(CheckCXXCompilerFlag) if (MSVC) add_compile_options(/EHsc /W4 /wd4100 /wd4127 /wd4242 /wd4244 /wd4245 /wd4267 /wd4365 /wd4456 /wd4459 @@ -64,8 +50,34 @@ else() endforeach () endif() +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) + 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") +message(STATUS "Install Prefix: ${CMAKE_INSTALL_PREFIX}") +message(STATUS " Header files will be installed to ${CMAKE_INSTALL_PREFIX}/${${PROJECT_NAME}_INSTALL_INCLUDEDIR}") + +# Instruct CMake to run moc automatically when needed. +set(CMAKE_AUTOMOC ON) + find_package(Qt5 5.9 REQUIRED Core Network Gui Multimedia Test) get_filename_component(Qt5_Prefix "${Qt5_DIR}/../../../.." ABSOLUTE) +message(STATUS "Using Qt ${Qt5_VERSION} at ${Qt5_Prefix}") if (${PROJECT_NAME}_ENABLE_E2EE) if ((NOT DEFINED USE_INTREE_LIBQOLM OR USE_INTREE_LIBQOLM) @@ -76,7 +88,18 @@ if (${PROJECT_NAME}_ENABLE_E2EE) set (USE_INTREE_LIBQOLM 1) endif () endif () - if (NOT USE_INTREE_LIBQOLM) + if (USE_INTREE_LIBQOLM) + message( STATUS "Using in-tree libQtOlm") + find_package(Git QUIET) + 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 () set(SAVED_CMAKE_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR}) set(CMAKE_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR}) find_package(QtOlm 3.0.1 REQUIRED) @@ -85,6 +108,9 @@ if (${PROJECT_NAME}_ENABLE_E2EE) PURPOSE "libQtOlm is required to support end-to-end encryption. See also BUILDING.md" URL "https://gitlab.com/b0/libqtolm" ) + if (QtOlm_FOUND) + message(STATUS "Using libQtOlm ${QtOlm_VERSION} at ${QtOlm_DIR}") + endif() endif () endif () @@ -95,47 +121,28 @@ if (MATRIX_DOC_PATH) get_filename_component(ABS_API_DEF_PATH "${MATRIX_DOC_PATH}/api" REALPATH) endif () if (ABS_GTAD_PATH AND ABS_API_DEF_PATH) + message( STATUS "Using GTAD at ${ABS_GTAD_PATH}" ) + message( STATUS "Using API files at ${ABS_API_DEF_PATH}" ) + set(API_GENERATION_ENABLED 1) if (NOT CLANG_FORMAT) set(CLANG_FORMAT clang-format) endif() get_filename_component(ABS_CLANG_FORMAT "${CLANG_FORMAT}" PROGRAM) -endif() - -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 " 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)" ) - message( STATUS " Using GTAD at ${ABS_GTAD_PATH}" ) - message( STATUS " Using API files at ${ABS_API_DEF_PATH}" ) if (ABS_CLANG_FORMAT) + set(API_FORMATTING_ENABLED 1) message( STATUS "clang-format is at ${ABS_CLANG_FORMAT}") else () message( STATUS "${CLANG_FORMAT} is NOT FOUND; API files won't be reformatted") endif () -endif () -find_package(Git) -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 ) +endif() +add_feature_info(EnableApiCodeGeneration ${API_GENERATION_ENABLED} + "build target update-api") +add_feature_info(EnableApiFormatting ${API_FORMATTING_ENABLED} + "formatting of generated API files with clang-format") + +message(STATUS) +feature_summary(WHAT ENABLED_FEATURES DISABLED_FEATURES + FATAL_ON_MISSING_REQUIRED_PACKAGES) # Set up source files set(lib_SRCS @@ -338,4 +345,4 @@ if (UNIX AND NOT APPLE) DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) endif() -feature_summary(WHAT ALL) +message(STATUS "<== End of libQuotient configuration") -- cgit v1.2.3 From f160c92d06446bd90b8ac4e1d238ecabb0c97651 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Thu, 3 Dec 2020 22:13:08 +0100 Subject: CMakeLists.txt: fix configuration failures --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 393ee94f..eb3f9528 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -135,9 +135,9 @@ if (ABS_GTAD_PATH AND ABS_API_DEF_PATH) message( STATUS "${CLANG_FORMAT} is NOT FOUND; API files won't be reformatted") endif () endif() -add_feature_info(EnableApiCodeGeneration ${API_GENERATION_ENABLED} +add_feature_info(EnableApiCodeGeneration "${API_GENERATION_ENABLED}" "build target update-api") -add_feature_info(EnableApiFormatting ${API_FORMATTING_ENABLED} +add_feature_info(EnableApiFormatting "${API_FORMATTING_ENABLED}" "formatting of generated API files with clang-format") message(STATUS) -- cgit v1.2.3 From 7366ea54135c46546253b72e2813d8d24f743481 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Mon, 28 Dec 2020 18:22:56 +0100 Subject: Add cmake change --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index eb3f9528..1b46f1a7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -183,6 +183,7 @@ set(lib_SRCS lib/events/encryptionevent.cpp lib/events/encryptedevent.cpp lib/events/roomkeyevent.cpp + lib/events/stickerevent.cpp lib/jobs/requestdata.cpp lib/jobs/basejob.cpp lib/jobs/syncjob.cpp -- cgit v1.2.3 From b3e3bd7d6f6934257c17c486260ac4670373141c Mon Sep 17 00:00:00 2001 From: Heiko Becker Date: Wed, 6 Jan 2021 19:49:38 +0100 Subject: Use CMAKE_INSTALL_DATADIR instead of hard-coding share Signed-off-by: Heiko Becker --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 1b46f1a7..ce2463bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -331,7 +331,7 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}ConfigVersion.cmake" DESTINATION ${ConfigFilesLocation} ) -install(EXPORT_ANDROID_MK ${PROJECT_NAME}Targets DESTINATION share/ndk-modules) +install(EXPORT_ANDROID_MK ${PROJECT_NAME}Targets DESTINATION ${CMAKE_INSTALL_DATADIR}/ndk-modules) if (WIN32) install(FILES mime/packages/freedesktop.org.xml DESTINATION mime/packages) -- cgit v1.2.3