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