Commit 2d79480e authored by Arnaud Blanchard's avatar Arnaud Blanchard

Use full path for install prefix, interpret options before parameters

parent 5a946043
......@@ -14,22 +14,11 @@
#Default values
if [ "$2" ]; then
case "$2" in
Release|Debug|RelWithDebugInfo|MinSizeRel) build_type="$2";;
*)echo "Unknown build type '$2'">&2; usage;;
esac
else build_type="Release"
fi
current_dir="$PWD"
project_dir="$current_dir/$1"
blaar_build_dir="${current_dir}_build"
build_dir="$blaar_build_dir/${build_type}/$1"
usage()
{
echo "Usage: install [options] project_directory"
echo "Usage: install [options] <project_directory> [Release|Debug|RelWithDebugInfo|MinSizeRel]"
echo " -b directory :Directory to create the build. (default: $build_dir)"
echo " -h :Display this help."
echo " -i directory :Directory to install the binaries. Default: $install_prefix"
......@@ -43,7 +32,7 @@ do
case "$1" in
(-b) build_dir="$2"; shift;;
(-h) usage;exit 0;;
(-i) install_prefix="-DCMAKE_INSTALL_PREFIX=$2"; shift;;
(-i) install_prefix="-DCMAKE_INSTALL_PREFIX=$PWD/$2"; shift;;
(--) shift; break;;
(-*) echo "$0: error - unrecognized option $1" 1>&2; exit 1;;
(*) break;;
......@@ -51,6 +40,19 @@ do
shift
done
if [ "$2" ]; then
case "$2" in
Release|Debug|RelWithDebugInfo|MinSizeRel) build_type="$2";;
*)echo "Unknown build type '$2'">&2; usage;;
esac
else build_type="Release"
fi
current_dir="$PWD"
project_dir="$current_dir/$1"
blaar_build_dir="${current_dir}_build"
build_dir="$blaar_build_dir/${build_type}/$1"
if (($# == 0 ))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment