]> Creatis software - cpPlugins.git/commitdiff
...
authorLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Mon, 25 Apr 2016 17:38:41 +0000 (12:38 -0500)
committerLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Mon, 25 Apr 2016 17:38:41 +0000 (12:38 -0500)
third_party_installers/cpPlugins_Install_CMAKE.sh

index 61f058003924c5e026ec9c8265a47b47775fffe4..fafea8facb621bec50442cfeabf68fcee775fe12 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"
 
@@ -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... "