Commit 7f411e6c authored by Volker Krause's avatar Volker Krause Committed by Alexander Lohnau
Browse files

Adapt build system to support Qt6

This builds now with one exception, the use of the deprecated
Plasma::Applet ctor.
parent 280efc80
Pipeline #178810 passed with stage
in 2 minutes and 2 seconds
......@@ -28,7 +28,7 @@ include(KDEGitCommitHooks)
include_directories("${CMAKE_CURRENT_BINARY_DIR}")
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Test Sensors)
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS Test Sensors)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
Config
DBusAddons
......@@ -56,7 +56,9 @@ if(X11_FOUND)
set(HAVE_X11 1)
find_package(X11_XCB REQUIRED)
find_package(XCB REQUIRED COMPONENTS XCB ATOM)
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS X11Extras)
if (QT_MAJOR_VERSION EQUAL "5")
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS X11Extras)
endif()
endif()
configure_file(config-X11.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-X11.h)
......
......@@ -39,7 +39,7 @@ target_link_libraries(kcm_kscreen
kcoreaddons_desktop_to_json(kcm_kscreen "kcm_kscreen.desktop" SERVICE_TYPES kcmodule.desktop)
#this desktop file is installed only for retrocompatibility with sycoca
install(FILES kcm_kscreen.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR})
install(FILES kcm_kscreen.desktop DESTINATION ${KDE_INSTALL_KSERVICESDIR})
install(TARGETS kcm_kscreen DESTINATION ${KDE_INSTALL_PLUGINDIR}/kcms)
......
......@@ -450,3 +450,4 @@ void KCMKScreen::setOutputRetention(int retention)
}
#include "kcm.moc"
#include "moc_kcm.cpp"
......@@ -29,7 +29,12 @@ qt_add_dbus_adaptor(kscreen_daemon_SRCS
add_library(kscreen MODULE ${kscreen_daemon_SRCS})
if(X11_FOUND)
SET(X11_LIBS X11::X11 X11::Xi X11::XCB XCB::ATOM Qt::X11Extras)
SET(X11_LIBS X11::X11 X11::Xi X11::XCB XCB::ATOM)
if (QT_MAJOR_VERSION EQUAL "5")
list(APPEND X11_LIBS Qt5::X11Extras)
else()
list(APPEND X11_LIBS Qt::GuiPrivate)
endif()
endif()
target_link_libraries(kscreen Qt::Widgets
......
......@@ -35,7 +35,11 @@
#include <QTimer>
#if HAVE_X11
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <QX11Info>
#else
#include <private/qtx11extras_p.h>
#endif
#include <X11/Xatom.h>
#include <X11/Xlib-xcb.h>
#include <X11/extensions/XInput.h>
......
......@@ -582,7 +582,7 @@ void testScreenConfig::outputPreset()
// Create the preset
QTemporaryDir dataDir;
qputenv("XDG_DATA_DIRS", dataDir.path().toUtf8());
QStandardPaths::standardLocations(QStandardPaths::DataLocation);
QStandardPaths::standardLocations(QStandardPaths::AppLocalDataLocation);
auto presetOutput = defaultOutput->clone();
presetOutput->setCurrentModeId(QStringLiteral("2"));
presetOutput->setRotation(KScreen::Output::Left);
......
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