QT_MINOR_VERSION="`expr $QT_VERSION : '[0-9][0-9]*\.\([0-9][0-9]*\).*'`"
QT_DOTDOT_VERSION="`expr $QT_VERSION : '[0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\).*'`"
QT_MAJOR_MINOR_VERSION=$QT_MAJOR_VERSION.$QT_MINOR_VERSION
+ QT_MAJOR_MINOR_DOTDOT_VERSION=$QT_MAJOR_VERSION.$QT_MINOR_VERSION.$QT_DOTDOT_VERSION
fi
# In case we want to build GTK *and* we don't have Apple's X11 SDK installed
# 3) it can't be run from the command line;
#
# so we do it ourselves.
- #
+ #
for i in ccmake cmake cmake-gui cmakexbuild cpack ctest
do
sudo ln -s /Applications/CMake.app/Contents/bin/$i /usr/local/bin/$i
# What you get for this URL might just be a 302 Found reply, so use
# -L so we get redirected.
#
- [ -f qt-opensource-mac-x64-clang-$QT_VERSION.dmg ] || curl -L -O http://download.qt.io/archive/qt/$QT_MAJOR_MINOR_VERSION/$QT_VERSION/qt-opensource-mac-x64-clang-$QT_VERSION.dmg || exit 1
- sudo hdiutil attach qt-opensource-mac-x64-clang-$QT_VERSION.dmg || exit 1
+ if [ "$QT_MAJOR_VERSION" -ge 5 ]
+ then
+ QT_VOLUME=qt-opensource-mac-x64-clang-$QT_VERSION
+ else
+ QT_VOLUME=qt-opensource-mac-$QT_VERSION
+ fi
+ [ -f $QT_VOLUME.dmg ] || curl -L -O http://download.qt.io/archive/qt/$QT_MAJOR_MINOR_VERSION/$QT_MAJOR_MINOR_DOTDOT_VERSION/$QT_VOLUME.dmg || exit 1
+ sudo hdiutil attach $QT_VOLUME.dmg || exit 1
- #
- # Run the executable directly, so that we wait for it to finish.
- #
- /Volumes/qt-opensource-mac-x64-clang-$QT_VERSION/qt-opensource-mac-x64-clang-$QT_VERSION.app/Contents/MacOS/qt-opensource-mac-x64-clang-$QT_VERSION
- sudo hdiutil detach /Volumes/qt-opensource-mac-x64-clang-$QT_VERSION
+ if [ "$QT_MAJOR_VERSION" -ge 5 ]
+ then
+ #
+ # Run the installer executable directly, so that we wait for
+ # it to finish. Then unmount the volume.
+ #
+ /Volumes/$QT_VOLUME/$QT_VOLUME.app/Contents/MacOS/$QT_VOLUME
+ sudo hdiutil detach /Volumes/$QT_VOLUME
+ else
+ #
+ # Open the installer package; use -W, so that we wait for
+ # the installer to finish. Then unmount the volume.
+ #
+ open -W "/Volumes/Qt $QT_MAJOR_MINOR_DOTDOT_VERSION/Qt.mpkg"
+ sudo hdiutil detach "/Volumes/Qt $QT_MAJOR_MINOR_DOTDOT_VERSION"
+ fi
#
# Versions 5.3.x through 5.5.0, at least, have bogus .pc files.