summaryrefslogtreecommitdiff
path: root/src/navigation/build.sh
blob: c36b6812d0e2874b357bd549fae32625d5eaa563 (plain)
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
#!/bin/bash

clean=0
capi=0

function check_path_for_capi
{
	if [ ! $COMMONAPI_TOOL_DIR ]
	then 
		echo 'Set the dir of the common api tools'
		echo 'export COMMONAPI_TOOL_DIR=<path>'
		exit 1
	fi

	if [ ! $COMMONAPI_DBUS_TOOL_DIR ]
	then 
		echo 'Set the dir of the common api dbus tools'
		echo 'export COMMONAPI_DBUS_TOOL_DIR=<path>'
		exit 1
	fi

	if [ ! $DBUS_LIB_PATH ]
	then 
		echo 'Set the dir of the patched dbus'
		echo 'export DBUS_LIB_PATH=<path>'
		exit 1
	fi
}
 
while getopts cm opt
do
	case $opt in
	c)
		clean=1
		;;
	m)
		capi=1
		;;
	\?)
		echo "Usage:"
		echo "$0 [-c] [-m]"
		echo "-c: build with clean"
		echo "-m: build with commonAPI plugins "
		exit 1
	esac
done

if [ "$capi" = 1 ]
then
	check_path_for_capi
fi

if [ "$clean" = 1 ]
then
	echo 'clean up the build folder'
	if [ -d "./build" ]
	then
		find ./build ! -name '*.cbp' -type f -exec rm -f {} +
	fi
fi

mkdir -p build
cd build
mkdir -p navit
cd navit
echo 'build navit'
if [ "$clean" = 1 ]
then
	cmake -DDISABLE_QT=1 -DSAMPLE_MAP=0 -Dvehicle/null=1 -Dgraphics/qt_qpainter=0 ../../navit/
fi
make
cd ../
echo 'build navigation'
if [ "$clean" = 1 ]
then
	if [ "$capi" = 0 ]
	then
		cmake -DWITH_PLUGIN_MIGRATION=0 ../
	else
		cmake -DWITH_PLUGIN_MIGRATION=1 -DDBUS_LIB_PATH=$DBUS_LIB_PATH -DCOMMONAPI_TOOL_DIR=$COMMONAPI_TOOL_DIR -DCOMMONAPI_DBUS_TOOL_DIR=$COMMONAPI_DBUS_TOOL_DIR ../
	fi
fi
make
cd ..