Commit 2761360f authored by Laurent Montel's avatar Laurent Montel
Browse files

Make if compile against qt6

parent d6de6b08
Pipeline #129785 passed with stage
in 50 seconds
......@@ -7,7 +7,7 @@ project(plasma-disks)
set(PROJECT_VERSION "5.24.80")
set(QT_MIN_VERSION "5.15.0")
set(KF5_MIN_VERSION "5.86")
set(KF5_MIN_VERSION "5.90")
set(KDE_COMPILERSETTINGS_LEVEL "5.82")
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
......@@ -25,7 +25,7 @@ include(KDEClangFormat)
include(FeatureSummary)
include(KDEGitCommitHooks)
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Gui Core)
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Gui Core)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
CoreAddons
DBusAddons
......
# SPDX-License-Identifier: BSD-3-Clause
# SPDX-FileCopyrightText: 2020 Harald Sitter <sitter@kde.org>
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Test)
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Test)
remove_definitions(-DQT_NO_CAST_FROM_ASCII)
include(ECMAddTests)
ecm_add_test(smartdatatest.cpp TEST_NAME smartdatatest
LINK_LIBRARIES Qt::Test statickdedsmart)
LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test statickdedsmart)
ecm_add_test(smartmonitortest.cpp TEST_NAME smartmonitortest
LINK_LIBRARIES Qt::Test statickdedsmart)
LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test statickdedsmart)
ecm_add_test(devicetest.cpp TEST_NAME devicetest
LINK_LIBRARIES Qt::Test statickdedsmart)
LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test statickdedsmart)
......@@ -34,13 +34,14 @@ ecm_qt_declare_logging_category(
)
add_library(statickdedsmart STATIC ${kded_SRCS})
set_property(TARGET statickdedsmart PROPERTY POSITION_INDEPENDENT_CODE ON)
target_include_directories(statickdedsmart
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_CURRENT_BINARY_DIR}>")
target_link_libraries(statickdedsmart
PUBLIC
Qt::Core
Qt::DBus
Qt${QT_MAJOR_VERSION}::Core
Qt${QT_MAJOR_VERSION}::DBus
KF5::Solid
KF5::I18n
KF5::Notifications
......@@ -55,7 +56,7 @@ add_library(kded-smart MODULE main.cpp)
kcoreaddons_desktop_to_json(kded-smart smart.desktop)
set_target_properties(kded-smart PROPERTIES OUTPUT_NAME smart)
target_link_libraries(kded-smart statickdedsmart)
install(TARGETS kded-smart DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf5/kded)
install(TARGETS kded-smart DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf${QT_MAJOR_VERSION}/kded)
kauth_install_actions(org.kde.kded.smart org.kde.kded.smart.actions)
add_executable(kded-smart-helper helper.cpp)
......@@ -64,6 +65,6 @@ target_link_libraries(kded-smart-helper KF5::AuthCore KF5::ConfigCore KF5::I18n)
kauth_install_helper_files(kded-smart-helper org.kde.kded.smart root)
install(TARGETS kded-smart-helper DESTINATION ${KAUTH_HELPER_INSTALL_DIR})
install(FILES org.kde.kded.smart.notifyrc DESTINATION ${KNOTIFYRC_INSTALL_DIR})
install(FILES org.kde.kded.smart.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFYRCDIR})
add_subdirectory(kcm)
......@@ -16,7 +16,7 @@ set(kcm_SRCS
# we'll not have access to them here as cmake claims
# No rule to make target 'src/org.kde.smart.Device.xml'
# Instead generate the xmls (again) here...
qt5_generate_dbus_interface(../device.h org.kde.kded.smart.Device.xml)
qt_generate_dbus_interface(../device.h org.kde.kded.smart.Device.xml)
qt_add_dbus_interface(kcm_SRCS ${CMAKE_CURRENT_BINARY_DIR}/org.kde.kded.smart.Device.xml org.kde.kded.smart.Device)
qt_add_dbus_interface(kcm_SRCS org.freedesktop.DBus.Properties.xml org.freedesktop.DBus.Properties)
......@@ -35,7 +35,7 @@ target_link_libraries(plasma_disks_kcm
KF5::CoreAddons
KF5::I18n
KF5::QuickAddons
Qt::DBus
Qt${QT_MAJOR_VERSION}::DBus
KF5::Solid)
kcoreaddons_desktop_to_json(plasma_disks_kcm smart.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