forked from Open-Cascade-SAS/OCCT
-
Notifications
You must be signed in to change notification settings - Fork 1
/
genproj
executable file
·47 lines (37 loc) · 1.27 KB
/
genproj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
# Helper script to run generation of CBP/XCode projects on Linux / OS X.
# Running it requires that Tcl should be in the PATH
anOldPath="$PATH"
anOldLd="$LD_LIBRARY_PATH"
anOldDyLd="$DYLD_LIBRARY_PATH"
# go to the script directory
aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath"; fi; aScriptPath="$PWD";
if [ ! -e "${aScriptPath}/env.sh" ]; then
cat ${aScriptPath}/adm/templates/env.sh | sed -e '/__CASROOT__/d' > ${aScriptPath}/env.sh
fi
aSystem=`uname -s`
aTarget="$1"
anOpt2=$2
anOpt3=$3
anOpt4=$4
anOpt5=$5
if [ ! -e "${aScriptPath}/custom.sh" ]; then
tclsh "${aScriptPath}/adm/genconf.tcl"
fi
if [ ! -e "${aScriptPath}/custom.sh" ]; then
echo "Error: custom.sh is not present."
echo "Run the script again to generate custom.sh, or create it manually"
exit 1
fi
source "${aScriptPath}/custom.sh"
if [ -e "${aScriptPath}/env.sh" ]; then source "${aScriptPath}/env.sh"; fi
if [ "$aTarget" == "" ]; then aTarget=$PRJFMT; fi;
if [ "$aTarget" == "" ]; then
aTarget="cbp"
if [ "$aSystem" == "Darwin" ]; then aTarget="xcd"; fi;
fi
cd $aScriptPath
tclsh "./adm/start.tcl" genproj ${aTarget} -solution "OCCT" $anOpt2 $anOpt3 $anOpt4 $anOpt5
export PATH="$anOldPath"
export LD_LIBRARY_PATH="$anOldLd"
export DYLD_LIBRARY_PATH="$anOldDyLd"