diff --git a/.github/workflows/MacOS.yml b/.github/workflows/MacOS.yml index 563b8c874..2c0eaa3e4 100644 --- a/.github/workflows/MacOS.yml +++ b/.github/workflows/MacOS.yml @@ -25,6 +25,9 @@ jobs: shell: bash run: | echo ::set-output name=date::"$(cat ML_VERSION)" + - name: Configure and Build + run: | + sh install/macos/macos_build.sh macos_build_qmake: diff --git a/install/linux/linux_build.sh b/install/linux/linux_build.sh index 8996dd458..31df0d187 100644 --- a/install/linux/linux_build.sh +++ b/install/linux/linux_build.sh @@ -8,7 +8,7 @@ # # You can give as argument the BUILD_PATH and the INSTALL_PATH in the # following way: -# sh linux_build --build_path=/path/to/build --install_path=/path/to/install +# sh linux_build.sh --build_path=/path/to/build --install_path=/path/to/install # -b and -i arguments are also supported. #default paths wrt the script folder diff --git a/install/macos/macos_build.sh b/install/macos/macos_build.sh new file mode 100644 index 000000000..702445f33 --- /dev/null +++ b/install/macos/macos_build.sh @@ -0,0 +1,66 @@ +#!/bin/bash +# this is a script shell for compiling meshlab in a MacOS environment. +# Requires a Qt environment which is set-up properly, and an accessible +# cmake binary. +# +# Without given arguments, MeshLab will be built in the meshlab/src/build +# directory, and installed in $BUILD_PATH/../install. +# +# You can give as argument the BUILD_PATH and the INSTALL_PATH in the +# following way: +# sh macos_build.sh --build_path=/path/to/build --install_path=/path/to/install +# -b and -i arguments are also supported. + +#realpath function +realpath() { + [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}" +} + +#default paths wrt the script folder +SCRIPTS_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +BUILD_PATH=$SCRIPTS_PATH/../../src/build +INSTALL_PATH=$SCRIPTS_PATH/../../src/install + +#check parameters +for i in "$@" +do +case $i in + -b=*|--build_path=*) + BUILD_PATH="${i#*=}" + shift # past argument=value + ;; + -i=*|--install_path=*) + INSTALL_PATH="${i#*=}"/usr/ + shift # past argument=value + ;; + *) + # unknown option + ;; +esac +done + +#create build path if necessary +if ! [ -d $BUILD_PATH ] +then + mkdir -p $BUILD_PATH +fi + +#create install path if necessary +if ! [ -d $INSTALL_PATH ] +then + mkdir -p $INSTALL_PATH +fi + +BUILD_PATH=$(realpath $BUILD_PATH) +INSTALL_PATH=$(realpath $INSTALL_PATH) + +#move to script directory +cd $SCRIPTS_PATH + +#source path wrt script path +SOURCE_PATH=$PWD/../../src + +cd $BUILD_PATH +cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_PATH $SOURCE_PATH +make -j4 +#make install