3 # Helper script to run generation of CBP/XCode projects on Linux / OS X.
4 # Running it requires that Tcl should be in the PATH
7 anOldLd="$LD_LIBRARY_PATH"
8 anOldDyLd="$DYLD_LIBRARY_PATH"
10 # go to the script directory
11 aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath"; fi; aScriptPath="$PWD";
12 if [ ! -e "${aScriptPath}/env.sh" ]; then
13 cat ${aScriptPath}/adm/templates/env.sh | sed -e '/__CASROOT__/d' > ${aScriptPath}/env.sh
23 if [ ! -e "${aScriptPath}/custom.sh" ]; then
24 tclsh "${aScriptPath}/adm/genconf.tcl"
27 if [ ! -e "${aScriptPath}/custom.sh" ]; then
28 echo "Error: custom.sh is not present."
29 echo "Run the script again to generate custom.sh, or create it manually"
32 source "${aScriptPath}/custom.sh"
34 if [ -e "${aScriptPath}/env.sh" ]; then source "${aScriptPath}/env.sh"; fi
36 if [ "$aTarget" == "" ]; then aTarget=$PRJFMT; fi;
37 if [ "$aTarget" == "" ]; then
39 if [ "$aSystem" == "Darwin" ]; then aTarget="xcd"; fi;
43 tclsh "./adm/start.tcl" genproj ${aTarget} -solution "OCCT" $anOpt2 $anOpt3 $anOpt4 $anOpt5
45 export PATH="$anOldPath"
46 export LD_LIBRARY_PATH="$anOldLd"
47 export DYLD_LIBRARY_PATH="$anOldDyLd"