Skip to content

Commit de9795b

Browse files
authored
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.
1 parent 24479c6 commit de9795b

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

cmake/findDependencies.cmake

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,10 @@ if (BUILD_GUI)
77
list(APPEND qt_components Test)
88
endif()
99
if (USE_QT6)
10-
find_package(Qt6 COMPONENTS ${qt_components} QUIET)
11-
endif()
12-
if (NOT Qt6Core_FOUND)
13-
find_package(Qt5 COMPONENTS ${qt_components} REQUIRED)
14-
set(QT_VERSION "${Qt5Core_VERSION_STRING}")
15-
else()
16-
# detect faulty Qt6 installation by jurplel/install-qt-action@v2
17-
if (WITH_QCHART AND NOT Qt6Charts_FOUND)
18-
message(FATAL_ERROR "QtCharts not found")
19-
endif()
10+
find_package(Qt6 COMPONENTS ${qt_components} REQUIRED)
2011
set(QT_VERSION "${Qt6Core_VERSION_STRING}")
2112
if (NOT QT_VERSION)
13+
# TODO: how to get the actual version?
2214
message(WARNING "'Qt6Core_VERSION_STRING' is not set - using 6.0.0 as fallback")
2315
set(QT_VERSION "6.0.0")
2416
endif()
@@ -31,6 +23,9 @@ if (BUILD_GUI)
3123
# https://bugreports.qt.io/browse/QTBUG-86395
3224
set(DISABLE_CRTDBG_MAP_ALLOC ON)
3325
endif()
26+
else()
27+
find_package(Qt5 COMPONENTS ${qt_components} REQUIRED)
28+
set(QT_VERSION "${Qt5Core_VERSION_STRING}")
3429
endif()
3530
endif()
3631

gui/gui.pro

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
lessThan(QT_MAJOR_VERSION, 5): error(requires >= Qt 5 (You used: $$QT_VERSION))
2+
greaterThan(QT_MAJOR_VERSION, 5): error(Qt 6 is not supported via qmake - please use CMake instead)
3+
4+
message("Building the GUI via qmake is deprecated and will be removed in a future release. Please use CMake instead.")
25

36
TEMPLATE = app
47
TARGET = cppcheck-gui

readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ cmake --build . --config RelWithDebInfo
8686

8787
### qmake
8888

89+
NOTE: This has been deprecated and will be removed in a future version. Please use CMake instead.
90+
8991
You can use the gui/gui.pro file to build the GUI.
9092

9193
```shell

releasenotes.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,8 @@ GUI:
88

99
Changed interface:
1010

11+
Deprecations:
12+
- The qmake build system has been deprecated and will be removed in a future version.
13+
1114
Other:
15+
- "USE_QT6=On" will no longer fallback to Qt5 when Qt6 is not found.

0 commit comments

Comments
 (0)