0025114: CMake-based build tools for OCCT 7.0
[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 if [ "${CASROOT}" == "" ]; then
6   export CASROOT="${aScriptPath}"
7 fi
8
9 # Read script arguments
10 shopt -s nocasematch
11 export CASDEB="@BUILD_POSTFIX@";
12 if [[ "$1" == "debug" ]]; then export CASDEB="d"; fi
13 if [[ "$1" == "d" ]]; then export CASDEB="d"; fi
14 shopt -u nocasematch
15
16 export COMPILER="@COMPILER@"
17
18 # ----- Set path to 3rd party and OCCT libraries -----
19 anArch=`uname -m`
20 if [ "$anArch" != "x86_64" ] && [ "$anArch" != "ia64" ]; then
21   export ARCH="32";
22 else
23   export ARCH="64";
24 fi
25
26 aSystem=`uname -s`
27 if [ "$aSystem" == "Darwin" ]; then
28   export WOKSTATION="mac";
29   export ARCH="64";
30 else
31   export WOKSTATION="lin";
32 fi
33
34 # ----- Set local settings -----
35 if [ -e "${aScriptPath}/custom.sh" ]; then 
36   source "${aScriptPath}/custom.sh" "${COMPILER}" "${WOKSTATION}${ARCH}" "${CASDEB}"
37 fi
38
39 THRDPARTY_PATH=""
40 if [ "$TCL_DIR" != "" ]; then
41   THRDPARTY_PATH="${TCL_DIR}:${THRDPARTY_PATH}"
42 fi
43
44 if [ "$FREETYPE_DIR" != "" ]; then
45   THRDPARTY_PATH="${FREETYPE_DIR}:${THRDPARTY_PATH}"
46 fi
47
48 if [ "$FREEIMAGE_DIR" != "" ]; then
49   THRDPARTY_PATH="${FREEIMAGE_DIR}:${THRDPARTY_PATH}"
50 fi
51
52 if [ "$GL2PS_DIR" != "" ]; then
53   THRDPARTY_PATH="${GL2PS_DIR}:${THRDPARTY_PATH}"
54 fi
55
56 if [ "$TBB_DIR" != "" ]; then
57   THRDPARTY_PATH="${TBB_DIR}:${THRDPARTY_PATH}"
58 fi
59
60 if [ "$VTK_DIR" != "" ]; then
61   THRDPARTY_PATH="${VTK_DIR}:${THRDPARTY_PATH}"
62 fi
63
64 BIN_PATH="${WOKSTATION}${ARCH}/${COMPILER}/bin${CASDEB}"
65 LIBS_PATH="${WOKSTATION}${ARCH}/${COMPILER}/lib${CASDEB}"
66
67 export PATH="${CASROOT}/${BIN_PATH}:${PATH}"
68
69 if [ "$LD_LIBRARY_PATH" != "" ]; then
70   export LD_LIBRARY_PATH="${CASROOT}/${LIBS_PATH}:${THRDPARTY_PATH}:${LD_LIBRARY_PATH}"
71 else
72   export LD_LIBRARY_PATH="${CASROOT}/${LIBS_PATH}:${THRDPARTY_PATH}"
73 fi
74
75 if [ "$WOKSTATION" == "mac" ]; then
76   if [ "$DYLD_LIBRARY_PATH" != "" ]; then
77     export DYLD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${DYLD_LIBRARY_PATH}"
78   else
79     export DYLD_LIBRARY_PATH="${LD_LIBRARY_PATH}"
80   fi
81 fi
82
83 # ----- Set envoronment variables used by OCCT -----
84 export CSF_LANGUAGE=us
85 export MMGT_CLEAR=1
86 export CSF_EXCEPTION_PROMPT=1
87 export CSF_SHMessage="${CASROOT}/src/SHMessage"
88 export CSF_MDTVTexturesDirectory="${CASROOT}/src/Textures"
89 export CSF_ShadersDirectory="${CASROOT}/src/Shaders"
90 export CSF_XSMessage="${CASROOT}/src/XSMessage"
91 export CSF_TObjMessage="${CASROOT}/src/TObj"
92 export CSF_StandardDefaults="${CASROOT}/src/StdResource"
93 export CSF_PluginDefaults="${CASROOT}/src/StdResource"
94 export CSF_XCAFDefaults="${CASROOT}/src/StdResource"
95 export CSF_TObjDefaults="${CASROOT}/src/StdResource"
96 export CSF_StandardLiteDefaults="${CASROOT}/src/StdResource"
97 export CSF_UnitsLexicon="${CASROOT}/src/UnitsAPI/Lexi_Expr.dat"
98 export CSF_UnitsDefinition="${CASROOT}/src/UnitsAPI/Units.dat"
99 export CSF_IGESDefaults="${CASROOT}/src/XSTEPResource"
100 export CSF_STEPDefaults="${CASROOT}/src/XSTEPResource"
101 export CSF_XmlOcafResource="${CASROOT}/src/XmlOcafResource"
102 export CSF_MIGRATION_TYPES="${CASROOT}/src/StdResource/MigrationSheet.txt"
103
104 # Draw Harness special stuff
105 if [ -e "${CASROOT}/src/DrawResources" ]; then
106   export DRAWHOME="${CASROOT}/src/DrawResources"
107   export CSF_DrawPluginDefaults="${CASROOT}/src/DrawResources"
108
109   if [ -e "${CASROOT}/src/DrawResources/DrawDefault" ]; then
110     export DRAWDEFAULT="${CASROOT}/src/DrawResources/DrawDefault"
111   fi
112 fi
113
114 if [ -e "${CASROOT}/src/DrawResourcesProducts" ]; then
115   export CSF_DrawPluginProductsDefaults="${CASROOT}/src/DrawResourcesProducts"
116 fi
117