diff options
author | <philippe colliot> | 2015-06-01 17:22:54 +0200 |
---|---|---|
committer | <philippe colliot> | 2015-06-01 17:22:54 +0200 |
commit | 67c03d54148e53ecdc2c8b1501d02e9bbb8612a8 (patch) | |
tree | 7abfb5c99ddcec903b67668f76af92ecb0e6ac85 /src/poi-service | |
parent | 01f8523cdb2a5407e15e2ac84008f2a8695fa4a3 (diff) | |
download | poi-service-67c03d54148e53ecdc2c8b1501d02e9bbb8612a8.tar.gz |
start migration of poi-service to fully based cmake build
Diffstat (limited to 'src/poi-service')
-rw-r--r-- | src/poi-service/CMakeLists.txt | 51 | ||||
-rw-r--r-- | src/poi-service/README | 28 | ||||
-rw-r--r-- | src/poi-service/poi-manager-server/CMakeLists.txt | 19 | ||||
-rw-r--r-- | src/poi-service/poi-server/CMakeLists.txt | 16 | ||||
-rw-r--r-- | src/poi-service/poi-server/poi-server-class.h | 16 | ||||
-rwxr-xr-x | src/poi-service/run (renamed from src/poi-service/script/run) | 13 | ||||
-rwxr-xr-x | src/poi-service/script/build-for-commonapi.sh | 77 | ||||
-rwxr-xr-x | src/poi-service/script/build.sh | 92 | ||||
-rw-r--r-- | src/poi-service/script/poi-database-managed.db | bin | 36864 -> 36864 bytes |
9 files changed, 101 insertions, 211 deletions
diff --git a/src/poi-service/CMakeLists.txt b/src/poi-service/CMakeLists.txt new file mode 100644 index 0000000..f5a5790 --- /dev/null +++ b/src/poi-service/CMakeLists.txt @@ -0,0 +1,51 @@ +########################################################################### +# @licence app begin@ +# SPDX-License-Identifier: MPL-2.0 +# +# Component Name: poi-server +# +# Author: Philippe Colliot +# +# Copyright (C) 2014, PCA Peugeot Citroën +# +# License: +# This Source Code Form is subject to the terms of the +# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with +# this file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# @licence end@ +########################################################################### +project(poi-server) +cmake_minimum_required(VERSION 2.8) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") + +message(STATUS "poi-server") + +option(WITH_FRANCA_INTERFACE + "Build using the Franca interfaces" OFF) +option(WITH_DBUS_INTERFACE + "Build using the D-Bus interfaces" ON) +option(WITH_DEBUG + "Enable the debug messages" OFF) + +message(STATUS "WITH_FRANCA_INTERFACE = ${WITH_FRANCA_INTERFACE}") +message(STATUS "WITH_DBUS_INTERFACE = ${WITH_DBUS_INTERFACE}") +message(STATUS "WITH_DEBUG = ${WITH_DEBUG}") + +set(COMMON_DIR "${CMAKE_CURRENT_SOURCE_DIR}/poi-common") +set(API_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../api") +set(DBUS_GENERATED_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/dbus-include") +set(COMMON_API_GENERATED_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../api/franca/navigation/src-gen") +set(DBUS_LIB_PATH "/usr/local/lib") + +add_subdirectory(${API_DIR}/navigation-core "${DBUS_GENERATED_INCLUDE_DIR}/navigation-core") + +add_subdirectory(${API_DIR}/map-viewer "${DBUS_GENERATED_INCLUDE_DIR}/map-viewer") + +add_subdirectory(${API_DIR}/poi-service "${DBUS_GENERATED_INCLUDE_DIR}/poi-service") + +add_subdirectory(poi-server) + +if (WITH_FRANCA_INTERFACE) + add_subdirectory(poi-manager-server) +endif() diff --git a/src/poi-service/README b/src/poi-service/README index 0135f2b..591a570 100644 --- a/src/poi-service/README +++ b/src/poi-service/README @@ -33,15 +33,27 @@ git clone http://git.projects.genivi.org/lbs/navigation-service.git $WORKING-DIR Dependencies: libqt4-dev libdbus-c++-dev libsqlite3-dev sqlite3 libglib2.0-dev libglibmm-2.4-dev libdbus-1-dev xsltproc +=============================== +How To Build +=============================== + +Create and enter the build folder: +mkdir ./build +cd build + Build: -# Build is based on cmake -# Enter into the directory -cd $WORKING-DIR/navigation-service/src/poi-service/script -./build.sh +cmake ../ +make +cd .. + +Build the Franca based code (unreleased version) in debug mode +cmake -DCMAKE_BUILD_TYPE=Debug . -DWITH_FRANCA_INTERFACE=ON ../ +make +cd .. -To launch: -./run +=============================== +How To Run +=============================== -Clean up: -./kill-all +./run diff --git a/src/poi-service/poi-manager-server/CMakeLists.txt b/src/poi-service/poi-manager-server/CMakeLists.txt index c5f5fb0..07b123e 100644 --- a/src/poi-service/poi-manager-server/CMakeLists.txt +++ b/src/poi-service/poi-manager-server/CMakeLists.txt @@ -22,7 +22,6 @@ set(COMMON_API_VERSION CommonAPI-2.1) set(CMAKE_VERBOSE_MAKEFILE off) cmake_minimum_required(VERSION 2.8) -set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-Wall -O0 -std=c++0x -std=gnu++11") # DBus Path if (DBUS_LIB_PATH) @@ -41,20 +40,18 @@ pkg_check_modules(GLIBMM glibmm-2.4) pkg_check_modules(GOBJECT gobject-2.0) # Source Files -set(PRJ_SRC_PATH .) -set(PRJ_COMMON_SRC_PATH ../poi-common) -set(PRJ_SRC_GEN_PATH ${COMMON_API_PATH_GENERATED_FILES}/org/genivi) -FILE(GLOB PRJ_LOCAL_SRCS ${PRJ_SRC_PATH}/*.cpp) -FILE(GLOB PRJ_COMMON_SRCS ${PRJ_COMMON_SRC_PATH}/*.cpp) +set(PRJ_SRC_GEN_PATH ${COMMON_API_GENERATED_INCLUDE_DIR}/org/genivi) +FILE(GLOB PRJ_LOCAL_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +FILE(GLOB PRJ_COMMON_SRCS ${COMMON_DIR}/*.cpp) FILE(GLOB PRJ_STUB_GEN_SRCS ${PRJ_SRC_GEN_PATH}/${ROOT_API}/${PARENT_API}/*Stub*.cpp) FILE(GLOB PRJ_STUB_GEN_TYPES ${PRJ_SRC_GEN_PATH}/${ROOT_API}/${PARENT_API}/*Types*.cpp ${PRJ_SRC_GEN_PATH}/${ROOT_API}/*Types*.cpp) -FILE(GLOB PRJ_STUB_IMPL_SRCS ${PRJ_SRC_PATH}/*stub*.cpp) -set(PRJ_SRCS ${PRJ_LOCAL_SRCS} ${PRJ_COMMON_SRCS} ${PRJ_STUB_GEN_SRCS} ${PRJ_STUB_GEN_TYPES} ${PRJ_STUB_IMPL_SRCS}) +set(PRJ_SRCS ${PRJ_LOCAL_SRCS} ${PRJ_COMMON_SRCS} ${PRJ_STUB_GEN_SRCS} ${PRJ_STUB_GEN_TYPES}) +message(STATUS "${PRJ_SRCS}") include_directories( - ${PRJ_SRC_PATH} - ${PRJ_COMMON_SRC_PATH} - ${COMMON_API_PATH_GENERATED_FILES} + ${CMAKE_CURRENT_SOURCE_DIR} + ${COMMON_DIR} + ${COMMON_API_GENERATED_INCLUDE_DIR} ${DBUS_INCLUDE_DIRS} ${COMMONAPI_INCLUDEDIR}/${COMMON_API_VERSION} ${COMMONAPI_DBUS_INCLUDEDIR} diff --git a/src/poi-service/poi-server/CMakeLists.txt b/src/poi-service/poi-server/CMakeLists.txt index e58cb6f..38cf342 100644 --- a/src/poi-service/poi-server/CMakeLists.txt +++ b/src/poi-service/poi-server/CMakeLists.txt @@ -17,13 +17,10 @@ ########################################################################### project(poi-server) cmake_minimum_required(VERSION 2.8) -set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -std=gnu++11) message(STATUS "poi-server") find_package(PkgConfig REQUIRED) -find_program(XSLTPROC xsltproc REQUIRED) -find_program(DBUSXML2CPP dbusxx-xml2cpp REQUIRED) pkg_check_modules(DBUS_CPP dbus-c++-1) pkg_check_modules(GLIB REQUIRED glib-2.0) @@ -33,16 +30,15 @@ pkg_check_modules(GOBJECT gobject-2.0) pkg_check_modules(DBUS dbus-1) pkg_check_modules(DBUS_CPP_GLIB dbus-c++-glib-1) -set(PRJ_SRC_PATH .) -set(PRJ_COMMON_SRC_PATH ../../../src/poi-service/poi-common) - #common files shared with poi server -file(GLOB PRJ_COMMON_SRCS ${PRJ_COMMON_SRC_PATH}/*.cpp) +file(GLOB PRJ_COMMON_SRCS ${COMMON_DIR}/*.cpp) include_directories( - ${PRJ_SRC_PATH} - ${PRJ_COMMON_SRC_PATH} - ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${COMMON_DIR} + ${DBUS_GENERATED_INCLUDE_DIR}/navigation-core + ${DBUS_GENERATED_INCLUDE_DIR}/map-viewer + ${DBUS_GENERATED_INCLUDE_DIR}/poi-service ${DBUS_CPP_INCLUDE_DIRS} ${GLIB_INCLUDE_DIRS} ${SQLITE3_INCLUDE_DIRS} diff --git a/src/poi-service/poi-server/poi-server-class.h b/src/poi-service/poi-server/poi-server-class.h index 6015f9c..7fbaa8a 100644 --- a/src/poi-service/poi-server/poi-server-class.h +++ b/src/poi-service/poi-server/poi-server-class.h @@ -28,14 +28,14 @@ #ifndef POIPOCSERVERCLASS_H #define POIPOCSERVERCLASS_H -#include "../../../api/include/genivi-mapviewer-constants.h" -#include "../../../api/include/genivi-navigationcore-constants.h" -#include "../../../api/include/genivi-poiservice-constants.h" -#include "../../../api/include/genivi-poiservice-poisearch_adaptor.h" -#include "../../../api/include/genivi-poiservice-poicontentaccess_adaptor.h" -#include "../../../api/include/genivi-poiservice-configuration_adaptor.h" -#include "../../../api/include/genivi-navigationcore-routing_proxy.h" -#include "../../../api/include/genivi-poiservice-contentaccessmodule_proxy.h" +#include "genivi-mapviewer-constants.h" +#include "genivi-navigationcore-constants.h" +#include "genivi-poiservice-constants.h" +#include "genivi-poiservice-poisearch_adaptor.h" +#include "genivi-poiservice-poicontentaccess_adaptor.h" +#include "genivi-poiservice-configuration_adaptor.h" +#include "genivi-navigationcore-routing_proxy.h" +#include "genivi-poiservice-contentaccessmodule_proxy.h" #include <dbus-c++/glib-integration.h> #include "poi-common-dbus-data-model.h" diff --git a/src/poi-service/script/run b/src/poi-service/run index d646a44..428e808 100755 --- a/src/poi-service/script/run +++ b/src/poi-service/run @@ -28,19 +28,22 @@ echo '------------------------start the server------------------------' CURDIR=$PWD -ROOT_DIR=$CURDIR/.. -BIN_DIR=$ROOT_DIR/bin +ROOT_DIR=$CURDIR +SCRIPT_DIR=$ROOT_DIR/script +BIN_DIR=$ROOT_DIR/build SERVER_EXE_DIR=$BIN_DIR/poi-server MANAGER_SERVER_EXE_DIR=$BIN_DIR/poi-manager-server -MAIN_DATABASE='poi-database-sample.db' +MAIN_DATABASE=$SCRIPT_DIR/poi-database-sample.db +ADDITIONAL_DATABASE=$SCRIPT_DIR/poi-database-managed.db echo 'kill orphan process if necessary' -$CURDIR/kill-all +$SCRIPT_DIR/kill-all echo 'run' $SERVER_EXE_DIR/poi-server -f $MAIN_DATABASE & echo '------------------------start the manager server------------------------' -$MANAGER_SERVER_EXE_DIR/poi-manager-server & +#$MANAGER_SERVER_EXE_DIR/poi-manager-server -f $ADDITIONAL_DATABASE & + diff --git a/src/poi-service/script/build-for-commonapi.sh b/src/poi-service/script/build-for-commonapi.sh deleted file mode 100755 index 4a14a26..0000000 --- a/src/poi-service/script/build-for-commonapi.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/bash - -########################################################################### -# @licence app begin@ -# SPDX-License-Identifier: MPL-2.0 -# -# Component Name: poi-server -# Author: Philippe Colliot <philippe.colliot@mpsa.com> -# -# Copyright (C) 2013-2014, PCA Peugeot Citroen -# -# License: -# This Source Code Form is subject to the terms of the -# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with -# this file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# @licence end@ -########################################################################### -POI_MANAGER_SERVER=poi-manager-server - -target_root=$PWD/.. -target_bin=$PWD/../bin #by default - -set-path() -{ - TOP_DIR=$target_root - TOP_BIN_DIR=$target_bin - POI_MANAGER_SERVER_SRC_DIR=$TOP_DIR/$POI_MANAGER_SERVER - POI_MANAGER_SERVER_BIN_DIR=$TOP_BIN_DIR/$POI_MANAGER_SERVER -} - -usage() { - echo "Usage: ./build.sh [command]" - echo - echo "command:" - echo " make Build" - echo " clean Clean" - echo " help Print Help" - echo - echo -} - -build() { - - echo '' - echo 'Building poi-manager-server' - - cd $TOP_BIN_DIR - mkdir -p $POI_MANAGER_SERVER - cd $POI_MANAGER_SERVER_BIN_DIR - cmake -DCOMMON_API_PATH_GENERATED_FILES=../../../api/franca/navigation/src-gen -DDBUS_LIB_PATH=/usr/local/lib $POI_MANAGER_SERVER_SRC_DIR && make - -} - -clean() { - echo 'delete' $TOP_BIN_DIR - rm -rf $TOP_BIN_DIR -} - - -set -e - -if [ $# -ge 1 ]; then - if [ $1 = help ]; then - usage - elif [ $1 = make ]; then - set-path - build - elif [ $1 = clean ]; then - set-path - clean - else - usage - fi -else - usage -fi diff --git a/src/poi-service/script/build.sh b/src/poi-service/script/build.sh deleted file mode 100755 index 3fc0f1a..0000000 --- a/src/poi-service/script/build.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/bin/bash - -########################################################################### -# @licence app begin@ -# SPDX-License-Identifier: MPL-2.0 -# -# Component Name: poi-server -# Author: Philippe Colliot <philippe.colliot@mpsa.com> -# -# Copyright (C) 2013-2014, PCA Peugeot Citroen -# -# License: -# This Source Code Form is subject to the terms of the -# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with -# this file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# @licence end@ -########################################################################### -POI_SERVER=poi-server -POI_COMMON=poi-common -NAVIGATION_CORE=navigation-core -MAP_VIEWER=map-viewer -POI_SERVICE=poi-service - -target_root=$PWD/.. -target_bin=$PWD/../bin #by default - -set-path() -{ - TOP_DIR=$target_root - TOP_BIN_DIR=$target_bin - API_DIR=$TOP_DIR/../../api - - POI_SERVER_SRC_DIR=$TOP_DIR/$POI_SERVER - POI_SERVER_BIN_DIR=$TOP_BIN_DIR/$POI_SERVER - POI_COMMON_SRC_DIR=$TOP_DIR/$POI_COMMON -} - -usage() { - echo "Usage: ./build.sh [command]" - echo - echo "command:" - echo " make Build" - echo " clean Clean" - echo " help Print Help" - echo - echo -} - -build() { - echo '' - echo 'Building poi-server' - - echo 'Generate DBus include files' - - cd $API_DIR - mkdir -p include - cd $API_DIR/$NAVIGATION_CORE && cmake . - cd $API_DIR/$MAP_VIEWER && cmake . - cd $API_DIR/$POI_SERVICE && cmake . - - cd $TOP_DIR - mkdir -p bin - cd $TOP_BIN_DIR - mkdir -p $POI_SERVER - cd $POI_SERVER_BIN_DIR - cmake -Dapi_DIR=$API_DIR -Dgenerated_api_DIR=$GENERATED_API_DIR $POI_SERVER_SRC_DIR && make -} - -clean() { - echo 'delete' $TOP_BIN_DIR - rm -rf $TOP_BIN_DIR -} - - -set -e - -if [ $# -ge 1 ]; then - if [ $1 = help ]; then - usage - elif [ $1 = make ]; then - set-path - build - elif [ $1 = clean ]; then - set-path - clean - else - usage - fi -else - usage -fi diff --git a/src/poi-service/script/poi-database-managed.db b/src/poi-service/script/poi-database-managed.db Binary files differindex 1ce796e..52c495e 100644 --- a/src/poi-service/script/poi-database-managed.db +++ b/src/poi-service/script/poi-database-managed.db |