summaryrefslogtreecommitdiff
path: root/enhanced-position-service/franca/src/CMakeLists.txt
blob: e9b17f6c6d3396855d78b0c2e47fdc1b0030d446 (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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# Copyright (C) 2014 BMW Group
# Author: Marco Residori (marco_residori@mentor.com)
# 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/.

cmake_minimum_required(VERSION 2.8)
find_package(PkgConfig REQUIRED)

# Project settings
set(PROJECT_NAME EnhancedPosition)

project(${PROJECT_NAME})
set(CMAKE_VERBOSE_MAKEFILE on)
set(CMAKE_CXX_FLAGS "-Wall -std=c++0x")
set(CMAKE_BUILD_TYPE Debug)

message(STATUS "ENHANCED-POSITION-SERVICE-FRANCA")
message(STATUS "WITH_DLT = ${WITH_DLT}")
message(STATUS "WITH_GPSD = ${WITH_GPSD}")
message(STATUS "WITH_REPLAYER = ${WITH_REPLAYER}")
message(STATUS "WITH_TESTS = ${WITH_TESTS}")
message(STATUS "WITH_DEBUG = ${WITH_DEBUG}")

find_package(PkgConfig REQUIRED)
find_package(CommonAPI 3.1.3 REQUIRED)
find_package(CommonAPI-DBus 3.1.3 REQUIRED)

# CommonAPI
include(FindPkgConfig)
pkg_check_modules (DBUS "dbus-1 >= 1.4")
pkg_check_modules(COMMONAPI "CommonAPI >= 3.1")
pkg_check_modules (COMMONAPI_DBUS "CommonAPI-DBus >= 3.1")

# Source Files
set(PRJ_SRC_PATH ${CMAKE_CURRENT_SOURCE_DIR})
set(PRJ_SRC_GEN_ROOT ${CMAKE_BINARY_DIR}/enhanced-position-service/franca/api)
set(PRJ_SRC_GEN_PATH ${PRJ_SRC_GEN_ROOT}/org/genivi/EnhancedPositionService)

set(PRJ_NAME_CLIENT ${PROJECT_NAME}Client)
set(PRJ_NAME_SERVICE ${PROJECT_NAME}Service)

FILE(GLOB PRJ_PROXY_GEN_SRCS ${PRJ_SRC_GEN_PATH}/*Proxy.cpp ${PRJ_SRC_GEN_PATH}/*Types.cpp)
FILE(GLOB PRJ_STUB_GEN_SRCS ${PRJ_SRC_GEN_PATH}/*Stub*.cpp ${PRJ_SRC_GEN_PATH}/*Types.cpp)
FILE(GLOB PRJ_STUB_IMPL_SRCS ${PRJ_SRC_PATH}/*Stub*.cpp)

set(PRJ_CLIENT_SRCS ${PRJ_SRC_PATH}/${PRJ_NAME_CLIENT}.cpp ${PRJ_PROXY_GEN_SRCS})
set(PRJ_SERVICE_SRCS ${PRJ_SRC_PATH}/${PRJ_NAME_SERVICE}.cpp ${PRJ_STUB_GEN_SRCS} ${PRJ_STUB_IMPL_SRCS})

message(STATUS "PRJ_SRC_GEN_ROOT = " ${PRJ_SRC_GEN_ROOT})
message(STATUS "PRJ_SRC_PATH = " ${PRJ_SRC_PATH})
message(STATUS "PRJ_SRC_GEN_PATH = " ${PRJ_SRC_GEN_PATH})
message(STATUS "COMMONAPI_INCLUDE_DIRS = " ${COMMONAPI_INCLUDE_DIRS})
message(STATUS "COMMONAPI_DBUS_INCLUDE_DIRS = " ${COMMONAPI_DBUS_INCLUDE_DIRS})
message(STATUS "PRJ_CLIENT_SRCS = " ${PRJ_CLIENT_SRCS})
message(STATUS "PRJ_SERVICE_SRCS = " ${PRJ_SERVICE_SRCS})

include_directories(
    ${PRJ_SRC_GEN_ROOT}
    ${DBUS_INCLUDE_DIRS}
    ${COMMONAPI_INCLUDE_DIRS}
    ${COMMONAPI_DBUS_INCLUDE_DIRS}
    ${CMAKE_CURRENT_BINARY_DIR}
    ${gnss-service_INCLUDE_DIRS}
    ${sensors-service_INCLUDE_DIRS}
)

link_directories(
    ${DBUS_LIBDIR}
    ${gnss-service_LIBRARY_DIRS}
    ${sensors-service_LIBRARY_DIRS}
    ${COMMONAPI_LIBDIR}
    ${COMMONAPI_DBUS_LIBDIR}
)

set(LIBRARIES 
    ${DBUS_LIBRARIES}
    ${gnss-service_LIBRARIES}
    ${sensors-service_LIBRARIES}
    CommonAPI
    CommonAPI-DBus
)

if(WITH_DLT)
    add_definitions("-DDLT_ENABLED=1")
    set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/..")
    find_package(DLT REQUIRED)
    include_directories( ${DLT_INCLUDE_DIRS} )
    set(LIBRARIES ${LIBRARIES} ${DLT_LIBRARIES})
endif()

if(WITH_DEBUG)
    add_definitions("-DDEBUG_ENABLED=1")
endif()

# Build Client
add_executable(${PRJ_NAME_CLIENT} ${PRJ_CLIENT_SRCS})
target_link_libraries(${PRJ_NAME_CLIENT} ${LIBRARIES})

# Build service
add_executable(${PRJ_NAME_SERVICE} ${PRJ_SERVICE_SRCS})
target_link_libraries(${PRJ_NAME_SERVICE} ${LIBRARIES})