0030571: Visualization, TKOpenGl - mapped texture is ignored while drawing points
[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
910970ab 6# Reset values
e31a8e52 7export CASROOT="__CASROOT__"
910970ab 8export CASDEB=""
c7d774c5 9export TARGET="";
910970ab 10export HAVE_TBB="false";
11export HAVE_OPENCL="false";
12export HAVE_FREEIMAGE="false";
e22105a9 13export HAVE_FFMPEG="false";
910970ab 14export HAVE_VTK="false";
1ce0716b 15export HAVE_GLES2="false";
e22105a9 16export HAVE_ZLIB="false";
17export HAVE_LIBLZMA="false";
910970ab 18export MACOSX_USE_GLX="false";
19export CSF_OPT_INC=""
20export CSF_OPT_LIB32=""
21export CSF_OPT_LIB64=""
22export CSF_OPT_BIN32=""
23export CSF_OPT_BIN64=""
24
25# ----- Set local settings -----
e31a8e52 26if [ "${CASROOT}" != "" ] && [ -d "${aScriptPath}/${CASROOT}" ]; then
27 export CASROOT="${aScriptPath}/${CASROOT}"
28fi
29if [ "${CASROOT}" == "" ]; then
30 export CASROOT="${aScriptPath}"
31fi
249dd6ed 32if [ -e "${CASROOT}/custom.sh" ]; then source "${CASROOT}/custom.sh"; fi
e31a8e52 33
910970ab 34# Read script arguments
35shopt -s nocasematch
c7d774c5 36for i in $*
37do
38 if [ "$i" == "d" ] || [ "$i" == "debug" ]; then
39 export CASDEB="d"
316d77d9 40 elif [ "$i" == "i" ] || [ "$i" == "relwithdeb" ]; then
41 export CASDEB="i"
c7d774c5 42 elif [ "$i" == "cbp" ]; then
43 export TARGET="cbp";
44 elif [ "$i" == "xcd" ] || [ "$i" == "xcode" ]; then
45 export TARGET="xcd";
46 fi
47done
910970ab 48shopt -u nocasematch
49
50# ----- Setup Environment Variables -----
51anArch=`uname -m`
52if [ "$anArch" != "x86_64" ] && [ "$anArch" != "ia64" ]; then
53 export ARCH="32";
54else
55 export ARCH="64";
56fi
57
58aSystem=`uname -s`
59if [ "$aSystem" == "Darwin" ]; then
60 export WOKSTATION="mac";
61 export ARCH="64";
62else
63 export WOKSTATION="lin";
64fi
65
66export CASBIN=""
67if [ "${TARGET}" == "cbp" ]; then
68 export CASBIN="${WOKSTATION}/cbp"
69elif [ "${TARGET}" == "xcd" ]; then
70 export CASBIN="adm/mac/xcd/build"
71fi
72
73export CSF_OPT_INC="${CSF_OPT_INC}:${CASROOT}/inc"
74
75if [ "${TARGET}" == "cbp" ]; then
76 export CSF_OPT_LIB32D="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/libd"
77 export CSF_OPT_LIB64D="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/libd"
78 export CSF_OPT_LIB32="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/lib"
79 export CSF_OPT_LIB64="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/lib"
316d77d9 80 export CSF_OPT_LIB32I="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/libi"
81 export CSF_OPT_LIB64I="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/libi"
910970ab 82elif [ "${TARGET}" == "xcd" ]; then
83 export CSF_OPT_LIB32D="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/Debug"
84 export CSF_OPT_LIB64D="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/Debug"
85 export CSF_OPT_LIB32="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/Release"
86 export CSF_OPT_LIB64="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/Release"
316d77d9 87 export CSF_OPT_LIB32I="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/RelWithDebInfo"
88 export CSF_OPT_LIB64I="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/RelWithDebInfo"
910970ab 89fi
90
91export CSF_OPT_CMPL=""
92
93# Optiona 3rd-parties should be enabled by HAVE macros
e22105a9 94if [ "$HAVE_TBB" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_TBB"; fi
95if [ "$HAVE_OPENCL" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_OPENCL"; fi
96if [ "$HAVE_FREEIMAGE" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_FREEIMAGE"; fi
97if [ "$HAVE_FFMPEG" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_FFMPEG"; fi
e22105a9 98if [ "$HAVE_GLES2" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_GLES2"; fi
99if [ "$HAVE_VTK" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_VTK"; fi
100if [ "$HAVE_ZLIB" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_ZLIB"; fi
101if [ "$HAVE_LIBLZMA" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_LIBLZMA"; fi
910970ab 102# Option to compile OCCT with X11 libs on Mac OS X
e22105a9 103if [ "$MACOSX_USE_GLX" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DMACOSX_USE_GLX"; fi
910970ab 104
105# To split string into array
106aDelimBack=$IFS
107IFS=":"
108
109# 3rd-parties additional include paths
110set -- "$CSF_OPT_INC"
111declare -a aPartiesIncs=($*)
112for anItem in ${aPartiesIncs[*]}
113do
114 export CSF_OPT_CMPL="${CSF_OPT_CMPL} -I${anItem}";
115done
116
117# Append 3rd-parties to LD_LIBRARY_PATH
118if [ "$ARCH" == "32" ]; then
119 set -- "$CSF_OPT_LIB32"
120 declare -a aPartiesLibs=($*)
121 set -- "$CSF_OPT_LIB32D"
122 declare -a aPartiesLibsDeb=($*)
316d77d9 123 set -- "$CSF_OPT_LIB32I"
124 declare -a aPartiesLibsRelWithDebInfo=($*)
910970ab 125else
126 set -- "$CSF_OPT_LIB64"
127 declare -a aPartiesLibs=($*)
128 set -- "$CSF_OPT_LIB64D"
129 declare -a aPartiesLibsDeb=($*)
316d77d9 130 set -- "$CSF_OPT_LIB64I"
131 declare -a aPartiesLibsRelWithDebInfo=($*)
910970ab 132fi
133
134# Turn back value
135IFS=$aDelimBack
136
137OPT_LINKER_OPTIONS_DEB=""
138for anItem in ${aPartiesLibsDeb[*]}
139do
140 OPT_LINKER_OPTIONS_DEB="${OPT_LINKER_OPTIONS_DEB} -L${anItem}"
141done
142
316d77d9 143OPT_LINKER_OPTIONS_REL_WITH_DEB_INFO=""
144for anItem in ${aPartiesLibsRelWithDebInfo[*]}
145do
146 OPT_LINKER_OPTIONS_REL_WITH_DEB_INFO="${OPT_LINKER_OPTIONS_REL_WITH_DEB_INFO} -L${anItem}"
147done
148
910970ab 149OPT_LINKER_OPTIONS=""
150for anItem in ${aPartiesLibs[*]}
151do
152 if [ "${LD_LIBRARY_PATH}" == "" ]; then
153 export LD_LIBRARY_PATH="${anItem}"
154 else
155 export LD_LIBRARY_PATH="${anItem}:${LD_LIBRARY_PATH}"
156 fi
157 OPT_LINKER_OPTIONS="${OPT_LINKER_OPTIONS} -L${anItem}"
158done
159
160if [ "$ARCH" == "64" ]; then
161 export CSF_OPT_LNK64="$OPT_LINKER_OPTIONS"
162 export CSF_OPT_LNK64D="$OPT_LINKER_OPTIONS_DEB"
316d77d9 163 export CSF_OPT_LNK64I="$OPT_LINKER_OPTIONS_REL_WITH_DEB_INFO"
910970ab 164else
165 export CSF_OPT_LNK32="$OPT_LINKER_OPTIONS"
166 export CSF_OPT_LNK32D="$OPT_LINKER_OPTIONS_DEB"
316d77d9 167 export CSF_OPT_LNK32I="$OPT_LINKER_OPTIONS_REL_WITH_DEB_INFO"
910970ab 168fi
169
4b3541c6 170# ----- Default paths to sub-folders (can be different in install env) -----
171export CSF_OCCTIncludePath="${CSF_OCCTIncludePath:-$CASROOT/inc}"
172export CSF_OCCTResourcePath="${CSF_OCCTResourcePath:-$CASROOT/src}"
173export CSF_OCCTSamplesPath="${CSF_OCCTSamplesPath:-$CASROOT/samples}"
174export CSF_OCCTDataPath="${CSF_OCCTDataPath:-$CASROOT/data}"
175export CSF_OCCTTestsPath="${CSF_OCCTTestsPath:-$CASROOT/tests}"
910970ab 176
910970ab 177if [ "${TARGET}" == "xcd" ]; then
4b3541c6 178 if [ "${CASDEB}" == "d" ]; then
179 export CSF_OCCTBinPath="${CSF_OCCTBinPath:-$CASROOT/$CASBIN/Debug}"
180 else
181 export CSF_OCCTBinPath="${CSF_OCCTBinPath:-$CASROOT/$CASBIN/Release}"
182 fi
183 export CSF_OCCTLibPath="${CSF_OCCTLibPath:-$CSF_OCCTBinPath}"
184else
185 export CSF_OCCTBinPath="${CSF_OCCTBinPath:-$CASROOT/$CASBIN/bin$CASDEB}"
186 export CSF_OCCTLibPath="${CSF_OCCTLibPath:-$CASROOT/$CASBIN/lib$CASDEB}"
910970ab 187fi
188
4b3541c6 189export PATH="${CSF_OCCTBinPath}:${PATH}"
190export LD_LIBRARY_PATH="${CSF_OCCTLibPath}:${LD_LIBRARY_PATH}"
910970ab 191if [ "$WOKSTATION" == "mac" ]; then
192 export DYLD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${DYLD_LIBRARY_PATH}"
193fi
194
195# Set envoronment variables used by OCCT
196export CSF_LANGUAGE="us"
197export MMGT_CLEAR="1"
910970ab 198export CSF_SHMessage="${CASROOT}/src/SHMessage"
199export CSF_MDTVTexturesDirectory="${CASROOT}/src/Textures"
200export CSF_ShadersDirectory="${CASROOT}/src/Shaders"
201export CSF_XSMessage="${CASROOT}/src/XSMessage"
202export CSF_TObjMessage="${CASROOT}/src/TObj"
203export CSF_StandardDefaults="${CASROOT}/src/StdResource"
204export CSF_PluginDefaults="${CASROOT}/src/StdResource"
205export CSF_XCAFDefaults="${CASROOT}/src/StdResource"
206export CSF_TObjDefaults="${CASROOT}/src/StdResource"
207export CSF_StandardLiteDefaults="${CASROOT}/src/StdResource"
910970ab 208export CSF_IGESDefaults="${CASROOT}/src/XSTEPResource"
209export CSF_STEPDefaults="${CASROOT}/src/XSTEPResource"
210export CSF_XmlOcafResource="${CASROOT}/src/XmlOcafResource"
211export CSF_MIGRATION_TYPES="${CASROOT}/src/StdResource/MigrationSheet.txt"
212
213# Draw Harness special stuff
214if [ -e "${CASROOT}/src/DrawResources" ]; then
215 export DRAWHOME="${CASROOT}/src/DrawResources"
216 export CSF_DrawPluginDefaults="${DRAWHOME}"
217fi