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) --- cmake/FindOlm.cmake | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 cmake/FindOlm.cmake (limited to 'cmake') diff --git a/cmake/FindOlm.cmake b/cmake/FindOlm.cmake new file mode 100644 index 00000000..3fea7b46 --- /dev/null +++ b/cmake/FindOlm.cmake @@ -0,0 +1,30 @@ +# - Try to find LibOlm + +# Uses the following variables to help find libolm: +# Olm_INCLUDE_DIR - include files +# Olm_LIBRARY_DIR - libraries +# Once done this will define +# Olm_FOUND - System has olm +# Olm_INCLUDE_DIRS - The olm include directories +# Olm_LIBRARIES - The libraries needed to use olm + +find_path(Olm_INCLUDE_DIRS NAMES + olm/olm.h + olm/inbound_group_session.h + olm/outbound_group_session.h + PATHS "${Olm_INCLUDE_DIR}" + DOC "Path to a directory with libolm header files" +) + +find_library(Olm_LIBRARIES NAMES olm + PATHS "${Olm_LIBRARY_DIR}" + DOC "Path to a directory with libolm libraries" +) + +include(FindPackageHandleStandardArgs) +# handle the QUIETLY and REQUIRED arguments and set OLM_FOUND to TRUE +# if all listed variables are TRUE +find_package_handle_standard_args(olm DEFAULT_MSG + Olm_LIBRARIES Olm_INCLUDE_DIRS) + +mark_as_advanced(Olm_INCLUDE_DIRS Olm_LIBRARIES) -- 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 --- .gitmodules | 3 +++ CMakeLists.txt | 39 +++++++++++++++++++++++++++++++++------ cmake/QMatrixClientConfig.cmake | 3 +++ lib/libQtOlm | 1 + 4 files changed, 40 insertions(+), 6 deletions(-) create mode 160000 lib/libQtOlm (limited to 'cmake') diff --git a/.gitmodules b/.gitmodules index e69de29b..23158cd2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "lib/libQtOlm"] + path = lib/libQtOlm + url = git@gitlab.com:aa13q/libqtolm.git 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) diff --git a/cmake/QMatrixClientConfig.cmake b/cmake/QMatrixClientConfig.cmake index 900038a5..64180cca 100644 --- a/cmake/QMatrixClientConfig.cmake +++ b/cmake/QMatrixClientConfig.cmake @@ -1 +1,4 @@ +include(CMakeFindDependencyMacro) + +find_dependency(QtOlm) include("${CMAKE_CURRENT_LIST_DIR}/QMatrixClientTargets.cmake") diff --git a/lib/libQtOlm b/lib/libQtOlm new file mode 160000 index 00000000..37bebdc9 --- /dev/null +++ b/lib/libQtOlm @@ -0,0 +1 @@ +Subproject commit 37bebdc96aee620df44d211ef91b55b86d8cfbc7 -- 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 --- .appveyor.yml | 3 +++ .gitmodules | 6 +++--- .travis.yml | 10 +++------- 3rdparty/libQtOlm | 1 + CMakeLists.txt | 17 ++++++----------- cmake/FindOlm.cmake | 30 ------------------------------ lib/libQtOlm | 1 - 7 files changed, 16 insertions(+), 52 deletions(-) create mode 160000 3rdparty/libQtOlm delete mode 100644 cmake/FindOlm.cmake delete mode 160000 lib/libQtOlm (limited to 'cmake') diff --git a/.appveyor.yml b/.appveyor.yml index 410ad12e..fb5903c1 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -26,6 +26,9 @@ init: before_build: - git submodule update --init --recursive +- cd 3rdparty/libQtOlm +- git clone https://gitlab.matrix.org/matrix-org/olm.git +- cd ../.. - if %MAKETOOL% == cmake cmake -G "NMake Makefiles JOM" -H. -Bbuild -DCMAKE_CXX_FLAGS="/EHsc /W3" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX="%DEPLOY_DIR%" build_script: diff --git a/.gitmodules b/.gitmodules index 23158cd2..eb4c1815 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "lib/libQtOlm"] - path = lib/libQtOlm - url = git@gitlab.com:aa13q/libqtolm.git +[submodule "3rdparty/libQtOlm"] + path = 3rdparty/libQtOlm + url = https://gitlab.com/b0/libqtolm.git diff --git a/.travis.yml b/.travis.yml index 72be46cb..859cabfc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,13 +32,9 @@ before_install: - if [ "$TRAVIS_OS_NAME" = "linux" ]; then USE_NINJA="-GNinja"; VALGRIND="valgrind $VALGRIND_OPTIONS"; . /opt/qt57/bin/qt57-env.sh; fi install: -# olm -- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update; else sudo apt-get update -qq; fi -- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew install qt5; export PATH="$PATH:/usr/local/opt/qt/bin"; else sudo apt-get install -y qt5-default; fi -- git clone https://matrix.org/git/olm.git && cd olm && make && sudo make install && cd .. -- mkdir build && cd build -- cmake .. -# matrix-doc and gtad +- pushd 3rdparty/libQtOlm +- git clone https://gitlab.matrix.org/matrix-org/olm.git +- popd - git clone https://github.com/QMatrixClient/matrix-doc.git - git clone --recursive https://github.com/KitsuneRal/gtad.git - pushd gtad diff --git a/3rdparty/libQtOlm b/3rdparty/libQtOlm new file mode 160000 index 00000000..f610197b --- /dev/null +++ b/3rdparty/libQtOlm @@ -0,0 +1 @@ +Subproject commit f610197ba38ef87bbab8bcff1053bda684a5994a 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}") diff --git a/cmake/FindOlm.cmake b/cmake/FindOlm.cmake deleted file mode 100644 index 3fea7b46..00000000 --- a/cmake/FindOlm.cmake +++ /dev/null @@ -1,30 +0,0 @@ -# - Try to find LibOlm - -# Uses the following variables to help find libolm: -# Olm_INCLUDE_DIR - include files -# Olm_LIBRARY_DIR - libraries -# Once done this will define -# Olm_FOUND - System has olm -# Olm_INCLUDE_DIRS - The olm include directories -# Olm_LIBRARIES - The libraries needed to use olm - -find_path(Olm_INCLUDE_DIRS NAMES - olm/olm.h - olm/inbound_group_session.h - olm/outbound_group_session.h - PATHS "${Olm_INCLUDE_DIR}" - DOC "Path to a directory with libolm header files" -) - -find_library(Olm_LIBRARIES NAMES olm - PATHS "${Olm_LIBRARY_DIR}" - DOC "Path to a directory with libolm libraries" -) - -include(FindPackageHandleStandardArgs) -# handle the QUIETLY and REQUIRED arguments and set OLM_FOUND to TRUE -# if all listed variables are TRUE -find_package_handle_standard_args(olm DEFAULT_MSG - Olm_LIBRARIES Olm_INCLUDE_DIRS) - -mark_as_advanced(Olm_INCLUDE_DIRS Olm_LIBRARIES) diff --git a/lib/libQtOlm b/lib/libQtOlm deleted file mode 160000 index 5bfc4241..00000000 --- a/lib/libQtOlm +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5bfc42417d8ee741d2f5a723a2939c895734b92b -- 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 +++++++++++++++++++++-------------------- QMatrixClient.pc.in | 10 ------- Quotient.pc.in | 10 +++++++ cmake/QMatrixClientConfig.cmake | 4 --- cmake/QuotientConfig.cmake | 4 +++ examples/CMakeLists.txt | 8 +++--- 6 files changed, 50 insertions(+), 49 deletions(-) delete mode 100644 QMatrixClient.pc.in create mode 100644 Quotient.pc.in delete mode 100644 cmake/QMatrixClientConfig.cmake create mode 100644 cmake/QuotientConfig.cmake (limited to 'cmake') 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() diff --git a/QMatrixClient.pc.in b/QMatrixClient.pc.in deleted file mode 100644 index efb41498..00000000 --- a/QMatrixClient.pc.in +++ /dev/null @@ -1,10 +0,0 @@ -prefix=@CMAKE_INSTALL_PREFIX@ -exec_prefix=${prefix} -includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ -libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ - -Name: QMatrixClient -Description: A Qt5 library to write cross-platfrom clients for Matrix -Version: @API_VERSION@ -Cflags: -I${includedir} -Libs: -L${libdir} -lQMatrixClient diff --git a/Quotient.pc.in b/Quotient.pc.in new file mode 100644 index 00000000..6eb1672e --- /dev/null +++ b/Quotient.pc.in @@ -0,0 +1,10 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} +includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ +libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ + +Name: Quotient +Description: A Qt5 library to write cross-platfrom clients for Matrix +Version: @API_VERSION@ +Cflags: -I${includedir} +Libs: -L${libdir} -lQuotient diff --git a/cmake/QMatrixClientConfig.cmake b/cmake/QMatrixClientConfig.cmake deleted file mode 100644 index 64180cca..00000000 --- a/cmake/QMatrixClientConfig.cmake +++ /dev/null @@ -1,4 +0,0 @@ -include(CMakeFindDependencyMacro) - -find_dependency(QtOlm) -include("${CMAKE_CURRENT_LIST_DIR}/QMatrixClientTargets.cmake") diff --git a/cmake/QuotientConfig.cmake b/cmake/QuotientConfig.cmake new file mode 100644 index 00000000..6b842f60 --- /dev/null +++ b/cmake/QuotientConfig.cmake @@ -0,0 +1,4 @@ +include(CMakeFindDependencyMacro) + +find_dependency(QtOlm) +include("${CMAKE_CURRENT_LIST_DIR}/QuotientTargets.cmake") diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index cd5e15ed..1f512958 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -48,8 +48,8 @@ endforeach () find_package(Qt5 5.6 REQUIRED Network Gui Multimedia) get_filename_component(Qt5_Prefix "${Qt5_DIR}/../../../.." ABSOLUTE) -find_package(QMatrixClient REQUIRED) -get_filename_component(QMC_Prefix "${QMatrixClient_DIR}/../.." ABSOLUTE) +find_package(Quotient REQUIRED) +get_filename_component(QMC_Prefix "${Quotient_DIR}/../.." ABSOLUTE) message( STATUS "qmc-example configuration:" ) if (CMAKE_BUILD_TYPE) @@ -57,12 +57,12 @@ if (CMAKE_BUILD_TYPE) endif(CMAKE_BUILD_TYPE) message( STATUS " Compiler: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}" ) message( STATUS " Qt: ${Qt5_VERSION} at ${Qt5_Prefix}" ) -message( STATUS " QMatrixClient: ${QMatrixClient_VERSION} at ${QMC_Prefix}" ) +message( STATUS " Quotient: ${Quotient_VERSION} at ${QMC_Prefix}" ) set(example_SRCS qmc-example.cpp) add_executable(qmc-example ${example_SRCS}) -target_link_libraries(qmc-example Qt5::Core QMatrixClient) +target_link_libraries(qmc-example Qt5::Core Quotient) # Installation -- cgit v1.2.3 From e95487a144ffe0923efda938b20e45bb5b9a59ff Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Thu, 26 Mar 2020 23:14:22 +0100 Subject: Fix building tests without E2EE --- cmake/QuotientConfig.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cmake') diff --git a/cmake/QuotientConfig.cmake b/cmake/QuotientConfig.cmake index 6b842f60..c11d5e79 100644 --- a/cmake/QuotientConfig.cmake +++ b/cmake/QuotientConfig.cmake @@ -1,4 +1,6 @@ include(CMakeFindDependencyMacro) -find_dependency(QtOlm) +if (Quotient_E2EE_ENABLED) + find_dependency(QtOlm) +endif() include("${CMAKE_CURRENT_LIST_DIR}/QuotientTargets.cmake") -- cgit v1.2.3 From cb09112c5b88f391019c05368ff6e8998722ba3c Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Fri, 27 Mar 2020 10:16:17 +0100 Subject: QuotientConfig.cmake: fix another typo ...to fix building tests _with_ E2EE by CMake. --- cmake/QuotientConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmake') diff --git a/cmake/QuotientConfig.cmake b/cmake/QuotientConfig.cmake index c11d5e79..31ed4db6 100644 --- a/cmake/QuotientConfig.cmake +++ b/cmake/QuotientConfig.cmake @@ -1,6 +1,6 @@ include(CMakeFindDependencyMacro) -if (Quotient_E2EE_ENABLED) +if (Quotient_ENABLE_E2EE) find_dependency(QtOlm) endif() include("${CMAKE_CURRENT_LIST_DIR}/QuotientTargets.cmake") -- 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 +++++--- cmake/QuotientConfig.cmake | 6 ------ cmake/QuotientConfig.cmake.in | 5 +++++ 3 files changed, 10 insertions(+), 9 deletions(-) delete mode 100644 cmake/QuotientConfig.cmake create mode 100644 cmake/QuotientConfig.cmake.in (limited to 'cmake') 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} ) diff --git a/cmake/QuotientConfig.cmake b/cmake/QuotientConfig.cmake deleted file mode 100644 index 31ed4db6..00000000 --- a/cmake/QuotientConfig.cmake +++ /dev/null @@ -1,6 +0,0 @@ -include(CMakeFindDependencyMacro) - -if (Quotient_ENABLE_E2EE) - find_dependency(QtOlm) -endif() -include("${CMAKE_CURRENT_LIST_DIR}/QuotientTargets.cmake") diff --git a/cmake/QuotientConfig.cmake.in b/cmake/QuotientConfig.cmake.in new file mode 100644 index 00000000..798fa87a --- /dev/null +++ b/cmake/QuotientConfig.cmake.in @@ -0,0 +1,5 @@ +include(CMakeFindDependencyMacro) + +@FIND_DEPS@ + +include("${CMAKE_CURRENT_LIST_DIR}/QuotientTargets.cmake") -- cgit v1.2.3