compile_qt() { local ver="$1"; shift $(compile_qt_get_cmd qmake "$ver") PREFIX="/$dir_prefix" build_mode=release build_type=shared $@ make make INSTALL_ROOT="$dir_install" install } compile_qt_get_cmd() { local cmd="$1"; shift local ver="$1" # Some machines don't have cmd-qt4, and use cmd instead. if [ "$ver" = "4" ]; then if command -v "$cmd-qt$ver" > /dev/null; then echo "$cmd-qt$ver" else echo "$cmd" fi else echo "$cmd-qt$ver" fi }