From a307f369d5dd9670b975ca995c3dfadce68feaca Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Fri, 16 Oct 2020 11:55:13 +0200 Subject: [PATCH] try bash on win --- .github/workflows/Windows.yml | 26 +++++++------ install/windows/windows_build.sh | 66 ++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+), 11 deletions(-) create mode 100644 install/windows/windows_build.sh diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index 3d37f51d2..c9bf771ff 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -21,19 +21,23 @@ jobs: id: envs run: | echo "::set-output name=date::$(type ML_VERSION)" - - name: Configure + - name: Configure and build + shell: bash run: | - cmake -S ./src -B ./build -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=install -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON + sh install/windows/windows_build.sh + #- name: Configure + # run: | + # cmake -S ./src -B ./build -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=install -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON # -DBUILD_MINI=ON - - name: Build MeshLab - run: | - cmake --build $env:GITHUB_WORKSPACE/build --config RelWithDebInfo -j 4 - cmake --build $env:GITHUB_WORKSPACE/build --config RelWithDebInfo --target INSTALL - - name: Uploading MeshLab Portable - uses: actions/upload-artifact@v1 - with: - name: meshlab_windows_portable_cmake - path: install + #- name: Build MeshLab + # run: | + # cmake --build $env:GITHUB_WORKSPACE/build --config RelWithDebInfo -j 4 + # cmake --build $env:GITHUB_WORKSPACE/build --config RelWithDebInfo --target INSTALL + #- name: Uploading MeshLab Portable + # uses: actions/upload-artifact@v1 + # with: + # name: meshlab_windows_portable_cmake + # path: install windows_build_qmake: name: Build MeshLab (Windows - QMake) diff --git a/install/windows/windows_build.sh b/install/windows/windows_build.sh new file mode 100644 index 000000000..177ff972f --- /dev/null +++ b/install/windows/windows_build.sh @@ -0,0 +1,66 @@ +#!/bin/bash +# this is a script shell for compiling meshlab in a Linux 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 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 +SCRIPTS_PATH="$(dirname "$(realpath "$0")")" +BUILD_PATH=$SCRIPTS_PATH/../../src/build +INSTALL_PATH=$SCRIPTS_PATH/../../src/install/usr/ +CORES="-j4" + +#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 + ;; + -j*) + CORES=$i + 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 $CORES +make install