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