summaryrefslogtreecommitdiff
path: root/src/vehicle-gateway/CMakeLists.txt
blob: 4157899533fae2225641bd0be0c280224aaa8aa6 (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
###########################################################################
# @licence app begin@
# SPDX-License-Identifier: MPL-2.0
#
# Component Name: Vehicle gateway
#
# Author: Philippe Colliot
#
# Copyright (C) 2017, PSA GROUP
#
# Former code made by Marco Residori
#
# Copyright (C) 2013, 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/.
#
# @licence end@
###########################################################################
project(vehicle-gateway)
cmake_minimum_required(VERSION 2.8)

message(STATUS ${PROJECT_NAME})

add_definitions("-std=gnu++11")

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

find_package(PkgConfig REQUIRED)

set(PRJ_SRCS
    ${CMAKE_CURRENT_SOURCE_DIR}/veh-gateway.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/obd2.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/hnmea.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/gnss.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/common.cpp
)

include_directories(
    ${CMAKE_CURRENT_SOURCE_DIR}
)

set(LIBRARIES pthread)

if(WITH_DLT)
    pkg_check_modules(DLT REQUIRED automotive-dlt)
    add_definitions("-DDLT_ENABLED=1")
    include_directories( ${DLT_INCLUDE_DIRS} )
    set(LIBRARIES ${LIBRARIES} ${DLT_LIBRARIES})
endif()

add_executable(${PROJECT_NAME} ${PRJ_SRCS})

target_link_libraries(${PROJECT_NAME} ${LIBRARIES})

install(TARGETS ${PROJECT_NAME} DESTINATION bin)