-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
75 lines (59 loc) · 1.41 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
cmake_minimum_required(VERSION 3.13)
# note: this must happen before project()
include($ENV{PICO_SDK_PATH}/external/pico_sdk_import.cmake)
project(rpico-lab)
pico_sdk_init()
#
# blink example
#
add_executable(blink
${CMAKE_CURRENT_SOURCE_DIR}/src/main_blink.c
)
target_link_libraries(blink
pico_stdlib
)
# On the Pico W, the led is connected to the Wifi chip.
# We need to link pico_cyw43_arch_none to access the led.
# PICO_CYW43_SUPPORTED is set if PICO_BOARD==pico_w.
if (PICO_CYW43_SUPPORTED)
target_link_libraries(blink
pico_cyw43_arch_none
)
endif()
pico_add_extra_outputs(blink)
#
# debounce example
#
add_executable(debounce
${CMAKE_CURRENT_SOURCE_DIR}/src/debounce.c
${CMAKE_CURRENT_SOURCE_DIR}/src/main_debounce.c
)
target_include_directories(debounce
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
)
target_link_libraries(debounce
pico_stdlib
)
# On the Pico W, the led is connected to the Wifi chip.
# We need to link pico_cyw43_arch_none to access the led.
# PICO_CYW43_SUPPORTED is set if PICO_BOARD==pico_w.
if (PICO_CYW43_SUPPORTED)
target_link_libraries(debounce
pico_cyw43_arch_none
)
endif()
pico_add_extra_outputs(debounce)
#
# ws2812 example
#
add_executable(ws2812
${CMAKE_CURRENT_SOURCE_DIR}/src/main_ws2812.c
)
pico_generate_pio_header(ws2812
${CMAKE_CURRENT_SOURCE_DIR}/src/ws2812.pio
)
target_link_libraries(ws2812
pico_stdlib
hardware_pio
)
pico_add_extra_outputs(ws2812)