-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathCMakeLists.txt
137 lines (122 loc) · 3.84 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
cmake_minimum_required(VERSION 3.0.0)
set(ARDUINO_BOARD "ESP32 Dev Module [esp32.esp32]")
project(nuki_hub CXX)
# ARDUHAL_LOG_LEVEL_NONE, define ARDUHAL_LOG_LEVEL_ERROR, define ARDUHAL_LOG_LEVEL_WARN, define ARDUHAL_LOG_LEVEL_INFO,
# define ARDUHAL_LOG_LEVEL_DEBUG, define ARDUHAL_LOG_LEVEL_VERBOSE
set(LOG_LEVEL ARDUHAL_LOG_LEVEL_NONE)
#add_compile_definitions(DEBUG_SENSE_NUKI)
#add_compile_definitions(DEBUG_NUKI_COMMAND)
#add_compile_definitions(DEBUG_NUKI_CONNECT)
#add_compile_definitions(DEBUG_NUKI_COMMUNICATION)
#add_compile_definitions(DEBUG_NUKI_HEX_DATA)
#add_compile_definitions(DEBUG_NUKI_READABLE_DATA)
# Length of char arrays to store certificates for MQTTS
add_compile_definitions(TLS_CA_MAX_SIZE=2200)
add_compile_definitions(TLS_CERT_MAX_SIZE=1500)
add_compile_definitions(TLS_KEY_MAX_SIZE=1800)
add_compile_definitions(TX_PAYLOAD_BUFFER_SIZE=6144)
add_compile_definitions(ESP_PLATFORM)
add_compile_definitions(ESP32)
add_compile_definitions(ARDUINO_ARCH_ESP32)
include_directories(${PROJECT_NAME}
PRIVATE
lib/Crc16
lib/NimBLE-Arduino/src
lib/BleScanner/src
lib/nuki_ble/src
lib/WiFiManager
lib/WebServer/src
lib/Ethernet/src
lib/MqttLogger/src
lib/espMqttClient/src
lib/AsyncTCP/src
)
file(GLOB SRCFILES
Pins.h
Config.h
Network.cpp
MqttReceiver.h
NetworkLock.cpp
NetworkOpener.cpp
networkDevices/NetworkDevice.h
networkDevices/WifiDevice.cpp
networkDevices/W5500Device.cpp
networkDevices/ClientSyncEthernet.cpp
networkDevices/espMqttClientEthernet.cpp
NukiWrapper.cpp
NukiOpenerWrapper.cpp
MqttTopics.h
Ota.cpp
WebCfgServerConstants.h
WebCfgServer.cpp
PresenceDetection.cpp
PreferencesKeys.h
Gpio.cpp
Logger.cpp
# include/RTOS.h
lib/WiFiManager/WiFiManager.cpp
lib/WiFiManager/wm_consts_en.h
lib/WiFiManager/wm_strings_en.h
lib/Crc16/Crc16.h
lib/nuki_ble/src/NukiBle.cpp
lib/nuki_ble/src/NukiBle.hpp
lib/nuki_ble/src/NukiLock.cpp
lib/nuki_ble/src/NukiOpener.cpp
lib/nuki_ble/src/NukiConstants.h
lib/nuki_ble/src/NukiOpenerConstants.h
lib/nuki_ble/src/NukiLockConstants.h
lib/nuki_ble/src/NukiDataTypes.h
lib/nuki_ble/src/NukiUtils.cpp
lib/nuki_ble/src/NukiLockUtils.cpp
lib/nuki_ble/src/NukiOpenerUtils.cpp
lib/BleScanner/src/BleInterfaces.h
lib/BleScanner/src/BleScanner.cpp
lib/MqttLogger/src/MqttLogger.cpp
lib/AsyncTCP/src/AsyncTCP.cpp
)
file(GLOB_RECURSE SRCFILESREC
lib/NimBLE-Arduino/src/*.c
lib/NimBLE-Arduino/src/*.cpp
lib/NimBLE-Arduino/src/*.h
lib/WebServer/src/*.cpp
lib/WebServer/src/*.h
lib/Ethernet/src/*.cpp
lib/Ethernet/src/*.h
lib/espMqttClient/src/*.cpp
lib/espMqttClient/src/*.h
lib/espMqttClient/src/Packets/*.cpp
lib/espMqttClient/src/Packets/*.h
lib/espMqttClient/src/Transport/*.cpp
lib/espMqttClient/src/Transport/*.h
)
add_executable(${PROJECT_NAME}
main.cpp
${SRCFILES}
${SRCFILESREC}
)
target_compile_definitions(${PROJECT_NAME}
PRIVATE
ARDUHAL_LOG_LEVEL=${LOG_LEVEL}
CORE_DEBUG_LEVEL=${LOG_LEVEL}
CONFIG_NIMBLE_CPP_LOG_LEVEL=0
)
target_link_arduino_libraries(${PROJECT_NAME}
PRIVATE
core
BLE
WiFi
WiFiClientSecure
Update
# WebServer
DNSServer
Preferences
SPIFFS
SPI
# Ethernet
# esp32
# Wire
# FS
)
target_link_arduino_libraries(DNSServer PUBLIC WiFi)
# This is needed for the generation of HEX binary and uploading it
target_enable_arduino_upload(${PROJECT_NAME})