Prepare for KF6

This commit is contained in:
Bart De Vries 2023-03-01 09:34:45 +01:00
parent 841c43fb09
commit 1d28cdfed5
6 changed files with 38 additions and 16 deletions

View File

@ -2,7 +2,7 @@
# SPDX-License-Identifier: BSD-2-Clause
Dependencies:
- 'on': ['@all']
- 'on': ['Linux/Qt5', 'FreeBSD/Qt5', 'Windows/Qt5', 'Android/Qt5']
'require':
'frameworks/extra-cmake-modules': '@stable'
'frameworks/kcoreaddons': '@stable'
@ -15,5 +15,19 @@ Dependencies:
'third-party/qtkeychain': '@latest'
'third-party/taglib': '@latest'
- 'on': ['Linux/Qt6', 'FreeBSD/Qt6', 'Windows/Qt6', 'Android/Qt6']
'require':
'frameworks/extra-cmake-modules': '@latest-kf6'
'frameworks/kcoreaddons': '@latest-kf6'
'frameworks/kirigami': '@latest-kf6'
'frameworks/syndication': '@latest-kf6'
'frameworks/ki18n': '@latest-kf6'
'frameworks/kconfig': '@latest-kf6'
'frameworks/threadweaver': '@latest-kf6'
# disable for now since this would pull in kf5 versions of kirigami and ki18n
# 'libraries/kirigami-addons': '@stable'
'third-party/qtkeychain': '@latest'
'third-party/taglib': '@latest'
Options:
require-passing-tests-on: [ 'Linux', 'FreeBSD', 'Windows' ]

View File

@ -18,10 +18,10 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(KF5_MIN_VERSION "5.102.0")
set(KF_MIN_VERSION "5.102.0")
set(QT_MIN_VERSION "5.15.2")
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
find_package(ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
@ -50,9 +50,17 @@ ecm_set_disabled_deprecation_versions(
KF 5.102.0
)
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core Quick Test Gui QuickControls2 Sql Svg)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS I18n CoreAddons Kirigami2 Syndication Config ThreadWeaver)
if (QT_MAJOR_VERSION EQUAL "6")
set(KF_MAJOR_VERSION "6")
else()
set(KF_MAJOR_VERSION "5")
endif()
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core Quick Test Gui QuickControls2 Sql Svg Xml)
find_package(KF${KF_MAJOR_VERSION} ${KF_MIN_VERSION} REQUIRED COMPONENTS I18n CoreAddons Kirigami2 Syndication Config ThreadWeaver)
if (NOT KF_MAJOR_VERSION EQUAL "6") # TODO temporary workaround until kirigami-addons is switched to KF6
find_package(KF5KirigamiAddons 0.7 REQUIRED)
endif()
find_package(Taglib REQUIRED)
find_package(Qt${QT_MAJOR_VERSION}Keychain)
set_package_properties(Qt${QT_MAJOR_VERSION}Keychain PROPERTIES
@ -60,7 +68,7 @@ set_package_properties(Qt${QT_MAJOR_VERSION}Keychain PROPERTIES
PURPOSE "Secure storage of account secrets"
)
find_package(KF5 ${KF5_MIN_VERSION} OPTIONAL_COMPONENTS NetworkManagerQt)
find_package(KF${KF_MAJOR_VERSION} ${KF_MIN_VERSION} OPTIONAL_COMPONENTS NetworkManagerQt)
if (ANDROID)
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS Svg)

View File

@ -161,7 +161,7 @@ add_executable(kasts ${kasts_srcs})
kconfig_add_kcfg_files(kasts settingsmanager.kcfgc GENERATE_MOC)
target_include_directories(kasts PRIVATE ${CMAKE_BINARY_DIR})
target_link_libraries(kasts PRIVATE Qt::Core Qt::Qml Qt::Quick Qt::QuickControls2 Qt::Sql Qt::Svg KF5::Kirigami2 KF5::Syndication KF5::CoreAddons KF5::ConfigGui KF5::I18n Taglib::Taglib KastsSolidExtras ${QTKEYCHAIN_LIBRARIES} KF5::ThreadWeaver KMediaSession)
target_link_libraries(kasts PRIVATE Qt::Core Qt::Qml Qt::Quick Qt::QuickControls2 Qt::Sql Qt::Svg Qt::Xml KF${KF_MAJOR_VERSION}::Kirigami2 KF${KF_MAJOR_VERSION}::Syndication KF${KF_MAJOR_VERSION}::CoreAddons KF${KF_MAJOR_VERSION}::ConfigGui KF${KF_MAJOR_VERSION}::I18n Taglib::Taglib KastsSolidExtras ${QTKEYCHAIN_LIBRARIES} KF${KF_MAJOR_VERSION}::ThreadWeaver KMediaSession)
if(KASTS_FLATPAK)
target_compile_definitions(kasts PUBLIC KASTS_FLATPAK)

View File

@ -6,7 +6,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake" $
option(BUILD_EXAMPLE_PLAYER "Build and install example audio backend player" OFF)
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core Qml Multimedia)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS CoreAddons I18n)
find_package(KF${KF_MAJOR_VERSION} ${KF_MIN_VERSION} REQUIRED COMPONENTS CoreAddons I18n)
if (NOT ANDROID)
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS DBus Widgets)
@ -134,8 +134,8 @@ target_include_directories(KMediaSession PUBLIC ${CMAKE_BINARY_DIR})
target_link_libraries(KMediaSession PUBLIC Qt::Core)
target_link_libraries(KMediaSession PRIVATE
Qt::Multimedia
KF5::CoreAddons
KF5::I18n
KF${KF_MAJOR_VERSION}::CoreAddons
KF${KF_MAJOR_VERSION}::I18n
)
if (LIBVLC_FOUND)

View File

@ -2,7 +2,7 @@
# SPDX-FileCopyrightText: 2022-2023 Bart De Vries <bart@mogwai.be>
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core Qml Gui Multimedia)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS CoreAddons I18n)
find_package(KF${KF_MAJOR_VERSION} ${KF_MIN_VERSION} REQUIRED COMPONENTS CoreAddons I18n)
if (NOT ANDROID)
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS DBus Widgets)
@ -16,8 +16,8 @@ target_link_libraries(kmediasession-example PRIVATE
Qt::Core
Qt::Qml
Qt::Gui
KF5::CoreAddons
KF5::I18n
KF${KF_MAJOR_VERSION}::CoreAddons
KF${KF_MAJOR_VERSION}::I18n
KMediaSession
)

View File

@ -22,7 +22,7 @@ endif()
add_library(KastsSolidExtras ${solidextras_srcs})
generate_export_header(KastsSolidExtras BASE_NAME KastsSolidExtras)
if (TARGET KF5::NetworkManagerQt)
if (TARGET KF${KF_MAJOR_VERSION}::NetworkManagerQt)
set(HAVE_NM ON)
endif()
configure_file(config-solid-extras.h.in ${CMAKE_CURRENT_BINARY_DIR}/config-solid-extras.h)
@ -36,8 +36,8 @@ if (ANDROID)
endif()
else ()
target_link_libraries(KastsSolidExtras PRIVATE Qt::DBus)
if (TARGET KF5::NetworkManagerQt)
target_link_libraries(KastsSolidExtras PRIVATE KF5::NetworkManagerQt)
if (TARGET KF${KF_MAJOR_VERSION}::NetworkManagerQt)
target_link_libraries(KastsSolidExtras PRIVATE KF${KF_MAJOR_VERSION}::NetworkManagerQt)
endif()
endif()