forked from nRF24/RF24
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
55 lines (44 loc) · 1.2 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
cmake_minimum_required(VERSION 3.12)
# Pull in SDK (must be before project)
include(pico_sdk_import.cmake)
project(gettingStarted)
# 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)
#[[ for each example, we have to perform the following
#make a target
add_executable(gettingStarted gettingStarted.cpp)
# link the necessary libs to the target
target_link_libraries(gettingStarted PUBLIC
RF24
pico_stdlib
hardware_spi
hardware_gpio
)
# create map/bin/hex file etc.
pico_add_extra_outputs(gettingStarted)
]]
# iterate over a list of examples by name
set(EXAMPLES_LIST
gettingStarted
acknowledgementPayloads
streamingData
manualAcknowledgements
multiceiverDemo
interruptConfigure
)
foreach(example ${EXAMPLES_LIST})
add_executable(${example} ${example}.cpp)
target_link_libraries(${example} PUBLIC
RF24
pico_stdlib
hardware_spi
hardware_gpio
)
pico_enable_stdio_usb(${example} 1)
pico_enable_stdio_uart(${example} 0)
pico_add_extra_outputs(${example})
endforeach()