summaryrefslogtreecommitdiff
path: root/src/poi-service/poi-manager-server/build.sh
blob: 8fb1564989d9ae3e7e4bc95af6532323bfa5450c (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
#!/bin/bash

commonapi_tools_option=""
clean=0

while getopts cdh opt
do
	case $opt in
	c)
		clean=1
		;;
	d)
		debug="ON"
		;;
	h)
		echo "Usage:"
		echo "$0 [-cd]"
		echo "-c: Rebuild with clean"
		echo "-d: Enable the debug messages"
		exit 1
	esac
done
set -e

if [ ! $COMMONAPI_TOOL_GENERATOR ]
then 
	echo 'Set the link to the common api generator'
	echo 'export COMMONAPI_TOOL_GENERATOR=<tool>'
	exit 1
fi

if [ ! $COMMONAPI_DBUS_TOOL_GENERATOR ]
then 
	echo 'Set the link to the common api dbus generator'
	echo 'export COMMONAPI_DBUS_TOOL_GENERATOR=<tool>'
	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

commonapi_tools_option="-DDBUS_LIB_PATH="$DBUS_LIB_PATH" -DCOMMONAPI_DBUS_TOOL_GENERATOR="$COMMONAPI_DBUS_TOOL_GENERATOR" -DCOMMONAPI_TOOL_GENERATOR="$COMMONAPI_TOOL_GENERATOR


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

echo 'build poi-manager-server'
if [ "$clean" = 1 ]
then
	cmake $commonapi_tools_option -DWITH_DEBUG=$debug ../
fi
make