0026763: CMake configuration process does not allow setup paths for TK library if...
[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 [ "$TK_DIR" != "" ]; then
49   THRDPARTY_PATH="${TK_DIR}:${THRDPARTY_PATH}"
50 fi
51
52 if [ "$FREETYPE_DIR" != "" ]; then
53   THRDPARTY_PATH="${FREETYPE_DIR}:${THRDPARTY_PATH}"
54 fi
55
56 if [ "$FREEIMAGE_DIR" != "" ]; then
57   THRDPARTY_PATH="${FREEIMAGE_DIR}:${THRDPARTY_PATH}"
58 fi
59
60 if [ "$GL2PS_DIR" != "" ]; then
61   THRDPARTY_PATH="${GL2PS_DIR}:${THRDPARTY_PATH}"
62 fi
63
64 if [ "$TBB_DIR" != "" ]; then
65   THRDPARTY_PATH="${TBB_DIR}:${THRDPARTY_PATH}"
66 fi
67
68 if [ "$VTK_DIR" != "" ]; then
69   THRDPARTY_PATH="${VTK_DIR}:${THRDPARTY_PATH}"
70 fi
71
72 if [ "$TK_DIR" != "$TCL_DIR" ]; then
73   if [ "$TK_DIR" != "" ]; then
74     export TK_LIBRARY="${TK_DIR}/../lib/tk@3RDPARTY_TK_LIBRARY_VERSION_WITH_DOT@"
75   fi
76   if [ "$TCL_DIR" != "" ]; then
77     export TCL_LIBRARY="${TCL_DIR}/../lib/tcl@3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT@"
78   fi
79 fi
80
81 BIN_PATH="${WOKSTATION}${ARCH}/${COMPILER}/bin${CASDEB}"
82 LIBS_PATH="${WOKSTATION}${ARCH}/${COMPILER}/lib${CASDEB}"
83
84 export PATH="@CMAKE_BINARY_DIR@/${BIN_PATH}:${PATH}"
85
86 if [ "$LD_LIBRARY_PATH" != "" ]; then
87   export LD_LIBRARY_PATH="@CMAKE_BINARY_DIR@/${LIBS_PATH}:${THRDPARTY_PATH}:${LD_LIBRARY_PATH}"
88 else
89   export LD_LIBRARY_PATH="@CMAKE_BINARY_DIR@/${LIBS_PATH}:${THRDPARTY_PATH}"
90 fi
91
92 if [ "$WOKSTATION" == "mac" ]; then
93   if [ "$DYLD_LIBRARY_PATH" != "" ]; then
94     export DYLD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${DYLD_LIBRARY_PATH}"
95   else
96     export DYLD_LIBRARY_PATH="${LD_LIBRARY_PATH}"
97   fi
98 fi
99
100 # ----- Set envoronment variables used by OCCT -----
101 export CSF_LANGUAGE=us
102 export MMGT_CLEAR=1
103 export CSF_EXCEPTION_PROMPT=1
104 export CSF_SHMessage="${CASROOT}/src/SHMessage"
105 export CSF_MDTVTexturesDirectory="${CASROOT}/src/Textures"
106 export CSF_ShadersDirectory="${CASROOT}/src/Shaders"
107 export CSF_XSMessage="${CASROOT}/src/XSMessage"
108 export CSF_TObjMessage="${CASROOT}/src/TObj"
109 export CSF_StandardDefaults="${CASROOT}/src/StdResource"
110 export CSF_PluginDefaults="${CASROOT}/src/StdResource"
111 export CSF_XCAFDefaults="${CASROOT}/src/StdResource"
112 export CSF_TObjDefaults="${CASROOT}/src/StdResource"
113 export CSF_StandardLiteDefaults="${CASROOT}/src/StdResource"
114 export CSF_UnitsLexicon="${CASROOT}/src/UnitsAPI/Lexi_Expr.dat"
115 export CSF_UnitsDefinition="${CASROOT}/src/UnitsAPI/Units.dat"
116 export CSF_IGESDefaults="${CASROOT}/src/XSTEPResource"
117 export CSF_STEPDefaults="${CASROOT}/src/XSTEPResource"
118 export CSF_XmlOcafResource="${CASROOT}/src/XmlOcafResource"
119 export CSF_MIGRATION_TYPES="${CASROOT}/src/StdResource/MigrationSheet.txt"
120
121 # Draw Harness special stuff
122 if [ -e "${CASROOT}/src/DrawResources" ]; then
123   export DRAWHOME="${CASROOT}/src/DrawResources"
124   export CSF_DrawPluginDefaults="${CASROOT}/src/DrawResources"
125
126   if [ -e "${CASROOT}/src/DrawResources/DrawDefault" ]; then
127     export DRAWDEFAULT="${CASROOT}/src/DrawResources/DrawDefault"
128   fi
129 fi
130
131 if [ -e "${CASROOT}/src/DrawResourcesProducts" ]; then
132   export CSF_DrawPluginProductsDefaults="${CASROOT}/src/DrawResourcesProducts"
133 fi
134