-
Notifications
You must be signed in to change notification settings - Fork 1k
/
Copy pathCMakeLists.txt
48 lines (38 loc) · 1.18 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
cmake_minimum_required(VERSION 3.12)
# Pull in SDK (must be before project)
include(../cmake/pico_sdk_import.cmake)
# generate a compilation database for static analysis by clang-tidy
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
project(pico_examples C CXX ASM)
# Initialize the Pico SDK
pico_sdk_init()
# In YOUR project, include RF24's CMakeLists.txt
# giving the path depending on where the library
# is cloned to in your project
include(../CMakeLists.txt)
# iterate over a list of examples by name
set(EXAMPLES_LIST
gettingStarted
acknowledgementPayloads
streamingData
manualAcknowledgements
multiceiverDemo
interruptConfigure
scanner
)
foreach(example ${EXAMPLES_LIST})
# make a target
add_executable(${example} ${example}.cpp defaultPins.h)
# link the necessary libs to the target
target_link_libraries(${example} PUBLIC
RF24
pico_stdlib
hardware_spi
hardware_gpio
)
# specify USB port as default serial communication's interface (not UART RX/TX pins)
pico_enable_stdio_usb(${example} 1)
pico_enable_stdio_uart(${example} 0)
# create map/bin/hex file etc.
pico_add_extra_outputs(${example})
endforeach()