0026763: CMake configuration process does not allow setup paths for TK library if...
[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}" "${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 [ "$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 BIN_PATH="${WOKSTATION}${ARCH}/${COMPILER}/bin${CASDEB}"
80 LIBS_PATH="${WOKSTATION}${ARCH}/${COMPILER}/lib${CASDEB}"
81
82 export PATH="${CASROOT}/${BIN_PATH}:${PATH}"
83
84 if [ "$LD_LIBRARY_PATH" != "" ]; then
85   export LD_LIBRARY_PATH="${CASROOT}/${LIBS_PATH}:${THRDPARTY_PATH}:${LD_LIBRARY_PATH}"
86 else
87   export LD_LIBRARY_PATH="${CASROOT}/${LIBS_PATH}:${THRDPARTY_PATH}"
88 fi
89
90 if [ "$WOKSTATION" == "mac" ]; then
91   if [ "$DYLD_LIBRARY_PATH" != "" ]; then
92     export DYLD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${DYLD_LIBRARY_PATH}"
93   else
94     export DYLD_LIBRARY_PATH="${LD_LIBRARY_PATH}"
95   fi
96 fi
97
98 # ----- Set envoronment variables used by OCCT -----
99 export CSF_LANGUAGE=us
100 export MMGT_CLEAR=1
101 export CSF_EXCEPTION_PROMPT=1
102 export CSF_SHMessage="${CASROOT}/src/SHMessage"
103 export CSF_MDTVTexturesDirectory="${CASROOT}/src/Textures"
104 export CSF_ShadersDirectory="${CASROOT}/src/Shaders"
105 export CSF_XSMessage="${CASROOT}/src/XSMessage"
106 export CSF_TObjMessage="${CASROOT}/src/TObj"
107 export CSF_StandardDefaults="${CASROOT}/src/StdResource"
108 export CSF_PluginDefaults="${CASROOT}/src/StdResource"
109 export CSF_XCAFDefaults="${CASROOT}/src/StdResource"
110 export CSF_TObjDefaults="${CASROOT}/src/StdResource"
111 export CSF_StandardLiteDefaults="${CASROOT}/src/StdResource"
112 export CSF_UnitsLexicon="${CASROOT}/src/UnitsAPI/Lexi_Expr.dat"
113 export CSF_UnitsDefinition="${CASROOT}/src/UnitsAPI/Units.dat"
114 export CSF_IGESDefaults="${CASROOT}/src/XSTEPResource"
115 export CSF_STEPDefaults="${CASROOT}/src/XSTEPResource"
116 export CSF_XmlOcafResource="${CASROOT}/src/XmlOcafResource"
117 export CSF_MIGRATION_TYPES="${CASROOT}/src/StdResource/MigrationSheet.txt"
118
119 # Draw Harness special stuff
120 if [ -e "${CASROOT}/src/DrawResources" ]; then
121   export DRAWHOME="${CASROOT}/src/DrawResources"
122   export CSF_DrawPluginDefaults="${CASROOT}/src/DrawResources"
123
124   if [ -e "${CASROOT}/src/DrawResources/DrawDefault" ]; then
125     export DRAWDEFAULT="${CASROOT}/src/DrawResources/DrawDefault"
126   fi
127 fi
128
129 if [ -e "${CASROOT}/src/DrawResourcesProducts" ]; then
130   export CSF_DrawPluginProductsDefaults="${CASROOT}/src/DrawResourcesProducts"
131 fi
132