-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
94 lines (77 loc) · 2.1 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.7)
set(RI_COMM_BLE_PAYLOAD_MAX_LENGTH 48)
if(${ESP_PLATFORM})
string(APPEND CMAKE_C_FLAGS " -DRUUVI_ESP")
idf_component_register(
SRCS
src/drv/terminal.c
src/lib/api.c
src/lib/parser.c
src/lib/dbuscontroller.c
src/lib/formated_output.c
INCLUDE_DIRS
src
src/drv
src/lib
INCLUDE_DIRS
../../components/ruuvi.boards.c
components/ruuvi.endpoints.c/src
REQUIRES
ruuvi.endpoints.c
)
target_compile_definitions(${COMPONENT_LIB} PRIVATE RI_ADV_EXTENDED_ENABLED=1 RI_COMM_BLE_PAYLOAD_MAX_LENGTH=${RI_COMM_BLE_PAYLOAD_MAX_LENGTH})
target_compile_definitions(__idf_ruuvi.endpoints.c PRIVATE RI_ADV_EXTENDED_ENABLED=1 RI_COMM_BLE_PAYLOAD_MAX_LENGTH=${RI_COMM_BLE_PAYLOAD_MAX_LENGTH})
else()
project(ruuvi_comm_tester)
set(ProjectId ruuvi_comm_tester)
set(RUUVI_APP_SOURCES
src/app/comm_tester.c
)
set(RUUVI_DRV_SOURCES
src/drv/terminal.c
)
set(COMPONENTS components)
set(RUUVI_LIB_SOURCES
src/lib/api.c
src/lib/parser.c
src/lib/dbuscontroller.c
src/lib/formated_output.c
${COMPONENTS}/ruuvi.endpoints.c/src/ruuvi_endpoint_ca_uart.c
)
include_directories(
/usr/include
/usr/include/dbus-1.0
/usr/lib/x86_64-linux-gnu/dbus-1.0/include
src
src/app
src/lib
src/drv
${COMPONENTS}/ruuvi.endpoints.c/src
)
add_executable(${ProjectId}
${RUUVI_APP_SOURCES}
${RUUVI_DRV_SOURCES}
${RUUVI_LIB_SOURCES}
)
set_target_properties(${ProjectId} PROPERTIES
C_STANDARD 11
CXX_STANDARD 14
)
target_compile_definitions(${ProjectId} PUBLIC
_DEFAULT_SOURCE
RI_ADV_EXTENDED_ENABLED=1
RI_COMM_BLE_PAYLOAD_MAX_LENGTH=${RI_COMM_BLE_PAYLOAD_MAX_LENGTH}
)
target_compile_options(${ProjectId} PUBLIC
-c
-Wall
-pedantic
-Wno-variadic-macros
-Wno-long-long
-Wno-shadow
)
target_link_libraries(${ProjectId}
pthread
dbus-1
)
endif()