diff --git a/.github/workflows/CreateRelease.yml b/.github/workflows/CreateRelease.yml index 31c439eae..5928d8047 100644 --- a/.github/workflows/CreateRelease.yml +++ b/.github/workflows/CreateRelease.yml @@ -9,6 +9,8 @@ on: required: true default: 'YYYY.MM' +env: + QT_VERSION: 5.15.2 jobs: update_ml_version: @@ -39,8 +41,17 @@ jobs: with: ref: main submodules: recursive + - name: Cache Qt + id: cache-qt + uses: actions/cache@v1 + with: + path: ../Qt + key: ${{ runner.os }}-QtCache-${{ env.QT_VERSION }} - name: Install Qt uses: jurplel/install-qt-action@v2 + with: + path: ../Qt + key: ${{ runner.os }}-QtCache-${{ env.QT_VERSION }} - name: Install dependencies run: | bash scripts/${{ runner.os }}/0_setup_env_ubuntu.sh --dont_install_qt --dowload_cgal_and_boost_src @@ -91,8 +102,17 @@ jobs: run: | brew install libomp cgal xerces-c npm install -g appdmg + - name: Cache Qt + id: cache-qt + uses: actions/cache@v1 + with: + path: ../Qt + key: ${{ runner.os }}-QtCache-${{ env.QT_VERSION }} - name: Install Qt uses: jurplel/install-qt-action@v2 + with: + path: ../Qt + key: ${{ runner.os }}-QtCache-${{ env.QT_VERSION }} - name: Setup env variables id: envs shell: bash @@ -158,8 +178,17 @@ jobs: submodules: recursive - name: Setup MSVC uses: ilammy/msvc-dev-cmd@v1 + - name: Cache Qt + id: cache-qt + uses: actions/cache@v1 + with: + path: ../Qt + key: ${{ runner.os }}-QtCache-${{ env.QT_VERSION }} - name: Install Qt uses: jurplel/install-qt-action@v2 + with: + path: ../Qt + key: ${{ runner.os }}-QtCache-${{ env.QT_VERSION }} - name: Setup env variables shell: bash id: envs @@ -172,7 +201,7 @@ jobs: echo "VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2022\Enterprise\VC" >> $GITHUB_ENV - name: Install wget run: | - $env:PATH = "C:\msys64\mingw64\bin;C:\msys64\usr\bin" + $env:PATH = "${{ env.PATH }};C:\msys64\mingw64\bin;C:\msys64\usr\bin" pacman.exe -S --noconfirm --noprogressbar wget unzip - name: Set Certificate run: | @@ -193,7 +222,7 @@ jobs: - name: Deploy shell: C:\shells\msys2bash.cmd {0} run: | - bash scripts/${{ runner.os }}/2_deploy.sh + bash scripts/${{ runner.os }}/2_deploy.sh -qt=${{ env.Qt5_DIR }} - name: NSIS script shell: bash run: | diff --git a/.github/workflows/Linux.yml b/.github/workflows/Linux.yml index 6849c2eda..e6da60092 100644 --- a/.github/workflows/Linux.yml +++ b/.github/workflows/Linux.yml @@ -3,6 +3,9 @@ name: Linux on: [push, pull_request] +env: + QT_VERSION: 5.15.2 + jobs: linux_build: name: Build MeshLab (Linux) @@ -15,8 +18,17 @@ jobs: - uses: actions/checkout@v2 with: submodules: recursive + - name: Cache Qt + id: cache-qt + uses: actions/cache@v1 + with: + path: ../Qt + key: ${{ runner.os }}-QtCache-${{ env.QT_VERSION }} - name: Install Qt uses: jurplel/install-qt-action@v2 + with: + cached: ${{ steps.cache-qt.outputs.cache-hit }} + version: ${{ env.QT_VERSION }} - name: Install dependencies run: | bash scripts/${{ runner.os }}/0_setup_env_ubuntu.sh --dont_install_qt --dowload_cgal_and_boost_src diff --git a/.github/workflows/MacOS.yml b/.github/workflows/MacOS.yml index b5eecbcea..3760fe208 100644 --- a/.github/workflows/MacOS.yml +++ b/.github/workflows/MacOS.yml @@ -3,6 +3,9 @@ name: MacOS on: [push, pull_request] +env: + QT_VERSION: 5.15.2 + jobs: macos_build: name: Build MeshLab (MacOS) @@ -19,8 +22,17 @@ jobs: run: | brew install libomp cgal xerces-c npm install -g appdmg + - name: Cache Qt + id: cache-qt + uses: actions/cache@v1 + with: + path: ../Qt + key: ${{ runner.os }}-QtCache-${{ env.QT_VERSION }} - name: Install Qt uses: jurplel/install-qt-action@v2 + with: + cached: ${{ steps.cache-qt.outputs.cache-hit }} + version: ${{ env.QT_VERSION }} - name: Setup env variables id: envs shell: bash diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index 7a2ba585d..2bcb8ca68 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -2,6 +2,9 @@ name: Windows on: [push, pull_request] +env: + QT_VERSION: 5.15.2 + jobs: windows_build: name: Build MeshLab (Windows) @@ -16,8 +19,17 @@ jobs: submodules: recursive - name: Setup MSVC uses: ilammy/msvc-dev-cmd@v1 + - name: Cache Qt + id: cache-qt + uses: actions/cache@v1 + with: + path: ../Qt + key: ${{ runner.os }}-QtCache-${{ env.QT_VERSION }} - name: Install Qt uses: jurplel/install-qt-action@v2 + with: + cached: ${{ steps.cache-qt.outputs.cache-hit }} + version: ${{ env.QT_VERSION }} - name: Setup env variables shell: bash id: envs @@ -30,7 +42,7 @@ jobs: echo "VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2022\Enterprise\VC" >> $GITHUB_ENV - name: Install wget run: | - $env:PATH = "C:\msys64\mingw64\bin;C:\msys64\usr\bin" + $env:PATH = "${{ env.PATH }};C:\msys64\mingw64\bin;C:\msys64\usr\bin" pacman.exe -S --noconfirm --noprogressbar wget unzip - name: Download external libraries shell: C:\shells\msys2bash.cmd {0} @@ -43,7 +55,7 @@ jobs: - name: Deploy shell: C:\shells\msys2bash.cmd {0} run: | - bash scripts/${{ runner.os }}/2_deploy.sh + bash scripts/${{ runner.os }}/2_deploy.sh -qt=${{ env.Qt5_DIR }} - name: NSIS script shell: bash run: | diff --git a/scripts/Windows/1_build.sh b/scripts/Windows/1_build.sh index 249171a32..ea3269209 100644 --- a/scripts/Windows/1_build.sh +++ b/scripts/Windows/1_build.sh @@ -18,6 +18,7 @@ BUILD_PATH=$SOURCE_PATH/../build INSTALL_PATH=$SOURCE_PATH/../install DOUBLE_PRECISION_OPTION="" NIGHTLY_OPTION="" +QT_DIR="" #check parameters for i in "$@" @@ -39,6 +40,10 @@ case $i in NIGHTLY_OPTION="-DMESHLAB_IS_NIGHTLY_VERSION=ON" shift # past argument=value ;; + -qt=*|--qt_dir=*) + QT_DIR=${i#*=} + shift # past argument=value + ;; *) # unknown option ;; @@ -61,6 +66,11 @@ BUILD_PATH=$(realpath $BUILD_PATH) INSTALL_PATH=$(realpath $INSTALL_PATH) cd $BUILD_PATH +if [ ! -z "$QT_DIR" ] +then + export Qt5_DIR=$QT_DIR +fi + cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$INSTALL_PATH $DOUBLE_PRECISION_OPTION $NIGHTLY_OPTION $SOURCE_PATH ninja ninja install diff --git a/scripts/Windows/2_deploy.sh b/scripts/Windows/2_deploy.sh index 2dced9b45..8cd70eea3 100644 --- a/scripts/Windows/2_deploy.sh +++ b/scripts/Windows/2_deploy.sh @@ -9,6 +9,7 @@ SCRIPTS_PATH="$(dirname "$(realpath "$0")")" RESOURCES_PATH=$SCRIPTS_PATH/../../resources INSTALL_PATH=$SCRIPTS_PATH/../../install +QT_DIR="" #checking for parameters for i in "$@" @@ -18,15 +19,19 @@ case $i in INSTALL_PATH="${i#*=}" shift # past argument=value ;; + -qt=*|--qt_dir=*) + QT_DIR=${i#*=}/bin/ + shift # past argument=value + ;; *) # unknown option ;; esac done -windeployqt $INSTALL_PATH/meshlab.exe +${QT_DIR}windeployqt $INSTALL_PATH/meshlab.exe -windeployqt $INSTALL_PATH/plugins/filter_sketchfab.dll --libdir $INSTALL_PATH/ +${QT_DIR}windeployqt $INSTALL_PATH/plugins/filter_sketchfab.dll --libdir $INSTALL_PATH/ mv $INSTALL_PATH/lib/meshlab/IFX* $INSTALL_PATH cp $INSTALL_PATH/IFXCoreStatic.lib $INSTALL_PATH/lib/meshlab/ @@ -38,6 +43,3 @@ then echo "Downloading vc_redist because it was missing..." wget https://aka.ms/vs/17/release/vc_redist.x64.exe --output-document=$INSTALL_PATH/vc_redist.x64.exe fi - -#at this point, distrib folder contains all the files necessary to execute meshlab -echo "$INSTALL_PATH is now a self contained meshlab application" diff --git a/scripts/macOS/1_build.sh b/scripts/macOS/1_build.sh index 12f1164fa..f205775df 100644 --- a/scripts/macOS/1_build.sh +++ b/scripts/macOS/1_build.sh @@ -20,6 +20,7 @@ INSTALL_PATH=$SOURCE_PATH/../install CORES="-j4" DOUBLE_PRECISION_OPTION="" NIGHTLY_OPTION="" +QT_DIR="" #check parameters for i in "$@" @@ -45,6 +46,10 @@ case $i in NIGHTLY_OPTION="-DMESHLAB_IS_NIGHTLY_VERSION=ON" shift # past argument=value ;; + -qt=*|--qt_dir=*) + QT_DIR=${i#*=} + shift # past argument=value + ;; *) # unknown option ;; diff --git a/scripts/macOS/2_deploy.sh b/scripts/macOS/2_deploy.sh index 273a9a1b6..818e49fe9 100755 --- a/scripts/macOS/2_deploy.sh +++ b/scripts/macOS/2_deploy.sh @@ -11,8 +11,9 @@ # After running this script, $INSTALL_PATH/meshlab.app will be a portable meshlab application. SCRIPTS_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) + INSTALL_PATH=$SCRIPTS_PATH/../../install -APPNAME="meshlab.app" +QT_DIR="" #checking for parameters for i in "$@" @@ -22,29 +23,17 @@ case $i in INSTALL_PATH="${i#*=}" shift # past argument=value ;; + -qt=*|--qt_dir=*) + QT_DIR=${i#*=}/bin/ + shift # past argument=value + ;; *) # unknown option ;; esac done -echo "Hopefully I should find " $INSTALL_PATH/$APPNAME - -if ! [ -e $INSTALL_PATH/$APPNAME -a -d $INSTALL_PATH/$APPNAME ] -then - echo "Started in the wrong dir: I have not found the meshlab.app" - exit -1 -fi - - -if [ -e $QTDIR/bin/macdeployqt ] -then - MACDEPLOYQT_EXE=$QTDIR/bin/macdeployqt -else - MACDEPLOYQT_EXE=macdeployqt -fi - -${MACDEPLOYQT_EXE} $INSTALL_PATH/$APPNAME \ +${QT_DIR}macdeployqt $INSTALL_PATH/$APPNAME \ -executable=$INSTALL_PATH/$APPNAME/Contents/PlugIns/libedit_align.so \ -executable=$INSTALL_PATH/$APPNAME/Contents/PlugIns/libfilter_csg.so \ -executable=$INSTALL_PATH/$APPNAME/Contents/PlugIns/libfilter_isoparametrization.so \