diff --git a/cmake/findDependencies.cmake b/cmake/findDependencies.cmake index 3ad0e366f..6f31bff00 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 186426dae..b3d4c9da9 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 ccb6ae17d..5094fa050 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 225e5b679..11e93c239 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.