-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
209 lines (182 loc) · 5.89 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
cmake_minimum_required (VERSION 3.12)
project (firefighter_drone)
# Initialize CMake library for KasperskyOS SDK.
include (platform)
initialize_platform (FORCE_STATIC)
# Tools for using NK parser.
include (platform/nk)
# klog
find_package (klog REQUIRED)
include_directories (${klog_INCLUDE})
# klog_storage_entity
find_package (klog_storage REQUIRED)
include_directories (${klog_storage_INCLUDE})
find_package(kss REQUIRED)
find_package(vfs REQUIRED)
include_directories (${vfs_INCLUDE})
find_package (precompiled_vfs REQUIRED)
include_directories (${precompiled_vfs_INCLUDE})
# dhcp implementation
find_package (rump REQUIRED COMPONENTS DHCPCD_ENTITY)
include_directories (${rump_INCLUDE})
if ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm|aarch64")
# This command will find the BSP package components
# (BSP_HW_ENTITY, BSP_QEMU_ENTITY and BSP_CLIENT_LIB)
find_package (bsp REQUIRED)
include_directories (${bsp_INCLUDE})
endif ()
# Add a package with the GPIO client library.
find_package (gpio REQUIRED COMPONENTS CLIENT_LIB ENTITY)
include_directories (${gpio_INCLUDE})
option(ROOTFS_SDCARD "Use SD card to mount root filesystem" OFF)
message(STATUS "Use SD card to mount root filesystem - ${ROOTFS_SDCARD}")
# Include the directory with the generated config header files.
include_directories(${CMAKE_CURRENT_BINARY_DIR})
# Include the directory with header files.
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/resources/include)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Recommended compiler flags against vulnerabilities.
set(VULN_LDFLAGS "\
-Wl,-z,noexecstack \
-Wl,-z,separate-code \
-Wl,-z,now")
set(VULN_COMPILER_FLAGS "\
-Wall -Wextra -Wconversion \
-fPIE -pie -D_FORTIFY_SOURCE=2 -O2 \
-fstack-protector-strong -fstack-clash-protection \
-mbranch-protection=standard \
-Wsign-conversion -Wformat=2 -Wformat-security -Werror=format-security \
-fsanitize=undefined -fsanitize-undefined-trap-on-error")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${VULN_COMPILER_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${VULN_COMPILER_FLAGS}")
# Aggregation
nk_build_idl_files (aggregation_idl
NK_MODULE "ffd"
IDL "resources/idl/AggregationCoordinates.idl")
nk_build_cdl_files (aggregation_cdl
IDL_TARGET aggregation_idl
NK_MODULE "ffd"
CDL "resources/cdl/AggregationCoordinates.cdl")
nk_build_edl_files (aggregation_edl
CDL_TARGET aggregation_cdl
NK_MODULE "ffd"
EDL "resources/edl/Aggregation.edl")
# CCU
nk_build_idl_files (ccu_idl
NK_MODULE "ffd"
IDL "resources/idl/CCUActions.idl")
nk_build_cdl_files (ccu_cdl
IDL_TARGET ccu_idl
NK_MODULE "ffd"
CDL "resources/cdl/CCUActions.cdl")
nk_build_edl_files (ccu_edl
CDL_TARGET ccu_cdl
NK_MODULE "ffd"
EDL "resources/edl/CCU.edl")
# Communication
nk_build_idl_files (communication_idl
NK_MODULE "ffd"
IDL "resources/idl/CommunicationOutside.idl")
nk_build_cdl_files (communication_cdl
IDL_TARGET communication_idl
NK_MODULE "ffd"
CDL "resources/cdl/CommunicationOutside.cdl")
nk_build_edl_files (communication_edl
CDL_TARGET communication_cdl
NK_MODULE "ffd"
EDL "resources/edl/Communication.edl")
# Extinguishing
nk_build_idl_files (extinguishing_idl
NK_MODULE "ffd"
IDL "resources/idl/ExtinguishingActions.idl")
nk_build_cdl_files (extinguishing_cdl
IDL_TARGET extinguishing_idl
NK_MODULE "ffd"
CDL "resources/cdl/ExtinguishingActions.cdl")
nk_build_edl_files (extinguishing_edl
CDL_TARGET extinguishing_cdl
NK_MODULE "ffd"
EDL "resources/edl/Extinguishing.edl")
# EAIC
nk_build_idl_files (eaic_idl
NK_MODULE "ffd"
IDL "resources/idl/EAICActions.idl")
nk_build_cdl_files (eaic_cdl
IDL_TARGET eaic_idl
NK_MODULE "ffd"
CDL "resources/cdl/EAICActions.cdl")
nk_build_edl_files (eaic_edl
CDL_TARGET eaic_cdl
NK_MODULE "ffd"
EDL "resources/edl/EAIC.edl")
# FMAC
nk_build_idl_files (fmac_idl
NK_MODULE "ffd"
IDL "resources/idl/FMACActions.idl")
nk_build_cdl_files (fmac_cdl
IDL_TARGET fmac_idl
NK_MODULE "ffd"
CDL "resources/cdl/FMACActions.cdl")
nk_build_edl_files (fmac_edl
CDL_TARGET fmac_cdl
NK_MODULE "ffd"
EDL "resources/edl/FMAC.edl")
# Movement
nk_build_idl_files (movement_idl
NK_MODULE "ffd"
IDL "resources/idl/MovementActions.idl")
nk_build_cdl_files (movement_cdl
IDL_TARGET movement_idl
NK_MODULE "ffd"
CDL "resources/cdl/MovementActions.cdl")
nk_build_edl_files (movement_edl
CDL_TARGET movement_cdl
NK_MODULE "ffd"
EDL "resources/edl/Movement.edl")
# Navigation
nk_build_idl_files (navigation_idl
NK_MODULE "ffd"
IDL "resources/idl/NavigationCoordinates.idl")
nk_build_cdl_files (navigation_cdl
IDL_TARGET navigation_idl
NK_MODULE "ffd"
CDL "resources/cdl/NavigationCoordinates.cdl")
nk_build_edl_files (navigation_edl
CDL_TARGET navigation_cdl
NK_MODULE "ffd"
EDL "resources/edl/Navigation.edl")
# Situation
nk_build_idl_files (situation_idl
NK_MODULE "ffd"
IDL "resources/idl/SituationActions.idl")
nk_build_cdl_files (situation_cdl
IDL_TARGET situation_idl
NK_MODULE "ffd"
CDL "resources/cdl/SituationActions.cdl")
nk_build_edl_files (situation_edl
CDL_TARGET situation_cdl
NK_MODULE "ffd"
EDL "resources/edl/Situation.edl")
# KLog
nk_build_edl_files (klog_edl_files
NK_MODULE "ffd"
EDL "resources/edl/KlogEntity.edl")
# Klog storage
nk_build_edl_files (klog_storage_edl_files
NK_MODULE "ffd"
EDL "resources/edl/KlogStorageEntity.edl")
# fps is a web server which runs separate
add_custom_target(fps COMMAND make fps
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/fps
)
add_subdirectory (aggregation)
add_subdirectory (ccu)
add_subdirectory (communication)
add_subdirectory (extinguishing)
add_subdirectory (eaic)
add_subdirectory (fmac)
add_subdirectory (movement)
add_subdirectory (navigation)
add_subdirectory (situation)
add_subdirectory (klog_storage)
add_subdirectory (einit)