0026458: BRepBuilderAPI_Copy does not copy mesh structure
[occt.git] / adm / templates / env.sh
CommitLineData
910970ab 1#!/bin/bash
2
3# go to the script directory
4aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath"; fi; aScriptPath="$PWD";
5
6export CASROOT="__CASROOT__"
7
8if [ "${CASROOT}" != "" ] && [ -d "${aScriptPath}/${CASROOT}" ]; then
9 export CASROOT="${aScriptPath}/${CASROOT}"
10fi
11if [ "${CASROOT}" == "" ]; then
12 export CASROOT="${aScriptPath}"
13fi
14
15# Reset values
16export CASDEB=""
17export HAVE_TBB="false";
18export HAVE_OPENCL="false";
19export HAVE_FREEIMAGE="false";
20export HAVE_GL2PS="false";
21export HAVE_VTK="false";
22export MACOSX_USE_GLX="false";
23export CSF_OPT_INC=""
24export CSF_OPT_LIB32=""
25export CSF_OPT_LIB64=""
26export CSF_OPT_BIN32=""
27export CSF_OPT_BIN64=""
28
29# ----- Set local settings -----
30if [ -e "${aScriptPath}/custom.sh" ]; then source "${aScriptPath}/custom.sh"; fi
31
32# Read script arguments
33shopt -s nocasematch
34export TARGET="";
35if [[ "$2" == "cbp" ]]; then
36 export TARGET="cbp";
37elif [[ "$2" == "xcd" ]]; then
38 export TARGET="xcd";
39fi
40if [[ "$1" == "debug" ]]; then export CASDEB="d"; fi
41if [[ "$1" == "d" ]]; then export CASDEB="d"; fi
42shopt -u nocasematch
43
44# ----- Setup Environment Variables -----
45anArch=`uname -m`
46if [ "$anArch" != "x86_64" ] && [ "$anArch" != "ia64" ]; then
47 export ARCH="32";
48else
49 export ARCH="64";
50fi
51
52aSystem=`uname -s`
53if [ "$aSystem" == "Darwin" ]; then
54 export WOKSTATION="mac";
55 export ARCH="64";
56else
57 export WOKSTATION="lin";
58fi
59
60export CASBIN=""
61if [ "${TARGET}" == "cbp" ]; then
62 export CASBIN="${WOKSTATION}/cbp"
63elif [ "${TARGET}" == "xcd" ]; then
64 export CASBIN="adm/mac/xcd/build"
65fi
66
67export CSF_OPT_INC="${CSF_OPT_INC}:${CASROOT}/inc"
68
69if [ "${TARGET}" == "cbp" ]; then
70 export CSF_OPT_LIB32D="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/libd"
71 export CSF_OPT_LIB64D="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/libd"
72 export CSF_OPT_LIB32="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/lib"
73 export CSF_OPT_LIB64="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/lib"
74elif [ "${TARGET}" == "xcd" ]; then
75 export CSF_OPT_LIB32D="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/Debug"
76 export CSF_OPT_LIB64D="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/Debug"
77 export CSF_OPT_LIB32="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/Release"
78 export CSF_OPT_LIB64="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/Release"
79fi
80
81export CSF_OPT_CMPL=""
82
83# Optiona 3rd-parties should be enabled by HAVE macros
84if [ "$HAVE_TBB" == "true" ]; then
85 export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_TBB"
86fi
87if [ "$HAVE_OPENCL" == "true" ]; then
88 export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_OPENCL"
89fi
90if [ "$HAVE_FREEIMAGE" == "true" ]; then
91 export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_FREEIMAGE"
92fi
93if [ "$HAVE_GL2PS" == "true" ]; then
94 export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_GL2PS"
95fi
96if [ "$HAVE_VTK" == "true" ]; then
97 export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_VTK"
98fi
99# Option to compile OCCT with X11 libs on Mac OS X
100if [ "$MACOSX_USE_GLX" == "true" ]; then
101 export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DMACOSX_USE_GLX"
102fi
103
104# To split string into array
105aDelimBack=$IFS
106IFS=":"
107
108# 3rd-parties additional include paths
109set -- "$CSF_OPT_INC"
110declare -a aPartiesIncs=($*)
111for anItem in ${aPartiesIncs[*]}
112do
113 export CSF_OPT_CMPL="${CSF_OPT_CMPL} -I${anItem}";
114done
115
116# Append 3rd-parties to LD_LIBRARY_PATH
117if [ "$ARCH" == "32" ]; then
118 set -- "$CSF_OPT_LIB32"
119 declare -a aPartiesLibs=($*)
120 set -- "$CSF_OPT_LIB32D"
121 declare -a aPartiesLibsDeb=($*)
122else
123 set -- "$CSF_OPT_LIB64"
124 declare -a aPartiesLibs=($*)
125 set -- "$CSF_OPT_LIB64D"
126 declare -a aPartiesLibsDeb=($*)
127fi
128
129# Turn back value
130IFS=$aDelimBack
131
132OPT_LINKER_OPTIONS_DEB=""
133for anItem in ${aPartiesLibsDeb[*]}
134do
135 OPT_LINKER_OPTIONS_DEB="${OPT_LINKER_OPTIONS_DEB} -L${anItem}"
136done
137
138OPT_LINKER_OPTIONS=""
139for anItem in ${aPartiesLibs[*]}
140do
141 if [ "${LD_LIBRARY_PATH}" == "" ]; then
142 export LD_LIBRARY_PATH="${anItem}"
143 else
144 export LD_LIBRARY_PATH="${anItem}:${LD_LIBRARY_PATH}"
145 fi
146 OPT_LINKER_OPTIONS="${OPT_LINKER_OPTIONS} -L${anItem}"
147done
148
149if [ "$ARCH" == "64" ]; then
150 export CSF_OPT_LNK64="$OPT_LINKER_OPTIONS"
151 export CSF_OPT_LNK64D="$OPT_LINKER_OPTIONS_DEB"
152else
153 export CSF_OPT_LNK32="$OPT_LINKER_OPTIONS"
154 export CSF_OPT_LNK32D="$OPT_LINKER_OPTIONS_DEB"
155fi
156
157
158BIN_PATH="${CASBIN}/bin${CASDEB}"
159LIBS_PATH="${CASBIN}/lib${CASDEB}"
160if [ "${TARGET}" == "xcd" ]; then
161 [[ "${CASDEB}" == "d" ]] && BIN_PATH="${CASBIN}/Debug" || BIN_PATH="${CASBIN}/Release"
162 LIBS_PATH="$BIN_PATH"
163fi
164
165export PATH="${CASROOT}/${BIN_PATH}:${PATH}"
166export LD_LIBRARY_PATH="${CASROOT}/${LIBS_PATH}:${LD_LIBRARY_PATH}"
167if [ "$WOKSTATION" == "mac" ]; then
168 export DYLD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${DYLD_LIBRARY_PATH}"
169fi
170
171# Set envoronment variables used by OCCT
172export CSF_LANGUAGE="us"
173export MMGT_CLEAR="1"
174export CSF_EXCEPTION_PROMPT="1"
175export CSF_SHMessage="${CASROOT}/src/SHMessage"
176export CSF_MDTVTexturesDirectory="${CASROOT}/src/Textures"
177export CSF_ShadersDirectory="${CASROOT}/src/Shaders"
178export CSF_XSMessage="${CASROOT}/src/XSMessage"
179export CSF_TObjMessage="${CASROOT}/src/TObj"
180export CSF_StandardDefaults="${CASROOT}/src/StdResource"
181export CSF_PluginDefaults="${CASROOT}/src/StdResource"
182export CSF_XCAFDefaults="${CASROOT}/src/StdResource"
183export CSF_TObjDefaults="${CASROOT}/src/StdResource"
184export CSF_StandardLiteDefaults="${CASROOT}/src/StdResource"
185export CSF_UnitsLexicon="${CASROOT}/src/UnitsAPI/Lexi_Expr.dat"
186export CSF_UnitsDefinition="${CASROOT}/src/UnitsAPI/Units.dat"
187export CSF_IGESDefaults="${CASROOT}/src/XSTEPResource"
188export CSF_STEPDefaults="${CASROOT}/src/XSTEPResource"
189export CSF_XmlOcafResource="${CASROOT}/src/XmlOcafResource"
190export CSF_MIGRATION_TYPES="${CASROOT}/src/StdResource/MigrationSheet.txt"
191
192# Draw Harness special stuff
193if [ -e "${CASROOT}/src/DrawResources" ]; then
194 export DRAWHOME="${CASROOT}/src/DrawResources"
195 export CSF_DrawPluginDefaults="${DRAWHOME}"
196fi
197if [ -e "${aScriptPath}/src/DrawResourcesProducts" ]; then
198 export CSF_DrawPluginProductsDefaults="${aScriptPath}/src/DrawResourcesProducts"
199fi