summaryrefslogtreecommitdiff
path: root/enhanced-position-service/src/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'enhanced-position-service/src/CMakeLists.txt')
-rw-r--r--enhanced-position-service/src/CMakeLists.txt101
1 files changed, 51 insertions, 50 deletions
diff --git a/enhanced-position-service/src/CMakeLists.txt b/enhanced-position-service/src/CMakeLists.txt
index 8e8359c..34ea850 100644
--- a/enhanced-position-service/src/CMakeLists.txt
+++ b/enhanced-position-service/src/CMakeLists.txt
@@ -4,43 +4,20 @@
#
# Component Name: EnhancedPositionService
#
-# Author: Thomas Bader, Marco Residori
+# Author: Marco Residori
#
-# Copyright (C) 2012, BMW Car IT GmbH, XS Embedded GmbH
+# Copyright (C) 2014, XS Embedded GmbH
#
# 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/.
#
-# List of changes:
-#
-# 15/6/2014, Philippe Colliot, migrate to Qt5
-#
# @licence end@
###########################################################################
-cmake_minimum_required(VERSION 2.8.11)
-
-project(position-daemon)
-
-# Find includes in corresponding build directories
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-# Instruct CMake to run moc automatically when needed.
-set(CMAKE_AUTOMOC ON)
-
-# Manage packages
-find_package(PkgConfig)
-
-# Set Qt stuff
-find_package(Qt5Core)
-find_package(Qt5DBus)
-get_target_property(QtCore_location Qt5::Core LOCATION)
-get_target_property(QtDBus_location Qt5::DBus LOCATION)
-include_directories(${Qt5Core_INCLUDE_DIRS} ${Qt5DBus_INCLUDE_DIRS})
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}")
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5DBus_EXECUTABLE_COMPILE_FLAGS}")
+project(enhanced-position-service)
+cmake_minimum_required(VERSION 2.6.0)
message(STATUS "ENHANCED-POSITION-SERVICE")
message(STATUS "WITH_DLT = ${WITH_DLT}")
@@ -48,11 +25,51 @@ message(STATUS "WITH_GPSD = ${WITH_GPSD}")
message(STATUS "WITH_REPLAYER = ${WITH_REPLAYER}")
message(STATUS "WITH_TESTS = ${WITH_TESTS}")
-include_directories("${PROJECT_SOURCE_DIR}/../../common")
+find_package(PkgConfig REQUIRED)
+
+pkg_check_modules(DBUS_CPP dbus-c++-1)
+
+include_directories("${PROJECT_SOURCE_DIR}/../api")
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
+include_directories(${DBUS_CPP_INCLUDE_DIRS})
+include_directories(${gnss-service_INCLUDE_DIRS})
+include_directories(${sensors-service_INCLUDE_DIRS})
+
+# Generate the client glue code before building the client
+add_custom_command(
+ OUTPUT enhanced-position-adaptor.h
+ COMMAND dbusxx-xml2cpp ${CMAKE_CURRENT_SOURCE_DIR}/../api/genivi-positioning-enhancedposition.xml
+ --adaptor=enhanced-position-adaptor.h
+ OUTPUT position-feedback-adaptor.h
+ COMMAND dbusxx-xml2cpp ${CMAKE_CURRENT_SOURCE_DIR}/../api/genivi-positioning-positionfeedback.xml
+ --adaptor=position-feedback-adaptor.h
+ OUTPUT configuration-adaptor.h
+ COMMAND dbusxx-xml2cpp ${CMAKE_CURRENT_SOURCE_DIR}/../api/genivi-positioning-configuration.xml
+ --adaptor=configuration-adaptor.h
+ OUTPUT positioning-constants.h
+ COMMAND xsltproc ${CMAKE_CURRENT_SOURCE_DIR}/../api/enum.xsl ${CMAKE_CURRENT_SOURCE_DIR}/../api/genivi-positioning-constants.xml > positioning-constants.h
+)
+
+link_directories(
+ ${DBUS_CPP_LIBRARY_DIRS}
+ ${gnss-service_LIBRARY_DIRS}
+ ${sensors-service_LIBRARY_DIRS})
+
+add_executable(enhanced-position-service
+ main.cpp
+ enhanced-position.cpp
+ enhanced-position.h
+ enhanced-position-adaptor.h
+ position-feedback.cpp
+ position-feedback.h
+ position-feedback-adaptor.h
+ configuration.cpp
+ configuration.h
+ configuration-adaptor.h
+)
set(LIBRARIES
- ${Qt5Core_LIBRARIES}
- ${Qt5DBus_LIBRARIES}
+ ${DBUS_CPP_LIBRARIES}
${gnss-service_LIBRARIES}
${sensors-service_LIBRARIES}
)
@@ -65,26 +82,10 @@ if(WITH_DLT)
set(LIBRARIES ${LIBRARIES} ${DLT_LIBRARIES})
endif()
-# Specify the paths in which the linker should search for libraries.
-# The command will apply only to targets created after it is called.
-link_directories(
- ${gnss-service_LIBRARY_DIRS}
- ${sensors-service_LIBRARY_DIRS})
-
-# Tell CMake to create the position-daemon executable
-add_executable(position-daemon
- main.cpp
- demoifadaptor.cpp
- serverimpl.cpp
- PositionFilter.cpp
- confifadaptor.cpp
- ConfigurationImpl.cpp
- genivi-version.cpp
-)
-
-target_link_libraries(position-daemon
- ${LIBRARIES})
-
+target_link_libraries(enhanced-position-service ${LIBRARIES})
+message(STATUS "DBUS_CPP_LIBRARIES: " ${DBUS_CPP_LIBRARIES})
+message(STATUS "GNSS_SERVICE_LIBRARIES: " ${gnss-service_LIBRARIES})
+message(STATUS "SENSORS_SERVICE_LIBRARIES: " ${sensors-service_LIBRARIES})