Commit 9676833e authored by Volker Krause's avatar Volker Krause
Browse files

Enable building with Qt6

parent db6b1042
Pipeline #185671 passed with stage
in 1 minute and 33 seconds
......@@ -7,3 +7,5 @@ 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
- https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/android-qt6.yml
......@@ -18,8 +18,11 @@ include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(ECMAddTests)
include(ECMGenerateHeaders)
include(ECMQtDeclareLoggingCategory)
if (ECM_FIND_VERSION VERSION_GREATER_EQUAL 5.91)
if (ECM_VERSION VERSION_GREATER_EQUAL 5.91)
include(ECMDeprecationSettings)
else()
# backward compatibility for ECM versions without QtVersionOption.cmake
set(QT_MAJOR_VERSION 5)
endif()
include(ECMSetupVersion)
include(FeatureSummary)
......@@ -49,14 +52,14 @@ else()
set(REQUIRED_QT_VERSION 5.14) # 5.14 for QCalendar
endif()
find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS Core) # 5.14 for QCalendar
find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG QUIET OPTIONAL_COMPONENTS Qml)
find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS Core) # 5.14 for QCalendar
find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} CONFIG QUIET OPTIONAL_COMPONENTS Qml)
if (NOT VALIDATOR_ONLY)
find_package(KF5 5.77 REQUIRED COMPONENTS Holidays I18n)
endif()
if (BUILD_TESTING)
find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS Test)
find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS Test)
endif()
find_package(FLEX REQUIRED)
......
......@@ -4,6 +4,6 @@
@PACKAGE_INIT@
include(CMakeFindDependencyMacro)
find_dependency(Qt5Core)
find_dependency(Qt@QT_MAJOR_VERSION@Core)
include("${CMAKE_CURRENT_LIST_DIR}/KOpeningHoursTargets.cmake")
......@@ -3,12 +3,12 @@
add_definitions(-DSOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}") # TODO use QFINDTESTDATA instead
ecm_add_test(parsertest.cpp LINK_LIBRARIES Qt5::Test KOpeningHours)
ecm_add_test(jsonldtest.cpp LINK_LIBRARIES Qt5::Test KOpeningHours)
ecm_add_test(parsertest.cpp LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test KOpeningHours)
ecm_add_test(jsonldtest.cpp LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test KOpeningHours)
if (NOT VALIDATOR_ONLY)
ecm_add_test(intervaltest.cpp LINK_LIBRARIES Qt5::Test KOpeningHours)
ecm_add_test(eastertest.cpp LINK_LIBRARIES Qt5::Test KOpeningHours)
ecm_add_test(evaluatetest.cpp LINK_LIBRARIES Qt5::Test KOpeningHours)
ecm_add_test(iterationtest.cpp LINK_LIBRARIES Qt5::Test KOpeningHours)
ecm_add_test(intervalmodeltest.cpp LINK_LIBRARIES Qt5::Test KOpeningHours)
ecm_add_test(intervaltest.cpp LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test KOpeningHours)
ecm_add_test(eastertest.cpp LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test KOpeningHours)
ecm_add_test(evaluatetest.cpp LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test KOpeningHours)
ecm_add_test(iterationtest.cpp LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test KOpeningHours)
ecm_add_test(intervalmodeltest.cpp LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test KOpeningHours)
endif()
......@@ -4,6 +4,6 @@
add_definitions(-DTRANSLATION_DOMAIN=\"kopeninghours\")
add_subdirectory(lib)
if (TARGET Qt5::Qml AND NOT VALIDATOR_ONLY)
if (TARGET Qt${QT_MAJOR_VERSION}::Qml AND NOT VALIDATOR_ONLY)
add_subdirectory(qml)
endif()
......@@ -53,7 +53,7 @@ set_target_properties(KOpeningHours PROPERTIES
)
target_link_libraries(KOpeningHours
PUBLIC
Qt5::Core
Qt${QT_MAJOR_VERSION}::Core
)
if (VALIDATOR_ONLY)
target_compile_definitions(KOpeningHours PUBLIC KOPENINGHOURS_VALIDATOR_ONLY)
......
......@@ -3,7 +3,7 @@
add_library(kopeninghoursqmlplugin kopeninghoursqmlplugin.cpp)
target_link_libraries(kopeninghoursqmlplugin
Qt5::Qml
Qt${QT_MAJOR_VERSION}::Qml
KOpeningHours
)
......
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