89da9091dd0e613d45a1869bfed907fde9ffbab4
[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 export CASROOT="@CMAKE_SOURCE_DIR@"
6
7 if [ "${CASROOT}" == "" ]; then
8   export CASROOT="${aScriptPath}"
9 fi
10
11 # Read script arguments
12 shopt -s nocasematch
13 export CASDEB="";
14 if [[ "$1" == "debug" ]]; then export CASDEB="d"; fi
15 if [[ "$1" == "d" ]]; then export CASDEB="d"; fi
16 if [[ "$1" == "relwithdeb" ]]; then export CASDEB="i"; fi
17 if [[ "$1" == "i" ]]; then export CASDEB="i"; fi
18 shopt -u nocasematch
19
20 export COMPILER="@COMPILER@"
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 "${aScriptPath}/custom.sh" ]; then
40   source "${aScriptPath}/custom.sh" "${COMPILER}" "${WOKSTATION}${ARCH}" "${CASDEB}"
41 fi
42
43 THRDPARTY_PATH=""
44 if [ "$TCL_DIR" != "" ]; then
45   THRDPARTY_PATH="${TCL_DIR}:${THRDPARTY_PATH}"
46 fi
47
48 if [ "$FREETYPE_DIR" != "" ]; then
49   THRDPARTY_PATH="${FREETYPE_DIR}:${THRDPARTY_PATH}"
50 fi
51
52 if [ "$FREEIMAGE_DIR" != "" ]; then
53   THRDPARTY_PATH="${FREEIMAGE_DIR}:${THRDPARTY_PATH}"
54 fi
55
56 if [ "$GL2PS_DIR" != "" ]; then
57   THRDPARTY_PATH="${GL2PS_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 BIN_PATH="${WOKSTATION}${ARCH}/${COMPILER}/bin${CASDEB}"
69 LIBS_PATH="${WOKSTATION}${ARCH}/${COMPILER}/lib${CASDEB}"
70
71 export PATH="@CMAKE_BINARY_DIR@/${BIN_PATH}:${PATH}"
72
73 if [ "$LD_LIBRARY_PATH" != "" ]; then
74   export LD_LIBRARY_PATH="@CMAKE_BINARY_DIR@/${LIBS_PATH}:${THRDPARTY_PATH}:${LD_LIBRARY_PATH}"
75 else
76   export LD_LIBRARY_PATH="@CMAKE_BINARY_DIR@/${LIBS_PATH}:${THRDPARTY_PATH}"
77 fi
78
79 if [ "$WOKSTATION" == "mac" ]; then
80   if [ "$DYLD_LIBRARY_PATH" != "" ]; then
81     export DYLD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${DYLD_LIBRARY_PATH}"
82   else
83     export DYLD_LIBRARY_PATH="${LD_LIBRARY_PATH}"
84   fi
85 fi
86
87 # ----- Set envoronment variables used by OCCT -----
88 export CSF_LANGUAGE=us
89 export MMGT_CLEAR=1
90 export CSF_EXCEPTION_PROMPT=1
91 export CSF_SHMessage="${CASROOT}/src/SHMessage"
92 export CSF_MDTVTexturesDirectory="${CASROOT}/src/Textures"
93 export CSF_ShadersDirectory="${CASROOT}/src/Shaders"
94 export CSF_XSMessage="${CASROOT}/src/XSMessage"
95 export CSF_TObjMessage="${CASROOT}/src/TObj"
96 export CSF_StandardDefaults="${CASROOT}/src/StdResource"
97 export CSF_PluginDefaults="${CASROOT}/src/StdResource"
98 export CSF_XCAFDefaults="${CASROOT}/src/StdResource"
99 export CSF_TObjDefaults="${CASROOT}/src/StdResource"
100 export CSF_StandardLiteDefaults="${CASROOT}/src/StdResource"
101 export CSF_UnitsLexicon="${CASROOT}/src/UnitsAPI/Lexi_Expr.dat"
102 export CSF_UnitsDefinition="${CASROOT}/src/UnitsAPI/Units.dat"
103 export CSF_IGESDefaults="${CASROOT}/src/XSTEPResource"
104 export CSF_STEPDefaults="${CASROOT}/src/XSTEPResource"
105 export CSF_XmlOcafResource="${CASROOT}/src/XmlOcafResource"
106 export CSF_MIGRATION_TYPES="${CASROOT}/src/StdResource/MigrationSheet.txt"
107
108 # Draw Harness special stuff
109 if [ -e "${CASROOT}/src/DrawResources" ]; then
110   export DRAWHOME="${CASROOT}/src/DrawResources"
111   export CSF_DrawPluginDefaults="${CASROOT}/src/DrawResources"
112
113   if [ -e "${CASROOT}/src/DrawResources/DrawDefault" ]; then
114     export DRAWDEFAULT="${CASROOT}/src/DrawResources/DrawDefault"
115   fi
116 fi
117
118 if [ -e "${CASROOT}/src/DrawResourcesProducts" ]; then
119   export CSF_DrawPluginProductsDefaults="${CASROOT}/src/DrawResourcesProducts"
120 fi
121