Commit 97a19dad authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Adapt build system for building against qt6

parent 9e266fab
Pipeline #117326 failed with stage
in 3 minutes and 44 seconds
......@@ -9,7 +9,7 @@ set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE
project(KSystemlog VERSION ${RELEASE_SERVICE_VERSION})
set (QT_MIN_VERSION "5.15.0")
set (KF5_MIN_VERSION "5.89.0")
set (KF5_MIN_VERSION "5.90.0")
find_package (ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
......@@ -33,7 +33,7 @@ kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
ecm_setup_version(${RELEASE_SERVICE_VERSION} VARIABLE_PREFIX KSYSTEMLOG
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/src/ksystemlog_version.h")
find_package (Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
find_package (Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
Concurrent
Core
Network
......@@ -41,6 +41,9 @@ find_package (Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
Test
PrintSupport
)
if (QT_MAJOR_VERSION STREQUAL "6")
find_package(Qt6Core5Compat)
endif()
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
XmlGui
......@@ -102,8 +105,8 @@ if (${AUDIT_FOUND})
endif (${AUDIT_FOUND})
########### Subfolders ##########
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x060000)
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f02)
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055900)
add_subdirectory(src)
......
......@@ -14,7 +14,7 @@ include_directories(
add_library(testCore STATIC testUtil.cpp testResources.qrc )
target_link_libraries(testCore PUBLIC
Qt::Test
Qt${QT_MAJOR_VERSION}::Test
ksystemlog_lib
ksystemlog_base_mode
ksystemlog_config
......
......@@ -84,4 +84,4 @@ install(TARGETS ksystemlog ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
install(PROGRAMS org.kde.ksystemlog.desktop DESTINATION ${KDE_INSTALL_APPDIR})
install(FILES org.kde.ksystemlog.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
install(FILES ksystemlogui.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/ksystemlog)
install(FILES ksystemlogui.rc DESTINATION ${KDE_INSTALL_KXMLGUIDIR}/ksystemlog)
......@@ -50,8 +50,8 @@ add_dependencies(
target_link_libraries(ksystemlog_lib
ksystemlog_config
Qt::Widgets
Qt::PrintSupport
Qt${QT_MAJOR_VERSION}::Widgets
Qt${QT_MAJOR_VERSION}::PrintSupport
KF5::I18n
KF5::Archive
KF5::WidgetsAddons
......
......@@ -351,12 +351,23 @@ void MainWindow::changeResumePauseAction(bool paused)
}
// Be sure that the button will always have a good size
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
const auto associatedWidgets{mResumePauseAction->associatedWidgets()};
for (QWidget *widget : associatedWidgets) {
if (widget->sizeHint().width() > widget->size().width()) {
widget->setMinimumSize(widget->sizeHint());
}
}
#else
const auto associatedWidgets{mResumePauseAction->associatedObjects()};
for (QObject *obj : associatedWidgets) {
QWidget *widget = qobject_cast<QWidget *>(obj);
if (widget && (widget->sizeHint().width() > widget->size().width())) {
widget->setMinimumSize(widget->sizeHint());
}
}
#endif
}
void MainWindow::fileOpen()
......
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