forked from elehobica/pico_spdif_rx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
37 lines (33 loc) · 1.19 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
if (NOT TARGET spdif_rx)
add_library(spdif_rx INTERFACE)
pico_generate_pio_header(spdif_rx ${CMAKE_CURRENT_BINARY_DIR}/spdif_rx_48000.pio)
pico_generate_pio_header(spdif_rx ${CMAKE_CURRENT_BINARY_DIR}/spdif_rx_96000.pio)
pico_generate_pio_header(spdif_rx ${CMAKE_CURRENT_BINARY_DIR}/spdif_rx_192000.pio)
add_custom_command(
OUTPUT
${CMAKE_CURRENT_BINARY_DIR}/spdif_rx_48000.pio
${CMAKE_CURRENT_BINARY_DIR}/spdif_rx_96000.pio
${CMAKE_CURRENT_BINARY_DIR}/spdif_rx_192000.pio
DEPENDS ${CMAKE_CURRENT_LIST_DIR}/spdif_rx.pio
COMMAND "python"
${CMAKE_CURRENT_LIST_DIR}/scripts/gen_pio_by_freq.py
${CMAKE_CURRENT_LIST_DIR}/spdif_rx.pio
${CMAKE_CURRENT_BINARY_DIR}
48000
96000
192000
)
target_sources(spdif_rx INTERFACE
${CMAKE_CURRENT_LIST_DIR}/spdif_rx.c
)
target_include_directories(spdif_rx INTERFACE ${CMAKE_CURRENT_LIST_DIR}/..)
target_link_libraries(spdif_rx INTERFACE
pico_stdlib
pico_multicore
hardware_dma
hardware_pio
hardware_irq
my_pico_audio
spdif_rx
)
endif()