Commit 0a640067 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Adapt build system for building against qt6. Need to adapt code as it still...

Adapt build system for building against qt6. Need to adapt code as it still uses against kdegame private api
parent 121c4bb6
......@@ -9,12 +9,17 @@ set(RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_
project(kblocks VERSION ${RELEASE_SERVICE_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} )
include(KDEInstallDirs)
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Test Widgets Svg Network)
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Test Widgets Svg Network)
find_package(Qt${QT_MAJOR_VERSION}QuickWidgets ${REQUIRED_QT_VERSION} CONFIG)
if (QT_MAJOR_VERSION STREQUAL "6")
find_package(Qt6 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS SvgWidgets)
endif()
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
Config
ConfigWidgets
......@@ -31,7 +36,6 @@ find_package(KF5KDEGames 7.1.0 REQUIRED)
include(FeatureSummary)
include(ECMInstallIcons)
include(KDEInstallDirs)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(KDECMakeSettings)
include(ECMAddAppIcon)
......
......@@ -5,41 +5,41 @@ include_directories(AFTER "${CMAKE_CURRENT_SOURCE_DIR}/../src")
ecm_add_test(
basic.cpp
TEST_NAME basic
LINK_LIBRARIES Qt::Test
LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test
NAME_PREFIX "UnitTest-"
)
ecm_add_test(
test_KBlocksGameLogic.cpp
TEST_NAME KBlocksGameLogic
LINK_LIBRARIES Qt::Test KBlocksCore
LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test KBlocksCore
NAME_PREFIX "UnitTest-"
)
ecm_add_test(
test_KBlocksItemGroup.cpp
TEST_NAME KBlocksItemGroup
LINK_LIBRARIES Qt::Test KBlocksCore
LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test KBlocksCore
NAME_PREFIX "UnitTest-"
)
ecm_add_test(
test_KBlocksScene.cpp
TEST_NAME KBlocksScene
LINK_LIBRARIES Qt::Test KBlocksCore
LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test KBlocksCore
NAME_PREFIX "UnitTest-"
)
ecm_add_test(
test_KBlocksWin.cpp
TEST_NAME KBlocksWin
LINK_LIBRARIES Qt::Test KBlocksCore KBlocksTesting
LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test KBlocksCore KBlocksTesting
NAME_PREFIX "UnitTest-"
)
ecm_add_test(
test_View-Scene.cpp
TEST_NAME View-Scene
LINK_LIBRARIES Qt::Test KBlocksCore
LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test KBlocksCore
NAME_PREFIX "IntegrationTest-"
)
......@@ -118,12 +118,14 @@ add_library(KBlocksCore STATIC ${kblockscore_SRCS})
target_link_libraries(KBlocksCore
KF5KDEGames
KF5KDEGamesPrivate
Qt::Network
Qt${QT_MAJOR_VERSION}::Network
KF5::Crash
KF5::DBusAddons
KF5::XmlGui
KF5::I18n
Qt::Svg
Qt${QT_MAJOR_VERSION}::Svg
)
if (QT_MAJOR_VERSION STREQUAL "6")
target_link_libraries(KBlocksCore Qt6::SvgWidgets)
endif()
add_subdirectory(Testing)
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