File: genproj

package info (click to toggle)
opencascade 7.8.1%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 293,924 kB
  • sloc: cpp: 1,249,635; tcl: 15,974; cs: 5,173; java: 1,554; sh: 1,354; ansic: 821; xml: 737; makefile: 26; javascript: 22
file content (47 lines) | stat: -rwxr-xr-x 1,302 bytes parent folder | download | duplicates (4)
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"