diff options
Diffstat (limited to 'src/poi-service')
-rwxr-xr-x | src/poi-service/rebuild_all.sh | 57 |
1 files changed, 43 insertions, 14 deletions
diff --git a/src/poi-service/rebuild_all.sh b/src/poi-service/rebuild_all.sh index 2ef165a..677fc3d 100755 --- a/src/poi-service/rebuild_all.sh +++ b/src/poi-service/rebuild_all.sh @@ -1,17 +1,46 @@ #!/bin/bash -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 +debug="OFF" +franca="OFF" +dbus="ON" +commonapi_tools_option="" + +while getopts df opt +do + case $opt in + d) + debug="ON" + ;; + f) + franca="ON" + dbus="OFF" + ;; + \?) + echo "Usage:" + echo "$0 [-df]" + echo "-d: Enable the debug messages" + echo "-f: Build using the Franca interfaces" + exit 1 + esac +done +set -e + +if [ $franca="ON" ] +then + 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 + commonapi_tools_option="-DCOMMONAPI_DBUS_TOOL_DIR="$COMMONAPI_DBUS_TOOL_DIR" -DCOMMONAPI_TOOL_DIR="$COMMONAPI_TOOL_DIR fi echo 'delete the build folder' @@ -20,8 +49,8 @@ rm -rf build mkdir build cd build -echo 'build with CommonAPI' -cmake -DWITH_FRANCA_DBUS_INTERFACE=ON -DWITH_DBUS_INTERFACE=OFF -DCOMMONAPI_DBUS_TOOL_DIR=$COMMONAPI_DBUS_TOOL_DIR -DCOMMONAPI_TOOL_DIR=$COMMONAPI_TOOL_DIR -DWITH_DEBUG=ON . ../ +echo 'build poi-server' +cmake -DWITH_FRANCA_DBUS_INTERFACE=$franca -DWITH_DBUS_INTERFACE=$dbus $commonapi_tools_option -DWITH_DEBUG=$debug ../ make |