980d161f |
1 | #!/bin/bash |
7fd59977 |
2 | |
7a53e886 |
3 | export aSamplePath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" |
980d161f |
4 | |
9220e785 |
5 | if [ -e "${aSamplePath}/env.sh" ]; then source "${aSamplePath}/env.sh"; fi |
7a53e886 |
6 | cd $aSamplePath |
7fd59977 |
7 | |
5f9575b3 |
8 | aSystem=`uname -s` |
dc3fe572 |
9 | if [ "$aSystem" == "Darwin" ] && [ "$MACOSX_USE_GLX" != "true" ]; then |
5f9575b3 |
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 |
7fd59977 |
18 | |
19 | CSF_ResourcesDefaults="${RES_DIR}" |
7a53e886 |
20 | CSF_TutorialResourcesDefaults="${RES_DIR}" |
7fd59977 |
21 | |
22 | PATH="${BIN_DIR}:${PATH}" |
23 | |
7a53e886 |
24 | export CSF_TutorialResourcesDefaults CSF_ResourcesDefaults |
25 | export PATH |
7fd59977 |
26 | |
27 | if test ! -r "${BIN_DIR}/Tutorial"; then |
5f9575b3 |
28 | echo "Executable \"${BIN_DIR}/Tutorial\" not found." |
dc3fe572 |
29 | if [ "$aSystem" == "Darwin" ] && [ "$MACOSX_USE_GLX" != "true" ]; then |
5f9575b3 |
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 |
7fd59977 |
35 | fi |
36 | |
37 | ${BIN_DIR}/Tutorial |