diff --git a/CMakeLists.txt b/CMakeLists.txt index 2ba8871c3..88f8222a8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,8 +94,12 @@ if (NOT ANDROID AND NOT WIN32 AND NOT APPLE) find_package(KF${QT_MAJOR_VERSION}DBusAddons ${KF_MIN_VERSION} REQUIRED) endif() -find_package(Quotient 0.6) -set_package_properties(Quotient PROPERTIES +if(QT_MAJOR_VERSION STREQUAL "6" AND NOT ANDROID AND NOT WIN32) + set(QUOTIENT_SUFFIX "Qt6") +endif() + +find_package(Quotient${QUOTIENT_SUFFIX} 0.6) +set_package_properties(Quotient${QUOTIENT_SUFFIX} PROPERTIES TYPE REQUIRED DESCRIPTION "Qt wrapper around Matrix API" URL "https://github.com/quotient-im/libQuotient/" @@ -132,7 +136,7 @@ set_package_properties(KF${QT_MAJOR_VERSION}DocTools PROPERTIES DESCRIPTION TYPE OPTIONAL ) -if(NOT Quotient_VERSION_MINOR GREATER 6) +if(NOT Quotient${QUOTIENT_SUFFIX}_VERSION_MINOR GREATER 6) cmake_policy(SET CMP0063 OLD) endif() @@ -151,7 +155,7 @@ install(FILES org.kde.neochat.tray.svg DESTINATION ${KDE_INSTALL_FULL_ICONDIR}/h add_definitions(-DQT_NO_FOREACH) add_subdirectory(src) -if (BUILD_TESTING AND Quotient_VERSION_MINOR GREATER 6) +if (BUILD_TESTING AND Quotient${QUOTIENT_SUFFIX}_VERSION_MINOR GREATER 6) find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} NO_MODULE COMPONENTS Test) add_subdirectory(autotests) endif() diff --git a/autotests/CMakeLists.txt b/autotests/CMakeLists.txt index c8625b0b4..f3ca64ac1 100644 --- a/autotests/CMakeLists.txt +++ b/autotests/CMakeLists.txt @@ -5,7 +5,7 @@ enable_testing() ecm_add_test( neochatroomtest.cpp - LINK_LIBRARIES neochat Qt::Test Quotient + LINK_LIBRARIES neochat Qt::Test TEST_NAME neochatroomtest ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ef504b383..f70e4be8e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -72,11 +72,11 @@ target_link_libraries(neochat-app PRIVATE neochat ) -if(Quotient_VERSION_MINOR GREATER 6) +if(Quotient${QUOTIENT_SUFFIX}_VERSION_MINOR GREATER 6) target_compile_definitions(neochat PUBLIC QUOTIENT_07) target_sources(neochat PRIVATE events/pollevent.cpp pollhandler.cpp) else() - target_compile_definitions(neochat PUBLIC QUOTIENT_VERSION=\"${Quotient_VERSION}\") + target_compile_definitions(neochat PUBLIC QUOTIENT_VERSION=\"${Quotient${QUOTIENT_SUFFIX}_VERSION}\") target_sources(neochat PRIVATE neochataccountregistry.cpp) endif() @@ -106,7 +106,7 @@ else() endif() target_include_directories(neochat PRIVATE ${CMAKE_BINARY_DIR}) -target_link_libraries(neochat PUBLIC Qt::Core Qt::Quick Qt::Qml Qt::Gui Qt::Multimedia Qt::Network Qt::QuickControls2 KF${QT_MAJOR_VERSION}::I18n KF${QT_MAJOR_VERSION}::Kirigami2 KF${QT_MAJOR_VERSION}::Notifications KF${QT_MAJOR_VERSION}::ConfigCore KF${QT_MAJOR_VERSION}::ConfigGui KF${QT_MAJOR_VERSION}::CoreAddons KF${QT_MAJOR_VERSION}::SonnetCore KF${QT_MAJOR_VERSION}::ItemModels Quotient cmark::cmark ${QTKEYCHAIN_LIBRARIES} QCoro::Core) +target_link_libraries(neochat PUBLIC Qt::Core Qt::Quick Qt::Qml Qt::Gui Qt::Multimedia Qt::Network Qt::QuickControls2 KF${QT_MAJOR_VERSION}::I18n KF${QT_MAJOR_VERSION}::Kirigami2 KF${QT_MAJOR_VERSION}::Notifications KF${QT_MAJOR_VERSION}::ConfigCore KF${QT_MAJOR_VERSION}::ConfigGui KF${QT_MAJOR_VERSION}::CoreAddons KF${QT_MAJOR_VERSION}::SonnetCore KF${QT_MAJOR_VERSION}::ItemModels Quotient${QUOTIENT_SUFFIX} cmark::cmark ${QTKEYCHAIN_LIBRARIES} QCoro::Core) kconfig_add_kcfg_files(neochat GENERATE_MOC neochatconfig.kcfgc) if(NEOCHAT_FLATPAK) diff --git a/src/neochatroom.cpp b/src/neochatroom.cpp index acd2b713f..63614f050 100644 --- a/src/neochatroom.cpp +++ b/src/neochatroom.cpp @@ -33,8 +33,10 @@ #include #include #ifndef QUOTIENT_07 +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) #include #endif +#endif #include #include "controller.h"