build-system: make -build-with-qt6 work

-build-with-qt6 did not work for me, because the flag is
ignored when selecting the qmake executable. It would find
the system-wide qmake executable, which is Qt5 and then
decide to build with Qt5.

When the flag is set, try to search for a Qt6 version of
qmake first. On Ubuntu based distros this seems to be
qmake6

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2022-11-13 18:59:44 +01:00 committed by Dirk Hohndel
parent 741099bdbb
commit 2112bd8e08

View file

@ -253,7 +253,9 @@ if [ -n "$CMAKE_PREFIX_PATH" ] ; then
QMAKE=$CMAKE_PREFIX_PATH/../../bin/qmake
fi
if [[ -z $QMAKE || ! -x $QMAKE ]] ; then
hash qmake > /dev/null 2> /dev/null && QMAKE=qmake
[ -z $QMAKE ] && [ "$BUILD_WITH_QT6" = "1" ] && hash qmake6 > /dev/null 2> /dev/null && QMAKE=qmake6
[ -z $QMAKE ] && [ "$BUILD_WITH_QT6" = "1" ] && hash qmake-qt6 > /dev/null 2> /dev/null && QMAKE=qmake-qt6
[ -z $QMAKE ] && hash qmake > /dev/null 2> /dev/null && QMAKE=qmake
[ -z $QMAKE ] && hash qmake-qt5 > /dev/null 2> /dev/null && QMAKE=qmake-qt5
[ -z $QMAKE ] && hash qmake-qt6 > /dev/null 2> /dev/null && QMAKE=qmake-qt6
[ -z $QMAKE ] && echo "cannot find qmake, qmake-qt5, or qmake-qt6" && exit 1