0029083: Samples - specify multiple Make jobs within make.sh for Qt sample
[occt.git] / samples / qt / Tutorial / run.sh
1 #!/bin/bash
2
3 export aSamplePath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
4
5 if [ -e "${aSamplePath}/env.sh" ]; then source "${aSamplePath}/env.sh" $*; fi
6 cd $aSamplePath
7
8 aSystem=`uname -s`
9 if [ "$aSystem" == "Darwin" ] && [ "$MACOSX_USE_GLX" != "true" ]; then
10   if [ "${CASDEB}" == "d" ]; then
11     BIN_DIR="${aSamplePath}/build/Debug/Tutorial.app/Contents/MacOS"
12   else
13     BIN_DIR="${aSamplePath}/build/Release/Tutorial.app/Contents/MacOS"
14   fi
15 else
16   BIN_DIR="${aSamplePath}/${STATION}/bin${CASDEB}"
17 fi
18
19 CSF_ResourcesDefaults="${RES_DIR}"
20 CSF_TutorialResourcesDefaults="${RES_DIR}"
21
22 PATH="${BIN_DIR}:${PATH}"
23
24 export CSF_TutorialResourcesDefaults CSF_ResourcesDefaults
25 export PATH
26
27 if test ! -r "${BIN_DIR}/Tutorial"; then
28   echo "Executable \"${BIN_DIR}/Tutorial\" not found."
29   if [ "$aSystem" == "Darwin" ] && [ "$MACOSX_USE_GLX" != "true" ]; then
30     echo "Probably you don't compile the application. Build it with Xcode."
31   else
32     echo "Probably you don't compile the application. Execute \"make\"."
33   fi
34   exit 1
35 fi
36
37 ${BIN_DIR}/Tutorial