Adapt build system for building against qt6

This commit is contained in:
Laurent Montel 2022-05-13 08:27:13 +02:00
parent 5f127460c7
commit 2da23eae0a
2 changed files with 11 additions and 9 deletions

View file

@ -41,15 +41,15 @@ include(FeatureSummary)
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED
Core
Qml
Quick
QuickCompiler
)
if (QUICK_COMPILER)
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED QuickCompiler)
if (QT_MAJOR_VERSION STREQUAL "5")
if (QUICK_COMPILER)
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED QuickCompiler)
endif()
endif()
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS

View file

@ -20,13 +20,15 @@ set(mobileshellplugin_SRCS
homescreen/favoritesmodel.cpp
taskswitcher/displaysmodel.cpp
)
if(QUICK_COMPILER)
qtquick_compiler_add_resources(RESOURCES resources.qrc)
if (QT_MAJOR_VERSION STREQUAL "5")
if(QUICK_COMPILER)
qtquick_compiler_add_resources(RESOURCES resources.qrc)
else()
qt5_add_resources(RESOURCES resources.qrc)
endif()
else()
qt5_add_resources(RESOURCES resources.qrc)
endif()
add_library(mobileshellplugin SHARED ${mobileshellplugin_SRCS} ${RESOURCES})
target_link_libraries(mobileshellplugin