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