qb: Improve moc detection (#6680)

This commit is contained in:
orbea 2018-05-01 09:40:42 -08:00 committed by bparker06
parent 20cb92c185
commit b2f508d72e
2 changed files with 15 additions and 9 deletions

View File

@ -270,7 +270,7 @@ check_val '' PULSE -lpulse
check_val '' SDL -lSDL SDL
check_val '' SDL2 -lSDL2 SDL2
if [ "$HAVE_QT" != 'no' ]; then
if [ "$HAVE_QT" != 'no' ] && [ "$MOC_PATH" != 'none' ]; then
check_pkgconf QT5CORE Qt5Core 5.2
check_pkgconf QT5GUI Qt5Gui 5.2
check_pkgconf QT5WIDGETS Qt5Widgets 5.2

View File

@ -86,14 +86,20 @@ fi
if [ "$HAVE_QT" != "no" ]; then
echobuf="Checking for moc"
if [ -z "$MOC" ]; then
MOC="$(exists "moc")" || MOC=""
if [ -z "$MOC" ]; then
die : "$echobuf ... Not found."
else
echo "$echobuf ... $MOC"
fi
else
echo "$echobuf ... $MOC"
MOC_PATH="none"
for moc in moc-qt5 moc; do
MOC="$(exists "$moc")" || MOC=""
[ "${MOC}" ] && {
MOC_PATH="$MOC"
break
}
done
fi
echo "$echobuf ... $MOC_PATH"
if [ "$MOC_PATH" = "none" ]; then
die : 'Warning: moc not found, Qt companion support will be disabled.'
fi
fi