Detect Qt version with CMake
Unsolved
Qt 6
-
According to the documentation (https://doc-snapshots.qt.io/qt6-dev/cmake-qt5-and-qt6-compatibility.html), the following should find Qt 6 first if available, then try Qt 5, however it does the opposite, it finds Qt 5 first:
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
CMake 3.20.2
Qt 6.1.0 -
@Jonas-Kvinge said in Detect Qt version with CMake:
it does the opposite, it finds Qt 5 first
I tested on windows and it actually finds the first one as listed in
PATH
. It's anyway a terrible idea to have multiple versions of Qt added to PATH at the same time