-
Notifications
You must be signed in to change notification settings - Fork 6
/
build-VR2Gather.sh
executable file
·94 lines (91 loc) · 2.04 KB
/
build-VR2Gather.sh
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/bash
# Ensure the correct version of Unity is on PATH (for example C:\Program Files\Unity\Hub\Editor\2019.3.15f1\Editor\Unity.exe)
# Ensure the installed folder (on the same level as Testbed) has the DLLs and executables and such
dirname=`dirname $0`
dirname=`cd $dirname ; pwd`
INSTALL_PCL=false
DEST=built-VR2Gather
UNITY_VERSION=2019.4.35f1
unitycmd=Unity
unityflag=
output=
mac=false
win=false
linux=false
case `uname -s` in
Darwin)
mac=true
unitycmd=/Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/MacOS/Unity
unityflag=-buildOSXUniversalPlayer
output=VR2Gather.app
;;
MINGW64*)
win=true
unitycmd=Unity
unityflag=-buildWindows64Player
output=VR2Gather.exe
;;
Linux*)
linux=true
unitycmd=/Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/MacOS/Unity
unityflag=-buildLinux64Player
output=VR2Gather
;;
*)
echo Unknown system `uname -s`
exit 1
;;
esac
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
--verbose)
set -x
shift
;;
--pcl)
INSTALL_PCL=true
shift # past argument
;;
--dest)
DEST="$2"
shift
shift
;;
--help)
echo "Usage: $0 [--pcl]"
echo "Creates VR2Gather app in $dirname/$DEST"
echo "--pcl Includes pointcloud DLLs and support programs (must be in expected location)"
exit 0
;;
*) # unknown option
echo Unknown option: $key
exit 1
;;
esac
done
set -x
cd $dirname
rm -rf $DEST buildlog.txt
if ! $unitycmd -batchmode -projectPath . $unityflag $DEST/$output -quit -logfile buildlog.txt; then
echo ============= Unity build failed. Logfile contents below ==========
cat buildlog.txt
echo ============= Unity build failed. Logfile contents above ==========
exit 1
fi
if $INSTALL_PCL; then
if $win; then
mkdir $DEST/bin
mkdir $DEST/dll
cp ../installed/bin/*.{exe,bat,sh} $DEST/bin
cp ../installed/bin/*.{dll,smd,so} $DEST/dll
cp -r ../installed/share $DEST/share
fi
if $mac; then
echo Copying pointcloud dynamic libraries not yet implemented for mac
fi
if $linux; then
echo Copying pointcloud dynamic libraries not yet implemented for linux
fi
fi