Commit 09384d4d authored by Volker Krause's avatar Volker Krause
Browse files

Adapt build system to support Qt6 as well

This will obviously not actually run yet out of the box, but it is
useful nevertheless for exploring what we are still missing for a
Kirigami port to Qt6.
parent ca484dcf
Pipeline #207454 passed with stage
in 3 minutes and 49 seconds
......@@ -6,3 +6,4 @@ include:
- https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/freebsd.yml
- https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/android.yml
- https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/windows.yml
- https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/linux-qt6.yml
......@@ -18,10 +18,6 @@ find_package(ECM ${KF5_DEP_VERSION} REQUIRED)
# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS Core Quick Gui Svg QuickControls2)
find_package(KF5 ${KF5_DEP_VERSION} REQUIRED COMPONENTS Kirigami2 ItemModels)
option(ENABLE_QML_PROFILING "Enable QML profiler support" ON)
include(FeatureSummary)
......@@ -31,8 +27,14 @@ include(KDECompilerSettings NO_POLICY_SCOPE)
include(ECMPoQmTools)
include(ECMQMLModules)
find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS Core Quick Gui Svg QuickControls2)
find_package(KF5 ${KF5_DEP_VERSION} REQUIRED COMPONENTS Kirigami2 ItemModels)
if(ANDROID)
find_package(Qt5AndroidExtras ${REQUIRED_QT_VERSION} REQUIRED)
else()
find_package(Qt${QT_MAJOR_VERSION}Widgets ${REQUIRED_QT_VERSION} REQUIRED)
endif()
ecm_find_qmlmodule(QtGraphicalEffects 1.0)
......
......@@ -31,14 +31,16 @@ add_executable(kirigami2gallery
main.cpp
InfoData.cpp
resources.qrc)
target_link_libraries(kirigami2gallery Qt5::Core Qt5::Qml Qt5::Quick Qt5::Svg Qt5::QuickControls2 KF5::Kirigami2 KF5::ItemModels)
target_link_libraries(kirigami2gallery Qt::Core Qt::Qml Qt::Quick Qt::Svg Qt::QuickControls2 KF5::Kirigami2 KF5::ItemModels)
if (ANDROID)
target_link_libraries(kirigami2gallery Qt5::AndroidExtras)
kirigami_package_breeze_icons(ICONS applications-graphics view-list-icons folder-sync view-list-details configure document-edit dialog-information dialog-positive dialog-warning dialog-error dialog-cancel document-decrypt system-run mail-reply-sender bookmarks folder media-record-symbolic add-placemark address-book-new-symbolic view-right-new view-right-close documentinfo go-home)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/android/version.gradle.in ${CMAKE_BINARY_DIR}/version.gradle)
else()
target_link_libraries(kirigami2gallery Qt::Widgets)
endif()
install(TARGETS kirigami2gallery ${KF5_INSTALL_TARGETS_DEFAULT_ARGS})
install(FILES data/metadata.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} RENAME org.kde.kirigami2.gallery.desktop)
install(TARGETS kirigami2gallery ${KF_INSTALL_TARGETS_DEFAULT_ARGS})
install(FILES data/metadata.desktop DESTINATION ${KDE_INSTALL_APPDIR} RENAME org.kde.kirigami2.gallery.desktop)
Supports Markdown
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