0024665: A sample for advanced function mechanism
[occt.git] / samples / qt / FuncDemo / run.sh
diff --git a/samples/qt/FuncDemo/run.sh b/samples/qt/FuncDemo/run.sh
new file mode 100644 (file)
index 0000000..8129d8f
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+export aSamplePath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+
+if [ -e "${aSamplePath}/env.sh" ]; then source "${aSamplePath}/env.sh"; fi
+cd $aSamplePath
+
+aSystem=`uname -s`
+if [ "$aSystem" == "Darwin" ] && [ "$MACOSX_USE_GLX" != "true" ]; then
+  if [ "${CASDEB}" == "d" ]; then
+    BIN_DIR="${aSamplePath}/build/Debug/FuncDemo.app/Contents/MacOS"
+  else
+    BIN_DIR="${aSamplePath}/build/Release/FuncDemo.app/Contents/MacOS"
+  fi
+else
+  BIN_DIR="${aSamplePath}/${STATION}/bin${CASDEB}"
+fi
+
+PATH="${BIN_DIR}:${PATH}"
+export PATH
+
+if test ! -r "${BIN_DIR}/FuncDemo"; then
+  echo "Executable \"${BIN_DIR}/FuncDemo\" not found."
+  if [ "$aSystem" == "Darwin" ] && [ "$MACOSX_USE_GLX" != "true" ]; then
+    echo "Probably you don't compile the application. Build it with Xcode."
+  else
+    echo "Probably you don't compile the application. Execute \"make\"."
+  fi
+  exit 1
+fi
+
+${BIN_DIR}/FuncDemo