]> Creatis software - cpPlugins.git/blobdiff - third_party_installers/cpPlugins_Install_VTK.sh
...
[cpPlugins.git] / third_party_installers / cpPlugins_Install_VTK.sh
index 7cce532f1b4628949a71ce44fc748bd4b3842f1c..0812809a93ab0b6645a0308785c2fa8980f99749 100755 (executable)
@@ -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"
 comp_type=Debug
@@ -55,7 +73,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... "