0025382: Visualization, TKOpenGl - improved video recording capability
[occt.git] / adm / templates / env.sh.in
1 #!/bin/bash
2
3 aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath"; fi; aScriptPath="$PWD";
4
5 # ----- for compatability with external application using CASROOT -----
6 if [ "${CASROOT}" == "" ]; then
7   export CASROOT="${aScriptPath}"
8 fi
9
10 # Read script arguments
11 shopt -s nocasematch
12 export CASDEB="";
13 if [[ "$1" == "debug" ]]; then export CASDEB="d"; fi
14 if [[ "$1" == "d" ]]; then export CASDEB="d"; fi
15 if [[ "$1" == "relwithdeb" ]]; then export CASDEB="i"; fi
16 if [[ "$1" == "i" ]]; then export CASDEB="i"; fi
17 shopt -u nocasematch
18
19 # ----- Set path to 3rd party and OCCT libraries -----
20 anArch=`uname -m`
21 if [ "$anArch" != "x86_64" ] && [ "$anArch" != "ia64" ]; then
22   export ARCH="32";
23 else
24   export ARCH="64";
25 fi
26
27 aSystem=`uname -s`
28 if [ "$aSystem" == "Darwin" ]; then
29   export WOKSTATION="mac";
30   export ARCH="64";
31 else
32   export WOKSTATION="lin";
33 fi
34
35 # ----- Set local settings -----
36 if [ -e "${aScriptPath}/custom.sh" ]; then
37   source "${aScriptPath}/custom.sh" "${CASDEB}" "${ARCH}"
38 fi
39
40 THRDPARTY_PATH=""
41 if [ "$TCL_DIR" != "" ]; then
42   THRDPARTY_PATH="${TCL_DIR}:${THRDPARTY_PATH}"
43 fi
44
45 if [ "$TK_DIR" != "" ]; then
46   THRDPARTY_PATH="${TK_DIR}:${THRDPARTY_PATH}"
47 fi
48
49 if [ "$FREETYPE_DIR" != "" ]; then
50   THRDPARTY_PATH="${FREETYPE_DIR}:${THRDPARTY_PATH}"
51 fi
52
53 if [ "$FREEIMAGE_DIR" != "" ]; then
54   THRDPARTY_PATH="${FREEIMAGE_DIR}:${THRDPARTY_PATH}"
55 fi
56
57 if [ "$GL2PS_DIR" != "" ]; then
58   THRDPARTY_PATH="${GL2PS_DIR}:${THRDPARTY_PATH}"
59 fi
60
61 if [ "$TBB_DIR" != "" ]; then
62   THRDPARTY_PATH="${TBB_DIR}:${THRDPARTY_PATH}"
63 fi
64
65 if [ "$VTK_DIR" != "" ]; then
66   THRDPARTY_PATH="${VTK_DIR}:${THRDPARTY_PATH}"
67 fi
68
69 if [ "$FFMPEG_DIR" != "" ]; then
70   THRDPARTY_PATH="${FFMPEG_DIR}:${THRDPARTY_PATH}"
71 fi
72
73 if [ "$QTDIR" != "" ]; then
74   THRDPARTY_PATH="${QTDIR}/lib:${THRDPARTY_PATH}"
75 fi
76
77 if [ "$TK_DIR" != "$TCL_DIR" ]; then
78   if [ "$TK_DIR" != "" ]; then
79     export TK_LIBRARY="${TK_DIR}/../lib/tk${TK_VERSION_WITH_DOT}"
80   fi
81   if [ "$TCL_DIR" != "" ]; then
82     export TCL_LIBRARY="${TCL_DIR}/../lib/tcl${TCL_VERSION_WITH_DOT}"
83   fi
84 fi
85
86 if [ "$LD_LIBRARY_PATH" != "" ]; then
87   export LD_LIBRARY_PATH="${THRDPARTY_PATH}:${LD_LIBRARY_PATH}"
88 else
89   export LD_LIBRARY_PATH="${THRDPARTY_PATH}"
90 fi
91
92 if [ "$CSF_OCCTBinPath" != "" ]; then
93   export PATH="${CSF_OCCTBinPath}:${PATH}"
94 fi
95
96 if [ "$CSF_OCCTLibPath" != "" ]; then
97   if [ "$LD_LIBRARY_PATH" != "" ]; then
98     export LD_LIBRARY_PATH="${CSF_OCCTLibPath}:${LD_LIBRARY_PATH}"
99   else
100     export LD_LIBRARY_PATH="${CSF_OCCTLibPath}"
101   fi
102 fi
103
104 if [ "$WOKSTATION" == "mac" ]; then
105   if [ "$DYLD_LIBRARY_PATH" != "" ]; then
106     export DYLD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${DYLD_LIBRARY_PATH}"
107   else
108     export DYLD_LIBRARY_PATH="${LD_LIBRARY_PATH}"
109   fi
110 fi
111
112 # ----- Set envoronment variables used by OCCT -----
113 export CSF_LANGUAGE=us
114 export MMGT_CLEAR=1
115 export CSF_SHMessage="${CSF_OCCTResourcePath}/SHMessage"
116 export CSF_MDTVTexturesDirectory="${CSF_OCCTResourcePath}/Textures"
117 export CSF_ShadersDirectory="${CSF_OCCTResourcePath}/Shaders"
118 export CSF_XSMessage="${CSF_OCCTResourcePath}/XSMessage"
119 export CSF_TObjMessage="${CSF_OCCTResourcePath}/TObj"
120 export CSF_StandardDefaults="${CSF_OCCTResourcePath}/StdResource"
121 export CSF_PluginDefaults="${CSF_OCCTResourcePath}/StdResource"
122 export CSF_XCAFDefaults="${CSF_OCCTResourcePath}/StdResource"
123 export CSF_TObjDefaults="${CSF_OCCTResourcePath}/StdResource"
124 export CSF_StandardLiteDefaults="${CSF_OCCTResourcePath}/StdResource"
125 export CSF_IGESDefaults="${CSF_OCCTResourcePath}/XSTEPResource"
126 export CSF_STEPDefaults="${CSF_OCCTResourcePath}/XSTEPResource"
127 export CSF_XmlOcafResource="${CSF_OCCTResourcePath}/XmlOcafResource"
128 export CSF_MIGRATION_TYPES="${CSF_OCCTResourcePath}/StdResource/MigrationSheet.txt"
129
130 # Draw Harness special stuff
131 if [ -e "${CSF_OCCTResourcePath}/DrawResources" ]; then
132   export DRAWHOME="${CSF_OCCTResourcePath}/DrawResources"
133   export CSF_DrawPluginDefaults="${CSF_OCCTResourcePath}/DrawResources"
134
135   if [ -e "${CSF_OCCTResourcePath}/DrawResources/DrawDefault" ]; then
136     export DRAWDEFAULT="${CSF_OCCTResourcePath}/DrawResources/DrawDefault"
137   fi
138 fi