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

Adapt build system for building against qt6

parent 183ac591
Pipeline #121006 passed with stage
in 35 seconds
......@@ -37,7 +37,10 @@ ecm_setup_version(PROJECT VARIABLE_PREFIX KPKPASS
set(QT_REQUIRED_VERSION "5.15.2")
find_package(Qt5 ${QT_REQUIRED_VERSION} REQUIRED COMPONENTS Gui)
find_package(Qt${QT_MAJOR_VERSION} ${QT_REQUIRED_VERSION} REQUIRED COMPONENTS Gui)
if (QT_MAJOR_VERSION STREQUAL "6")
find_package(Qt6Core5Compat)
endif()
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Archive)
find_package(SharedMimeInfo 1.3 REQUIRED)
......
......@@ -2,8 +2,8 @@
# SPDX-FileCopyrightText: 2021-2022 Laurent Montel <montel@kde.org>
# SPDX-License-Identifier: BSD-3-Clause
find_package(Qt5Test ${QT_REQUIRED_VERSION} CONFIG REQUIRED)
find_package(Qt${QT_MAJOR_VERSION}Test ${QT_REQUIRED_VERSION} CONFIG REQUIRED)
add_definitions(-DSOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
ecm_add_test(pkpasstest.cpp LINK_LIBRARIES Qt::Test KPim::PkPass)
ecm_add_test(fieldtest.cpp LINK_LIBRARIES Qt::Test KPim::PkPass)
ecm_add_test(pkpasstest.cpp LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test KPim::PkPass)
ecm_add_test(fieldtest.cpp LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test KPim::PkPass)
......@@ -36,11 +36,15 @@ set_target_properties(KPimPkPass PROPERTIES
target_include_directories(KPimPkPass INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_PIM}>")
target_link_libraries(KPimPkPass
PUBLIC
Qt::Gui
Qt${QT_MAJOR_VERSION}::Gui
PRIVATE
KF5::Archive
)
if (TARGET Qt6::Core5Compat)
target_link_libraries(KPimPkPass PRIVATE Qt6::Core5Compat) # QTextCodec
endif()
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(KPimPkPass PROPERTIES UNITY_BUILD ON)
endif()
......
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