forked from gerasimou/UNDERSEA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·74 lines (63 loc) · 1.82 KB
/
setup.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
#!/bin/bash
ORTOOLS="no"
MATLAB="no"
MOOS="no"
CLEAN="no"
print_usage_and_exit()
{
printf "Options: \n"
printf " --help, -h \n"
printf " --all \n"
printf " Build all libraries (no clean) \n"
printf " --moos \n"
printf " Fetch and build moos \n"
printf " --matlab \n"
printf " Fetch and install MATLAB runtime \n"
printf " --ortools \n"
printf " Fetch Google OR Tools \n"
printf " --clean \n"
printf " Empty libraries directory \n"
exit 1
}
for ARGI; do
if [ "${ARGI}" = "--moos" ] ; then
MOOS="yes"
elif [ "${ARGI}" = "--matlab" ] ; then
MATLAB="yes"
elif [ "${ARGI}" = "--ortools" ] ; then
ORTOOLS="yes"
elif [ "${ARGI}" = "--clean" ] ; then
CLEAN="yes"
elif [ "${ARGI}" = "--all" ] ; then
MOOS="yes"
MATLAB="yes"
ORTOOLS="yes"
elif [ "${ARGI}" = "--help" -o "${ARGI}" = "-h" ] ; then
print_usage_and_exit;
fi
done
if [ "$#" = 0 ] ; then
print_usage_and_exit;
fi
echo "Detected OSTYPE: " $OSTYPE
if [ ${CLEAN} = "yes" ] ; then
rm -rf libraries
echo "AUTO GENERATED DIRECTORY. ANY FILES WILL BE LOST" >libraries/README.txt
fi
mkdir libraries
cd libraries
if [ ${ORTOOLS} = "yes" ] ; then
./../ortools.sh
fi
if [ ${MATLAB} = "yes" ] ; then
./../matlab.sh
fi
if [ ${MOOS} = "yes" ] ; then
if [[ "$OSTYPE" == "linux-gnu" ]]; then
./../moos-linux.sh
elif [[ "$OSTYPE" == "darwin"* ]]; then
./../moos-osx.sh
else
echo "OS not supported yet due to MOOS not supporting it"
fi
fi