Commit b4a129aa authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Adapt build system for building against qt6 + fix compile error

parent 5fc769e0
Pipeline #116196 passed with stage
in 57 seconds
......@@ -13,7 +13,7 @@ set(KONQUEST_VERSION "${KONQUEST_BASE_VERSION}.${RELEASE_SERVICE_COMPACT_VERSION
project(konquest VERSION ${KONQUEST_VERSION})
set (QT_MIN_VERSION "5.15.0")
set (KF5_MIN_VERSION "5.85.0")
set (KF5_MIN_VERSION "5.90.0")
find_package(ECM ${KF5_MIN_VERSION} REQUIRED CONFIG)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
......@@ -27,7 +27,12 @@ include(ECMInstallIcons)
include(ECMSetupVersion)
include(FeatureSummary)
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Widgets Svg)
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Widgets Svg)
find_package(Qt${QT_MAJOR_VERSION}QuickWidgets ${REQUIRED_QT_VERSION} CONFIG)
if (QT_MAJOR_VERSION STREQUAL "6")
find_package(Qt6StateMachine ${REQUIRED_QT_VERSION} CONFIG)
endif()
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
Config
CoreAddons
......@@ -45,7 +50,7 @@ find_package(KF5KDEGames 7.3.0 REQUIRED)
add_definitions(
-DQT_DISABLE_DEPRECATED_BEFORE=0x050F00
-DQT_DEPRECATED_WARNINGS_SINCE=0x060000
-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055600
-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055900
-DKF_DEPRECATED_WARNINGS_SINCE=0x060000
)
......
......@@ -72,8 +72,11 @@ target_link_libraries(konquest
KF5::I18n
KF5::XmlGui
KF5::WidgetsAddons
Qt::Svg
Qt${QT_MAJOR_VERSION}::Svg
)
if (QT_MAJOR_VERSION STREQUAL "6")
target_link_libraries(konquest Qt6::StateMachine)
endif()
install(TARGETS konquest ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
......
......@@ -430,9 +430,11 @@ AiBecai::play()
// Process the first few possible targets from the target list. As this
// is a priority list, only consider the first few ones and do not
// process possible targets with low priority (high score).
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QMapIterator<double, TargetPlanet> targetListIt(targetList);
#else
QMultiMapIterator<double, TargetPlanet> targetListIt(targetList);
#endif
int skipCount = 3;
while (targetListIt.hasNext() && (skipCount > 0)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment