forked from matth-x/MicroOcpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
205 lines (185 loc) · 6.71 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
# matth-x/MicroOcpp
# Copyright Matthias Akstaller 2019 - 2024
# MIT License
cmake_minimum_required(VERSION 3.15)
set(CMAKE_CXX_STANDARD 11)
set(MO_SRC
src/MicroOcpp/Core/Configuration_c.cpp
src/MicroOcpp/Core/Configuration.cpp
src/MicroOcpp/Core/ConfigurationContainer.cpp
src/MicroOcpp/Core/ConfigurationContainerFlash.cpp
src/MicroOcpp/Core/ConfigurationKeyValue.cpp
src/MicroOcpp/Core/FilesystemAdapter.cpp
src/MicroOcpp/Core/FilesystemUtils.cpp
src/MicroOcpp/Core/FtpMbedTLS.cpp
src/MicroOcpp/Core/RequestQueue.cpp
src/MicroOcpp/Core/Context.cpp
src/MicroOcpp/Core/Operation.cpp
src/MicroOcpp/Model/Model.cpp
src/MicroOcpp/Core/Request.cpp
src/MicroOcpp/Core/Connection.cpp
src/MicroOcpp/Core/Time.cpp
src/MicroOcpp/Core/RequestQueueStorageStrategy.cpp
src/MicroOcpp/Core/RequestStore.cpp
src/MicroOcpp/Operations/Authorize.cpp
src/MicroOcpp/Operations/BootNotification.cpp
src/MicroOcpp/Operations/CancelReservation.cpp
src/MicroOcpp/Operations/ChangeAvailability.cpp
src/MicroOcpp/Operations/ChangeConfiguration.cpp
src/MicroOcpp/Operations/ClearCache.cpp
src/MicroOcpp/Operations/ClearChargingProfile.cpp
src/MicroOcpp/Operations/CustomOperation.cpp
src/MicroOcpp/Operations/DataTransfer.cpp
src/MicroOcpp/Operations/DeleteCertificate.cpp
src/MicroOcpp/Operations/DiagnosticsStatusNotification.cpp
src/MicroOcpp/Operations/FirmwareStatusNotification.cpp
src/MicroOcpp/Operations/GetBaseReport.cpp
src/MicroOcpp/Operations/GetCompositeSchedule.cpp
src/MicroOcpp/Operations/GetConfiguration.cpp
src/MicroOcpp/Operations/GetDiagnostics.cpp
src/MicroOcpp/Operations/GetInstalledCertificateIds.cpp
src/MicroOcpp/Operations/GetLocalListVersion.cpp
src/MicroOcpp/Operations/GetVariables.cpp
src/MicroOcpp/Operations/Heartbeat.cpp
src/MicroOcpp/Operations/MeterValues.cpp
src/MicroOcpp/Operations/NotifyReport.cpp
src/MicroOcpp/Operations/RemoteStartTransaction.cpp
src/MicroOcpp/Operations/RemoteStopTransaction.cpp
src/MicroOcpp/Operations/RequestStartTransaction.cpp
src/MicroOcpp/Operations/RequestStopTransaction.cpp
src/MicroOcpp/Operations/ReserveNow.cpp
src/MicroOcpp/Operations/Reset.cpp
src/MicroOcpp/Operations/SendLocalList.cpp
src/MicroOcpp/Operations/SetChargingProfile.cpp
src/MicroOcpp/Operations/SetVariables.cpp
src/MicroOcpp/Operations/StartTransaction.cpp
src/MicroOcpp/Operations/StatusNotification.cpp
src/MicroOcpp/Operations/StopTransaction.cpp
src/MicroOcpp/Operations/TransactionEvent.cpp
src/MicroOcpp/Operations/TriggerMessage.cpp
src/MicroOcpp/Operations/InstallCertificate.cpp
src/MicroOcpp/Operations/UnlockConnector.cpp
src/MicroOcpp/Operations/UpdateFirmware.cpp
src/MicroOcpp/Debug.cpp
src/MicroOcpp/Platform.cpp
src/MicroOcpp/Core/SimpleRequestFactory.cpp
src/MicroOcpp/Core/OperationRegistry.cpp
src/MicroOcpp/Model/Authorization/AuthorizationData.cpp
src/MicroOcpp/Model/Authorization/AuthorizationList.cpp
src/MicroOcpp/Model/Authorization/AuthorizationService.cpp
src/MicroOcpp/Model/Authorization/IdToken.cpp
src/MicroOcpp/Model/Boot/BootService.cpp
src/MicroOcpp/Model/Certificates/Certificate.cpp
src/MicroOcpp/Model/Certificates/Certificate_c.cpp
src/MicroOcpp/Model/Certificates/CertificateMbedTLS.cpp
src/MicroOcpp/Model/Certificates/CertificateService.cpp
src/MicroOcpp/Model/ConnectorBase/ConnectorsCommon.cpp
src/MicroOcpp/Model/ConnectorBase/Connector.cpp
src/MicroOcpp/Model/ConnectorBase/Notification.cpp
src/MicroOcpp/Model/Diagnostics/DiagnosticsService.cpp
src/MicroOcpp/Model/FirmwareManagement/FirmwareService.cpp
src/MicroOcpp/Model/Heartbeat/HeartbeatService.cpp
src/MicroOcpp/Model/Metering/MeteringConnector.cpp
src/MicroOcpp/Model/Metering/MeteringService.cpp
src/MicroOcpp/Model/Metering/MeterStore.cpp
src/MicroOcpp/Model/Metering/MeterValue.cpp
src/MicroOcpp/Model/Metering/SampledValue.cpp
src/MicroOcpp/Model/Reservation/Reservation.cpp
src/MicroOcpp/Model/Reservation/ReservationService.cpp
src/MicroOcpp/Model/Reset/ResetService.cpp
src/MicroOcpp/Model/SmartCharging/SmartChargingModel.cpp
src/MicroOcpp/Model/SmartCharging/SmartChargingService.cpp
src/MicroOcpp/Model/Transactions/Transaction.cpp
src/MicroOcpp/Model/Transactions/TransactionDeserialize.cpp
src/MicroOcpp/Model/Transactions/TransactionService.cpp
src/MicroOcpp/Model/Transactions/TransactionStore.cpp
src/MicroOcpp/Model/Variables/Variable.cpp
src/MicroOcpp/Model/Variables/VariableContainer.cpp
src/MicroOcpp/Model/Variables/VariableService.cpp
src/MicroOcpp.cpp
src/MicroOcpp_c.cpp
)
if(ESP_PLATFORM)
idf_component_register(SRCS ${MO_SRC}
INCLUDE_DIRS "./src" "../ArduinoJson/src"
PRIV_REQUIRES spiffs
)
target_compile_options(${COMPONENT_TARGET} PUBLIC
-DMO_PLATFORM=MO_PLATFORM_ESPIDF
)
return()
endif()
project(MicroOcpp VERSION 1.2.0)
add_library(MicroOcpp ${MO_SRC})
target_include_directories(MicroOcpp PUBLIC
"./src"
"../ArduinoJson/src"
)
target_compile_definitions(MicroOcpp PUBLIC
MO_PLATFORM=MO_PLATFORM_UNIX
)
# Unit tests
set(MO_SRC_UNIT
tests/helpers/testHelper.cpp
tests/ocppEngineLifecycle.cpp
tests/TransactionSafety.cpp
tests/ChargingSessions.cpp
tests/ConfigurationBehavior.cpp
tests/SmartCharging.cpp
tests/Api.cpp
tests/Metering.cpp
tests/Configuration.cpp
tests/Reservation.cpp
tests/Reset.cpp
tests/LocalAuthList.cpp
tests/Variables.cpp
tests/Transactions.cpp
tests/Certificates.cpp
tests/FirmwareManagement.cpp
)
add_executable(mo_unit_tests
${MO_SRC}
${MO_SRC_UNIT}
./tests/catch2/catchMain.cpp
)
if (MO_BUILD_UNIT_MBEDTLS)
add_subdirectory(lib/mbedtls)
target_link_libraries(mo_unit_tests PUBLIC
mbedtls
mbedcrypto
mbedx509
)
target_compile_definitions(mo_unit_tests PUBLIC
MO_ENABLE_MBEDTLS=1
)
endif()
target_include_directories(mo_unit_tests PUBLIC
"./tests/catch2"
"./tests/helpers"
"./src"
)
target_compile_definitions(mo_unit_tests PUBLIC
MO_PLATFORM=MO_PLATFORM_UNIX
MO_NUMCONNECTORS=3
MO_CUSTOM_TIMER
MO_DBG_LEVEL=MO_DL_DEBUG
MO_TRAFFIC_OUT
MO_FILENAME_PREFIX="./mo_store/"
MO_LocalAuthListMaxLength=8
MO_SendLocalListMaxLength=4
MO_ENABLE_FILE_INDEX=1
MO_ChargeProfileMaxStackLevel=2
MO_ChargingScheduleMaxPeriods=4
MO_MaxChargingProfilesInstalled=3
MO_ENABLE_CERT_MGMT=1
MO_ENABLE_CONNECTOR_LOCK=1
)
target_compile_options(mo_unit_tests PUBLIC
-Wall
-O0
-g
--coverage
)
target_link_options(mo_unit_tests PUBLIC
--coverage
)