-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
61 lines (48 loc) · 1.39 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
cmake_minimum_required(VERSION 3.12)
set(NAME tinyusb-i2s-audio)
set(FAMILY rp2040)
set(BOARD pico_sdk)
include(pico_sdk_import.cmake)
include(pico_extras_import.cmake)
include(pimoroni_pico_import.cmake)
# Gooey boilerplate
project(${NAME} C CXX ASM)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
# Initialize the SDK
pico_sdk_init()
# Include Pimoroni libraries
include(drivers/rgbled/rgbled)
# Add your source files
add_executable(${NAME})
target_sources(${NAME} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
${CMAKE_CURRENT_SOURCE_DIR}/src/i2s_audio.c
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
)
target_include_directories(${NAME} PUBLIC
${CMAKE_CURRENT_LIST_DIR}/src
)
add_compile_definitions(${NAME}
NDEBUG
PICO_AUDIO_I2S_DMA_IRQ=0
PICO_AUDIO_I2S_PIO=0
PICO_AUDIO_I2S_MONO_OUTPUT=0
PICO_AUDIO_I2S_MONO_INPUT=0
PICO_AUDIO_I2S_DATA_PIN=14
PICO_AUDIO_I2S_CLOCK_PIN_BASE=15
)
target_link_libraries(${NAME} PUBLIC
pico_stdlib pico_audio_i2s pico_unique_id pico_multicore rgbled tinyusb_device tinyusb_board
)
# create map/bin/hex file etc.
pico_add_extra_outputs(${NAME})
# Set up files for the release packages
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/${NAME}.uf2
${CMAKE_CURRENT_LIST_DIR}/README.md
DESTINATION .
)
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF)
set(CPACK_GENERATOR "ZIP" "TGZ")
include(CPack)