0026916: Configuration, CMake - configure variables to customize installation path...
[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 if [ "${CASROOT}" == "" ]; then
6   export CASROOT="${aScriptPath}"
7 fi
8
9 # Read script arguments
10 shopt -s nocasematch
11 export CASDEB="";
12 if [[ "$1" == "debug" ]]; then export CASDEB="d"; fi
13 if [[ "$1" == "d" ]]; then export CASDEB="d"; fi
14 if [[ "$1" == "relwithdeb" ]]; then export CASDEB="i"; fi
15 if [[ "$1" == "i" ]]; then export CASDEB="i"; 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}" "${ARCH}"
39 fi
40
41 THRDPARTY_PATH=""
42 if [ "$TCL_DIR" != "" ]; then
43   THRDPARTY_PATH="${TCL_DIR}:${THRDPARTY_PATH}"
44 fi
45
46 if [ "$TK_DIR" != "" ]; then
47   THRDPARTY_PATH="${TK_DIR}:${THRDPARTY_PATH}"
48 fi
49
50 if [ "$FREETYPE_DIR" != "" ]; then
51   THRDPARTY_PATH="${FREETYPE_DIR}:${THRDPARTY_PATH}"
52 fi
53
54 if [ "$FREEIMAGE_DIR" != "" ]; then
55   THRDPARTY_PATH="${FREEIMAGE_DIR}:${THRDPARTY_PATH}"
56 fi
57
58 if [ "$GL2PS_DIR" != "" ]; then
59   THRDPARTY_PATH="${GL2PS_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 [ "$TK_DIR" != "$TCL_DIR" ]; then
71   if [ "$TK_DIR" != "" ]; then
72     export TK_LIBRARY="${TK_DIR}/../lib/tk@3RDPARTY_TK_LIBRARY_VERSION_WITH_DOT@"
73   fi
74   if [ "$TCL_DIR" != "" ]; then
75     export TCL_LIBRARY="${TCL_DIR}/../lib/tcl@3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT@"
76   fi
77 fi
78
79 if [ "$LD_LIBRARY_PATH" != "" ]; then
80   export LD_LIBRARY_PATH="${THRDPARTY_PATH}:${LD_LIBRARY_PATH}"
81 else
82   export LD_LIBRARY_PATH="${THRDPARTY_PATH}"
83 fi
84
85 if [ "$WOKSTATION" == "mac" ]; then
86   if [ "$DYLD_LIBRARY_PATH" != "" ]; then
87     export DYLD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${DYLD_LIBRARY_PATH}"
88   else
89     export DYLD_LIBRARY_PATH="${LD_LIBRARY_PATH}"
90   fi
91 fi
92
93 # ----- Set envoronment variables used by OCCT -----
94 export CSF_LANGUAGE=us
95 export MMGT_CLEAR=1
96 export CSF_EXCEPTION_PROMPT=1
97 export CSF_SHMessage="${OCCT_RESOURCE_PATH}/SHMessage"
98 export CSF_MDTVTexturesDirectory="${OCCT_RESOURCE_PATH}/Textures"
99 export CSF_ShadersDirectory="${OCCT_RESOURCE_PATH}/Shaders"
100 export CSF_XSMessage="${OCCT_RESOURCE_PATH}/XSMessage"
101 export CSF_TObjMessage="${OCCT_RESOURCE_PATH}/TObj"
102 export CSF_StandardDefaults="${OCCT_RESOURCE_PATH}/StdResource"
103 export CSF_PluginDefaults="${OCCT_RESOURCE_PATH}/StdResource"
104 export CSF_XCAFDefaults="${OCCT_RESOURCE_PATH}/StdResource"
105 export CSF_TObjDefaults="${OCCT_RESOURCE_PATH}/StdResource"
106 export CSF_StandardLiteDefaults="${OCCT_RESOURCE_PATH}/StdResource"
107 export CSF_UnitsLexicon="${OCCT_RESOURCE_PATH}/UnitsAPI/Lexi_Expr.dat"
108 export CSF_UnitsDefinition="${OCCT_RESOURCE_PATH}/UnitsAPI/Units.dat"
109 export CSF_IGESDefaults="${OCCT_RESOURCE_PATH}/XSTEPResource"
110 export CSF_STEPDefaults="${OCCT_RESOURCE_PATH}/XSTEPResource"
111 export CSF_XmlOcafResource="${OCCT_RESOURCE_PATH}/XmlOcafResource"
112 export CSF_MIGRATION_TYPES="${OCCT_RESOURCE_PATH}/StdResource/MigrationSheet.txt"
113
114 # Draw Harness special stuff
115 if [ -e "${OCCT_RESOURCE_PATH}/DrawResources" ]; then
116   export DRAWHOME="${OCCT_RESOURCE_PATH}/DrawResources"
117   export CSF_DrawPluginDefaults="${OCCT_RESOURCE_PATH}/DrawResources"
118
119   if [ -e "${OCCT_RESOURCE_PATH}/DrawResources/DrawDefault" ]; then
120     export DRAWDEFAULT="${OCCT_RESOURCE_PATH}/DrawResources/DrawDefault"
121   fi
122 fi
123
124 if [ -e "${OCCT_RESOURCE_PATH}/DrawResourcesProducts" ]; then
125   export CSF_DrawPluginProductsDefaults="${OCCT_RESOURCE_PATH}/DrawResourcesProducts"
126 fi
127