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.
This commit is contained in:
Oliver Stöneberg 2023-08-09 22:40:15 +02:00 committed by GitHub
parent 24479c60f9
commit de9795b07b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 10 deletions

View File

@ -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()

View File

@ -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

View File

@ -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

View File

@ -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.