From de9795b07b8ec35ece72a28847eefc51fa8a5f1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20St=C3=B6neberg?= Date: Wed, 9 Aug 2023 22:40:15 +0200 Subject: [PATCH] deprecated qmake build system / removed Qt5 fallback when using `USE_QT6=On` (#5271) QT 5 is now completely EOL and since we never supported Qt6 in qmake which also has various shortcomings, it is time to at least deprecate it and direct users to CMake instead. --- cmake/findDependencies.cmake | 15 +++++---------- gui/gui.pro | 3 +++ readme.md | 2 ++ releasenotes.txt | 4 ++++ 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/cmake/findDependencies.cmake b/cmake/findDependencies.cmake index 3ad0e366f21..6f31bff00e4 100644 --- a/cmake/findDependencies.cmake +++ b/cmake/findDependencies.cmake @@ -7,18 +7,10 @@ if (BUILD_GUI) list(APPEND qt_components Test) endif() if (USE_QT6) - find_package(Qt6 COMPONENTS ${qt_components} QUIET) - endif() - if (NOT Qt6Core_FOUND) - find_package(Qt5 COMPONENTS ${qt_components} REQUIRED) - set(QT_VERSION "${Qt5Core_VERSION_STRING}") - else() - # detect faulty Qt6 installation by jurplel/install-qt-action@v2 - if (WITH_QCHART AND NOT Qt6Charts_FOUND) - message(FATAL_ERROR "QtCharts not found") - endif() + find_package(Qt6 COMPONENTS ${qt_components} REQUIRED) set(QT_VERSION "${Qt6Core_VERSION_STRING}") if (NOT QT_VERSION) + # TODO: how to get the actual version? message(WARNING "'Qt6Core_VERSION_STRING' is not set - using 6.0.0 as fallback") set(QT_VERSION "6.0.0") endif() @@ -31,6 +23,9 @@ if (BUILD_GUI) # https://bugreports.qt.io/browse/QTBUG-86395 set(DISABLE_CRTDBG_MAP_ALLOC ON) endif() + else() + find_package(Qt5 COMPONENTS ${qt_components} REQUIRED) + set(QT_VERSION "${Qt5Core_VERSION_STRING}") endif() endif() diff --git a/gui/gui.pro b/gui/gui.pro index 186426dae81..b3d4c9da97e 100644 --- a/gui/gui.pro +++ b/gui/gui.pro @@ -1,4 +1,7 @@ lessThan(QT_MAJOR_VERSION, 5): error(requires >= Qt 5 (You used: $$QT_VERSION)) +greaterThan(QT_MAJOR_VERSION, 5): error(Qt 6 is not supported via qmake - please use CMake instead) + +message("Building the GUI via qmake is deprecated and will be removed in a future release. Please use CMake instead.") TEMPLATE = app TARGET = cppcheck-gui diff --git a/readme.md b/readme.md index ccb6ae17d10..5094fa050cd 100644 --- a/readme.md +++ b/readme.md @@ -86,6 +86,8 @@ cmake --build . --config RelWithDebInfo ### qmake +NOTE: This has been deprecated and will be removed in a future version. Please use CMake instead. + You can use the gui/gui.pro file to build the GUI. ```shell diff --git a/releasenotes.txt b/releasenotes.txt index 225e5b67917..11e93c23959 100644 --- a/releasenotes.txt +++ b/releasenotes.txt @@ -8,4 +8,8 @@ GUI: Changed interface: +Deprecations: +- The qmake build system has been deprecated and will be removed in a future version. + Other: +- "USE_QT6=On" will no longer fallback to Qt5 when Qt6 is not found.