macos build script without cd

This commit is contained in:
alemuntoni 2020-10-20 12:01:02 +02:00
parent c47745164c
commit ea8a901ea0
2 changed files with 37 additions and 29 deletions

View File

@ -9,23 +9,39 @@
#
# Without given arguments, MeshLab will be built in the meshlab/src
# directory, and binaries and AppImage will be placed in meshlab/distrib.
#
#
# You can give as argument the BUILD_PATH, and meshlab binaries and
# AppImage will be then placed inside BUILD_PATH/distrib.
#checking for parameters
if [ "$#" -eq 0 ]
then
BUILD_PATH="../../src"
DISTRIB_PATH="../../distrib"
else
BUILD_PATH=$(realpath $1)
BUILD_PATH=$BUILD_PATH/distrib
fi
SCRIPTS_PATH="$(dirname "$(realpath "$0")")"
SOURCE_PATH=$SCRIPTS_PATH/../../src
BUILD_PATH=$SOURCE_PATH/build
INSTALL_PATH=$SOURCE_PATH/install
CORES="-j4"
cd "$(dirname "$(realpath "$0")")"; #move to script directory
#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
sh linux_build.sh $BUILD_PATH
sh linux_make_bundle.sh $DISTRIB_PATH
sh linux_deploy.sh $DISTRIB_PATH
sh linux_appimages.sh $DISTRIB_PATH
sh $SCRIPTS_PATH/linux_build.sh -b=$BUILD_PATH -i=$INSTALL_PATH $CORES
sh $SCRIPTS_PATH/linux_make_bundle.sh $INSTALL_PATH
sh $SCRIPTS_PATH/linux_deploy.sh $INSTALL_PATH
sh $SCRIPTS_PATH/linux_appimages.sh $INSTALL_PATH

View File

@ -12,14 +12,15 @@
# -b and -i arguments are also supported.
#realpath function
realpath() {
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
}
#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
SOURCE_PATH=$SCRIPTS_PATH/../../src
BUILD_PATH=$SOURCE_PATH/build
INSTALL_PATH=$SOURCE_PATH/install
CORES="-j4"
#check parameters
@ -56,15 +57,6 @@ 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_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=$INSTALL_PATH $SOURCE_PATH
make $CORES