From: Leonardo Florez-Valencia Date: Mon, 25 Apr 2016 17:38:41 +0000 (-0500) Subject: ... X-Git-Tag: v0.1~174 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=6859df02fb166584f29d9c8fac3b0e0738a27410;p=cpPlugins.git ... --- diff --git a/third_party_installers/cpPlugins_Install_CMAKE.sh b/third_party_installers/cpPlugins_Install_CMAKE.sh index 61f0580..fafea8f 100755 --- a/third_party_installers/cpPlugins_Install_CMAKE.sh +++ b/third_party_installers/cpPlugins_Install_CMAKE.sh @@ -1,5 +1,23 @@ #!/bin/bash +function abspath() +{ + pushd . > /dev/null + if [ -d "$1" ]; then + cd "$1" + dirs -l +0 + else + cd "`dirname \"$1\"`" + cur_dir=`dirs -l +0` + if [ "$cur_dir" == "/" ]; then + echo "$cur_dir`basename \"$1\"`" + else + echo "$cur_dir/`basename \"$1\"`" + fi + fi + popd > /dev/null +} + ## Some configuration variables number_of_processes="-j4" @@ -16,7 +34,7 @@ if [ "$#" -eq 1 ]; then echo "$0: Invalid file type." exit 1 fi - canonical_path=`readlink -e $1` + canonical_path=`abspath $1` source_dir=`dirname $canonical_path`/`basename $1 .$actual_ext` build_dir=`dirname $canonical_path`/`basename $1 .$actual_ext`-build echo -n "Cleaning directories... "