diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d7399555..30b845237 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,11 +14,8 @@ set(RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_ project(NeoChat VERSION ${RELEASE_SERVICE_VERSION}) -set(KF_MIN_VERSION "5.105.0") -set(QT_MIN_VERSION "5.15.2") -if (ANDROID) - set(QT_MIN_VERSION "5.15.10") -endif() +set(KF_MIN_VERSION "5.240.0") +set(QT_MIN_VERSION "6.5") find_package(ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE) @@ -48,28 +45,6 @@ if(NEOCHAT_FLATPAK) include(cmake/Flatpak.cmake) endif() -if(QT_MAJOR_VERSION STREQUAL "6") - set(BASICLISTITEM_BOLD "font.bold") - set(OVERLAYSHEET_OPEN "onOpened") - set(QTQUICK_MODULE_QML_VERSION "") - set(QTLOCATION_MODULE_QML_VERSION "") - set(QTMULTIMEDIA_MODULE_QML_VERSION "") - set(QTMULTIMEDIA_AUDIO "MediaPlayer") - # in Audio qt6 we don't have it but we disable it in qt5 => it seems ok - set(QTMULTIMEDIA_AUDIO_AUTOLOAD "") - # In Video qml qt6 we don't have it. - set(QTMULTIMEDIA_VIDEO_FLUSHMODE "") -else() - set(BASICLISTITEM_BOLD "bold") - set(OVERLAYSHEET_OPEN "onSheetOpenChanged") - set(QTQUICK_MODULE_QML_VERSION "2.15") - set(QTLOCATION_MODULE_QML_VERSION "5.15") - set(QTMULTIMEDIA_MODULE_QML_VERSION "5.15") - set(QTMULTIMEDIA_AUDIO "Audio") - set(QTMULTIMEDIA_AUDIO_AUTOLOAD "autoLoad: false") - set(QTMULTIMEDIA_VIDEO_FLUSHMODE "flushMode: VideoOutput.FirstFrame") -endif() - set(QUOTIENT_FORCE_NAMESPACED_INCLUDES TRUE) ecm_setup_version(${PROJECT_VERSION} @@ -77,25 +52,21 @@ ecm_setup_version(${PROJECT_VERSION} VERSION_HEADER ${CMAKE_CURRENT_BINARY_DIR}/neochat-version.h ) -find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} NO_MODULE COMPONENTS Core Quick Gui QuickControls2 Multimedia Svg WebView) -set_package_properties(Qt${QT_MAJOR_VERSION} PROPERTIES +find_package(Qt6 ${QT_MIN_VERSION} NO_MODULE COMPONENTS Core Quick Gui QuickControls2 Multimedia Svg WebView) +set_package_properties(Qt6 PROPERTIES TYPE REQUIRED PURPOSE "Basic application components" ) -find_package(KF${QT_MAJOR_VERSION} ${KF_MIN_VERSION} COMPONENTS Kirigami2 I18n Notifications Config CoreAddons Sonnet ItemModels) -set_package_properties(KF${QT_MAJOR_VERSION} PROPERTIES +find_package(KF6 ${KF_MIN_VERSION} COMPONENTS Kirigami2 I18n Notifications Config CoreAddons Sonnet ItemModels StatusNotifierItem) +set_package_properties(KF6 PROPERTIES TYPE REQUIRED PURPOSE "Basic application components" ) -set_package_properties(KF${QT_MAJOR_VERSION}Kirigami2 PROPERTIES +set_package_properties(KF6Kirigami2 PROPERTIES TYPE REQUIRED PURPOSE "Kirigami application UI framework" ) -find_package(KF${QT_MAJOR_VERSION}KirigamiAddons 0.7.2 REQUIRED) - -if(QT_MAJOR_VERSION STREQUAL "6") - find_package(KF6StatusNotifierItem ${KF_MIN_VERSION} REQUIRED) -endif() +find_package(KF6KirigamiAddons 0.7.2 REQUIRED) if(ANDROID) find_package(OpenSSL) @@ -104,24 +75,20 @@ if(ANDROID) PURPOSE "Encrypted communications" ) else() - find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} COMPONENTS Widgets) - find_package(KF${QT_MAJOR_VERSION} ${KF_MIN_VERSION} REQUIRED COMPONENTS QQC2DesktopStyle ConfigWidgets KIO WindowSystem) - set_package_properties(KF${QT_MAJOR_VERSION}QQC2DesktopStyle PROPERTIES + find_package(Qt6 ${QT_MIN_VERSION} COMPONENTS Widgets) + find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS QQC2DesktopStyle ConfigWidgets KIO WindowSystem) + set_package_properties(KF6QQC2DesktopStyle PROPERTIES TYPE RUNTIME ) ecm_find_qmlmodule(org.kde.syntaxhighlighting 1.0) endif() if (NOT ANDROID AND NOT WIN32 AND NOT APPLE) - find_package(KF${QT_MAJOR_VERSION}DBusAddons ${KF_MIN_VERSION} REQUIRED) + find_package(KF6DBusAddons ${KF_MIN_VERSION} REQUIRED) endif() -if(QT_MAJOR_VERSION STREQUAL "6" AND NOT ANDROID AND NOT WIN32) - set(QUOTIENT_SUFFIX "Qt6") -endif() - -find_package(Quotient${QUOTIENT_SUFFIX} 0.7) -set_package_properties(Quotient${QUOTIENT_SUFFIX} PROPERTIES +find_package(QuotientQt6 0.7) +set_package_properties(QuotientQt6 PROPERTIES TYPE REQUIRED DESCRIPTION "Qt wrapper around Matrix API" URL "https://github.com/quotient-im/libQuotient/" @@ -154,12 +121,12 @@ set_package_properties(KQuickImageEditor PROPERTIES PURPOSE "Add image editing capability to image attachments" ) -find_package(QCoro${QT_MAJOR_VERSION} 0.4 COMPONENTS Core REQUIRED) +find_package(QCoro6 0.4 COMPONENTS Core REQUIRED) qcoro_enable_coroutines() -find_package(KF${QT_MAJOR_VERSION}DocTools ${KF_MIN_VERSION}) -set_package_properties(KF${QT_MAJOR_VERSION}DocTools PROPERTIES DESCRIPTION +find_package(KF6DocTools ${KF_MIN_VERSION}) +set_package_properties(KF6DocTools PROPERTIES DESCRIPTION "Tools to generate documentation" TYPE OPTIONAL ) @@ -181,12 +148,12 @@ add_definitions(-DQT_NO_FOREACH) add_subdirectory(src) if (BUILD_TESTING) - find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} NO_MODULE COMPONENTS Test) + find_package(Qt6 ${QT_MIN_VERSION} NO_MODULE COMPONENTS Test) add_subdirectory(autotests) add_subdirectory(appiumtests) endif() -if(KF${QT_MAJOR_VERSION}DocTools_FOUND) +if(KF6DocTools_FOUND) kdoctools_install(po) add_subdirectory(doc) endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1c1742d98..606399914 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -3,15 +3,6 @@ # SPDX-FileCopyrightText: 2020-2021 Tobias Fella # SPDX-License-Identifier: BSD-2-Clause -configure_file(qml/Page/RoomList/RoomDelegate.qml ${CMAKE_CURRENT_BINARY_DIR}/qml/Page/RoomList/RoomDelegate.qml) -configure_file(qml/Component/QuickSwitcher.qml ${CMAKE_CURRENT_BINARY_DIR}/qml/Component/QuickSwitcher.qml) -configure_file(qml/Dialog/PowerLevelDialog.qml ${CMAKE_CURRENT_BINARY_DIR}/qml/Dialog/PowerLevelDialog.qml) -configure_file(qml/Component/Timeline/AudioDelegate.qml ${CMAKE_CURRENT_BINARY_DIR}/qml/Component/Timeline/AudioDelegate.qml) -configure_file(qml/Component/Timeline/VideoDelegate.qml ${CMAKE_CURRENT_BINARY_DIR}/qml/Component/Timeline/VideoDelegate.qml) -configure_file(qml/Component/Timeline/OsmLocationPlugin.qml ${CMAKE_CURRENT_BINARY_DIR}/qml/Component/Timeline/OsmLocationPlugin.qml) - -configure_file(res.qrc ${CMAKE_CURRENT_SOURCE_DIR}/res.generated.qrc) - add_library(neochat STATIC controller.cpp controller.h @@ -156,7 +147,7 @@ ecm_qt_declare_logging_category(neochat add_executable(neochat-app main.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/res.generated.qrc + res.qrc ) if(TARGET Qt::WebView) @@ -178,13 +169,11 @@ if(NOT ANDROID) target_sources(neochat PRIVATE colorschemer.cpp colorschemer.h) if (NOT WIN32 AND NOT APPLE) target_sources(neochat PRIVATE trayicon_sni.cpp trayicon_sni.h) - if(QT_MAJOR_VERSION STREQUAL "6") - target_link_libraries(neochat PRIVATE KF6::StatusNotifierItem) - endif() + target_link_libraries(neochat PRIVATE KF6::StatusNotifierItem) else() target_sources(neochat PRIVATE trayicon.cpp trayicon.h) endif() - target_link_libraries(neochat PUBLIC KF${QT_MAJOR_VERSION}::ConfigWidgets KF${QT_MAJOR_VERSION}::WindowSystem) + target_link_libraries(neochat PUBLIC KF6::ConfigWidgets KF6::WindowSystem) target_compile_definitions(neochat PUBLIC -DHAVE_COLORSCHEME) target_compile_definitions(neochat PUBLIC -DHAVE_WINDOWSYSTEM) endif() @@ -199,7 +188,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${QUOTIENT_SUFFIX} cmark::cmark QCoro::Core) +target_link_libraries(neochat PUBLIC Qt::Core Qt::Quick Qt::Qml Qt::Gui Qt::Multimedia Qt::Network Qt::QuickControls2 KF6::I18n KF6::Kirigami2 KF6::Notifications KF6::ConfigCore KF6::ConfigGui KF6::CoreAddons KF6::SonnetCore KF6::ItemModels QuotientQt6 cmark::cmark QCoro::Core) kconfig_add_kcfg_files(neochat GENERATE_MOC neochatconfig.kcfgc) @@ -287,7 +276,7 @@ if(ANDROID) "gps" ) else() - target_link_libraries(neochat PUBLIC Qt::Widgets KF${QT_MAJOR_VERSION}::KIOWidgets) + target_link_libraries(neochat PUBLIC Qt::Widgets KF6::KIOWidgets) install(FILES neochat.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFYRCDIR}) endif() @@ -295,12 +284,12 @@ if(NOT ANDROID) set_target_properties(neochat-app PROPERTIES OUTPUT_NAME "neochat") endif() -if(TARGET KF${QT_MAJOR_VERSION}::DBusAddons) - target_link_libraries(neochat PUBLIC KF${QT_MAJOR_VERSION}::DBusAddons) +if(TARGET KF6::DBusAddons) + target_link_libraries(neochat PUBLIC KF6::DBusAddons) target_compile_definitions(neochat PUBLIC -DHAVE_KDBUSADDONS) endif() -if (TARGET KF${QT_MAJOR_VERSION}::KIOWidgets) +if (TARGET KF6::KIOWidgets) target_compile_definitions(neochat PUBLIC -DHAVE_KIO) endif() diff --git a/src/res.qrc b/src/res.qrc index 7c494c23e..d4ac028c3 100644 --- a/src/res.qrc +++ b/src/res.qrc @@ -9,7 +9,7 @@ qml/Page/RoomList/ExploreComponent.qml qml/Page/RoomList/ContextMenu.qml qml/Page/RoomList/CollapsedRoomDelegate.qml - @CMAKE_CURRENT_BINARY_DIR@/qml/Page/RoomList/RoomDelegate.qml + qml/Page/RoomList/RoomDelegate.qml qml/Page/RoomList/Page.qml qml/Page/RoomList/SpaceListContextMenu.qml qml/Page/RoomList/UserInfo.qml @@ -32,7 +32,7 @@ qml/Component/FancyEffectsContainer.qml qml/Component/TypingPane.qml qml/Component/ShimmerGradient.qml - @CMAKE_CURRENT_BINARY_DIR@/qml/Component/QuickSwitcher.qml + qml/Component/QuickSwitcher.qml qml/Component/HoverActions.qml qml/Component/ChatBox/ChatBox.qml qml/Component/ChatBox/ChatBar.qml @@ -49,10 +49,10 @@ qml/Component/Timeline/RichLabel.qml qml/Component/Timeline/TimelineContainer.qml qml/Component/Timeline/SectionDelegate.qml - @CMAKE_CURRENT_BINARY_DIR@/qml/Component/Timeline/VideoDelegate.qml + qml/Component/Timeline/VideoDelegate.qml qml/Component/Timeline/ReactionDelegate.qml qml/Component/Timeline/LinkPreviewDelegate.qml - @CMAKE_CURRENT_BINARY_DIR@/qml/Component/Timeline/AudioDelegate.qml + qml/Component/Timeline/AudioDelegate.qml qml/Component/Timeline/FileDelegate.qml qml/Component/Timeline/ImageDelegate.qml qml/Component/Timeline/EncryptedDelegate.qml @@ -84,7 +84,7 @@ qml/Dialog/OpenFileDialog.qml qml/Dialog/KeyVerification/KeyVerificationDialog.qml qml/Dialog/ConfirmLogout.qml - @CMAKE_CURRENT_BINARY_DIR@/qml/Dialog/PowerLevelDialog.qml + qml/Dialog/PowerLevelDialog.qml qml/Dialog/KeyVerification/Message.qml qml/Dialog/KeyVerification/EmojiItem.qml qml/Dialog/KeyVerification/EmojiRow.qml @@ -132,7 +132,7 @@ qml/Component/InvitationView.qml qml/Component/AvatarTabButton.qml qml/Page/RoomList/SpaceDrawer.qml - @CMAKE_CURRENT_BINARY_DIR@/qml/Component/Timeline/OsmLocationPlugin.qml + qml/Component/Timeline/OsmLocationPlugin.qml qml/Component/Timeline/LiveLocationDelegate.qml qml/Component/FullScreenMap.qml qml/Component/LocationPage.qml