From 73093b4dafae48fe71a2cbde558d468e5c533f3e Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Thu, 24 Nov 2022 11:58:34 +0100 Subject: [PATCH] unique step for dependencies installation --- .github/workflows/BuildMeshLab.yml | 16 ++----------- scripts/Linux/0_setup_env.sh | 8 ++++--- scripts/Windows/0_setup_env.sh | 33 +++++++++++++++++++++++++++ scripts/macOS/0_setup_env.sh | 36 +++++++++++++++++++++++++----- 4 files changed, 70 insertions(+), 23 deletions(-) create mode 100644 scripts/Windows/0_setup_env.sh diff --git a/.github/workflows/BuildMeshLab.yml b/.github/workflows/BuildMeshLab.yml index 9557ce3f2..85bc8c9ae 100644 --- a/.github/workflows/BuildMeshLab.yml +++ b/.github/workflows/BuildMeshLab.yml @@ -26,22 +26,10 @@ jobs: with: cache: true version: ${{ env.QT_VERSION }} - - name: Install Linux dependencies - if: runner.os == 'Linux' - run: | - bash scripts/${{ runner.os }}/0_setup_env.sh --dont_install_qt --dont_install_cgal_and_boost - #needed by qt 5.15 on linux - sudo apt-get install libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-render-util0-dev libxcb-xinerama0-dev - - name: Install macOS dependencies - if: runner.os == 'macOS' - run: | - brew install llvm libomp cgal xerces-c - npm install -g appdmg - - name: Install Windows dependencies - if: runner.os == 'Windows' + - name: Install dependencies shell: bash run: | - choco install ccache ninja wget nsis + bash scripts/${{ runner.os }}/0_setup_env.sh --dont_install_qt --dont_install_cgal_and_boost - name: Setup env variables id: envs shell: bash diff --git a/scripts/Linux/0_setup_env.sh b/scripts/Linux/0_setup_env.sh index 96ee502ce..b85f04b58 100644 --- a/scripts/Linux/0_setup_env.sh +++ b/scripts/Linux/0_setup_env.sh @@ -29,16 +29,18 @@ sudo apt-get update echo "=== installing mesa packages..." sudo apt-get install -y mesa-common-dev libglu1-mesa-dev +echo "=== installing cmake, patchelf, gmp, mpfr and xcerces-c..." +sudo apt-get install -y cmake patchelf libgmp-dev libmpfr-dev libxerces-c-dev + if [ "$DONT_INSTALL_QT" = false ] ; then echo "=== installing qt packages..." sudo apt-get install -y qt5-default qttools5-dev-tools qtdeclarative5-dev else echo "=== jumping installation of qt packages..." + # libraries that qt requires in any case + sudo apt-get install -y libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-render-util0-dev libxcb-xinerama0-dev fi -echo "=== installing cmake, patchelf, gmp, mpfr and xcerces-c..." -sudo apt-get install -y cmake patchelf libgmp-dev libmpfr-dev libxerces-c-dev - # possibility to use always system libraries starting from ubuntu 20.04, since cgal is header only if [ "$DONT_INSTALL_CGAL_BOOST" = false ] ; then echo "=== installing cgal and boost..." diff --git a/scripts/Windows/0_setup_env.sh b/scripts/Windows/0_setup_env.sh new file mode 100644 index 000000000..24ef7af6b --- /dev/null +++ b/scripts/Windows/0_setup_env.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# this is a script shell sets up a Windows environment where +# MeshLab can be compiled, deployed and packaged. +# +# Run this script if you never installed any of the MeshLab dependencies. +# +# Requires: choco + +DONT_INSTALL_QT=false + +#checking for parameters +for i in "$@" +do +case $i in + --dont_install_qt) + DONT_INSTALL_QT=true + shift # past argument=value + ;; + *) + # unknown option + ;; +esac +done + +choco install ccache ninja wget nsis + +if [ "$DONT_INSTALL_QT" = false ] ; then + echo "=== installing qt packages..." + + choco install qt5-default +else + echo "=== jumping installation of qt packages..." +fi diff --git a/scripts/macOS/0_setup_env.sh b/scripts/macOS/0_setup_env.sh index a48679ad9..be4c8aa10 100644 --- a/scripts/macOS/0_setup_env.sh +++ b/scripts/macOS/0_setup_env.sh @@ -6,11 +6,35 @@ # # Requires: homebrew -brew install libomp qt cgal xerces-c +DONT_INSTALL_QT=false + +#checking for parameters +for i in "$@" +do +case $i in + --dont_install_qt) + DONT_INSTALL_QT=true + shift # past argument=value + ;; + *) + # unknown option + ;; +esac +done + +brew install cmake libomp cgal xerces-c npm install -g appdmg -echo "export QTDIR=/usr/local/opt/qt" >> ~/.bash_profile -echo "export PATH=$QTDIR/bin:$PATH" >> ~/.bash_profile -echo "export LD_LIBRARY_PATH=/usr/local/opt/qt/lib:$LD_LIBRARY_PATH" >> ~/.bash_profile -echo "export PKG_CONFIG_PATH=/usr/local/opt/qt/lib:$PKG_CONFIG_PATH" >> ~/.bash_profile -. ~/.bash_profile +if [ "$DONT_INSTALL_QT" = false ] ; then + echo "=== installing qt packages..." + + brew install qt + + echo "export QTDIR=/usr/local/opt/qt" >> ~/.bash_profile + echo "export PATH=$QTDIR/bin:$PATH" >> ~/.bash_profile + echo "export LD_LIBRARY_PATH=/usr/local/opt/qt/lib:$LD_LIBRARY_PATH" >> ~/.bash_profile + echo "export PKG_CONFIG_PATH=/usr/local/opt/qt/lib:$PKG_CONFIG_PATH" >> ~/.bash_profile + . ~/.bash_profile +else + echo "=== jumping installation of qt packages..." +fi