0026942: Training material are not built on OCCT installed after building by cmake...
[occt.git] / samples / qt / Tutorial / env.sh
old mode 100644 (file)
new mode 100755 (executable)
index 01a895b..eef770d
@@ -1,5 +1,22 @@
-#!/bin/sh
+#!/bin/bash
 
 
-if [ -e "${aSamplePath}/custom.sh" ]; then source "${aSamplePath}/custom.sh"; fi
-source $CASROOT/env.sh
-export CSF_OPT_INC="${CSF_OPT_INC}${CASROOT}/inc:"
+export aSamplePath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+
+if [ -e "custom.sh" ]; then
+   source "custom.sh";
+fi
+
+if [ -e "${aSamplePath}/../../../env.sh" ]; then
+   source "${aSamplePath}/../../../env.sh";
+fi
+
+if test "${QTDIR}" == ""; then
+   echo "Environment variable \"QTDIR\" not defined. Define it in \"custom.sh\" script."
+   exit 1
+fi
+
+host=`uname -s`
+export STATION=$host
+export RES_DIR=${aSamplePath}/${STATION}/res
+
+export PATH=${QTDIR}/bin:${PATH}