qt.sh 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/bin/bash
  2. # Build Qt
  3. set -e
  4. if [ $1 == "release" ]; then
  5. BASEDIR=$PWD/thirdparty/qt-static
  6. OPTIONS="-static"
  7. else
  8. BASEDIR=$PWD/thirdparty/qt
  9. OPTIONS=""
  10. fi
  11. DEPLOYDIR=$BASEDIR/install
  12. QT_MAJOR=6
  13. QT_MINOR=1
  14. QT_BUGFIX=0
  15. URL="https://download.qt.io/official_releases/qt/$QT_MAJOR.$QT_MINOR/$QT_MAJOR.$QT_MINOR.$QT_BUGFIX/single/qt-everywhere-src-$QT_MAJOR.$QT_MINOR.$QT_BUGFIX.tar.xz"
  16. mkdir -p $BASEDIR
  17. if [ -d $DEPLOYDIR ]; then
  18. rm -rf $DEPLOYDIR
  19. fi
  20. mkdir -p $DEPLOYDIR
  21. pushd $BASEDIR
  22. if [ ! -f qt-everywhere-src-$QT_MAJOR.$QT_MINOR.$QT_BUGFIX.tar.xz ]; then
  23. wget $URL
  24. fi
  25. if [ -d "qt-everywhere-src-$QT_MAJOR.$QT_MINOR.$QT_BUGFIX" ]; then
  26. rm -rf "qt-everywhere-src-$QT_MAJOR.$QT_MINOR.$QT_BUGFIX"
  27. fi
  28. tar -xf "qt-everywhere-src-$QT_MAJOR.$QT_MINOR.$QT_BUGFIX.tar.xz"
  29. pushd "qt-everywhere-src-$QT_MAJOR.$QT_MINOR.$QT_BUGFIX"
  30. ./configure $OPTIONS -ltcg -optimize-size -no-pch -prefix $DEPLOYDIR -release -opensource -confirm-license \
  31. -nomake examples -nomake tests -nomake tools \
  32. -skip qtscxml -skip qtwayland -skip qtdatavis3d -skip qtcharts \
  33. -skip qtquickcontrols2 -skip qtvirtualkeyboard -skip qtshadertools \
  34. -skip qttranslations -skip qtdoc -skip qt3d -skip qtnetworkauth \
  35. -skip qt5compat -skip qtcoap -skip qtlottie -skip qtmqtt \
  36. -skip qtopcua -skip qtquick3d -skip qtquicktimeline -skip qttools \
  37. -skip qtdeclarative -skip qtactiveqt
  38. cmake --build . --parallel
  39. cmake --install .
  40. popd