Skip to content

Commit

Permalink
deprecated qmake build system / removed Qt5 fallback when using `USE_…
Browse files Browse the repository at this point in the history
…QT6=On` (danmar#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.
  • Loading branch information
firewave authored Aug 9, 2023
1 parent 24479c6 commit de9795b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
15 changes: 5 additions & 10 deletions cmake/findDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()

Expand Down
3 changes: 3 additions & 0 deletions gui/gui.pro
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 2 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions releasenotes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit de9795b

Please sign in to comment.