-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
74 lines (58 loc) · 1.63 KB
/
CMakeLists.txt
File metadata and controls
74 lines (58 loc) · 1.63 KB
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
cmake_minimum_required(VERSION 3.17)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
set(TARGET nethid)
# Version string from build.sh (git describe)
if(NOT DEFINED VERSION_STRING)
set(VERSION_STRING "unknown")
endif()
# WiFi credentials are now stored in flash and configured via web interface.
# The device will start in AP mode if no credentials are configured.
set(PICO_BOARD pico_w CACHE STRING "Board type")
# Pull in the Pico SDK. This correctly pulls in TinyUSB for us.
include($ENV{PICO_SDK_PATH}/external/pico_sdk_import.cmake)
if (PICO_SDK_VERSION_STRING VERSION_LESS "1.4.0")
message(FATAL_ERROR "Raspberry Pi Pico SDK version 1.4.0 (or later) required. Your version is ${PICO_SDK_VERSION_STRING}")
endif()
project(${TARGET})
pico_sdk_init()
add_executable(${TARGET}
src/main.c
src/board.c
src/usb.c
src/usb_descriptors.c
src/hid_keys.c
src/httpd/httpd_server.c
src/httpd/httpd_handlers.c
src/httpd/httpd_websocket.c
src/mqtt/mqtt.c
src/settings.c
src/auth.c
src/syslog.c
src/ap_mode.c
src/dhcpserver.c
src/wifi_scan.c
src/cjson/cJSON.c
)
target_link_libraries(${TARGET}
pico_cyw43_arch_lwip_poll
pico_lwip_mqtt
pico_rand
pico_stdlib
pico_multicore
hardware_flash
hardware_sync
tinyusb_board
tinyusb_device
)
pico_add_extra_outputs(${TARGET})
add_compile_options(-Wall
-Wno-unused-function
)
target_include_directories(${TARGET} PRIVATE
$ENV{PICO_SDK_PATH}/lib/mbedtls/include
${CMAKE_CURRENT_SOURCE_DIR}/src
)
target_compile_definitions(${TARGET} PRIVATE
NETHID_VERSION="${VERSION_STRING}"
)