-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.sh
executable file
·54 lines (44 loc) · 1.08 KB
/
build.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
#!/bin/bash
USAGE=\
"./build.sh [-dh] [backends]
This script builds the roviz framework with the specified backends, or all default backends if none is specified.
-d Build the documentation
-h Show this help"
BUILDDOCS=false
while getopts :dh opt; do
case $opt in
d)
BUILDDOCS=true
;;
h)
echo "$USAGE"
;;
\?)
echo "Invalid option: -$OPTARG" >&2
echo "$USAGE"
exit 1
;;
esac
done
shift $((OPTIND-1))
if [[ "$BUILDDOCS" = true ]]; then
# If we wanted to use 'make docs', we would have to run qmake with
# a random backend first, which is rather ugly. Or run it with every
# backend, which is very redundant
if ! doxygen; then
echo "Failed to build documentation" >&2
exit 1
fi
fi
if [[ -z "$@" ]]; then
BACKENDS="Dev Cmdline"
else
BACKENDS=$@
fi
for BACKEND in $BACKENDS; do
if ! (qmake -r BACKEND="$BACKEND" && make -j 4); then
echo "Failed to build backend $BACKEND" >&2
exit 1
fi
done
exit 0