-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
90 lines (76 loc) · 2.26 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
# == DO NEVER EDIT THE NEXT LINES for Raspberry Pi Pico VS Code Extension to work ==
if(WIN32)
set(USERHOME $ENV{USERPROFILE})
else()
set(USERHOME $ENV{HOME})
endif()
set(sdkVersion 2.0.0)
set(toolchainVersion 13_2_Rel1)
set(picotoolVersion 2.0.0)
set(picoVscode ${USERHOME}/.pico-sdk/cmake/pico-vscode.cmake)
if (EXISTS ${picoVscode})
include(${picoVscode})
endif()
# ====================================================================================
cmake_minimum_required(VERSION 3.13)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Set up the Pico SDK path
if(DEFINED ENV{PICO_SDK_PATH})
set(PICO_SDK_PATH $ENV{PICO_SDK_PATH})
else()
set(PICO_SDK_PATH ${CMAKE_CURRENT_SOURCE_DIR}/pico-sdk)
endif()
set(PICO_BOARD pico_w CACHE STRING "Board type")
# Include the Pico SDK
include(${PICO_SDK_PATH}/external/pico_sdk_import.cmake)
# Link to the correct TF Lite library
link_directories(${CMAKE_CURRENT_SOURCE_DIR}/pico-tflmicro/build)
project(7cpp C CXX ASM)
# Initialize the Pico SDK
pico_sdk_init()
add_executable(7cpp
7cpp.cpp
bme68x.c
mqtt.cpp
uart_dma.cpp
cloud_predictor.cpp
model.cpp
)
pico_set_program_name(7cpp "7cpp")
pico_set_program_version(7cpp "0.1")
pico_enable_stdio_uart(7cpp 1)
pico_enable_stdio_usb(7cpp 0)
target_link_libraries(7cpp
pico_stdlib
hardware_i2c
hardware_adc
pico_cyw43_arch_lwip_threadsafe_background
pico_lwip
pico_malloc
pico_runtime
hardware_rtc
hardware_gpio
pico_lwip_mqtt
pico_util
hardware_dma
pico_multicore
${CMAKE_CURRENT_SOURCE_DIR}/pico-tflmicro/build/libpico-tflmicro.a
)
target_include_directories(7cpp PRIVATE
${CMAKE_CURRENT_LIST_DIR}
${CMAKE_CURRENT_LIST_DIR}/..
${PICO_SDK_PATH}/src/rp2_common/hardware_adc/include
${PICO_SDK_PATH}/src/rp2_common/hardware_rtc/include
${PICO_SDK_PATH}/src/rp2_common/hardware_gpio/include
${PICO_SDK_PATH}/src/rp2_common/hardware_dma/include
${PICO_SDK_PATH}/src/common/pico_stdlib/include
${PICO_SDK_PATH}/src/rp2_common/hardware_sync/include
${PICO_SDK_PATH}/src/common/pico_sync/include
${CMAKE_CURRENT_SOURCE_DIR}/pico-tflmicro/src
)
target_compile_definitions(7cpp PRIVATE
PICO_I2C_DEBUG=1
)
pico_add_extra_outputs(7cpp)