-
Notifications
You must be signed in to change notification settings - Fork 13
/
CMakeLists.txt
50 lines (44 loc) · 1.66 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
cmake_minimum_required(VERSION 3.12)
if (NOT TARGET pico_spdif_rx)
add_library(pico_spdif_rx INTERFACE)
pico_generate_pio_header(pico_spdif_rx ${CMAKE_CURRENT_BINARY_DIR}/spdif_rx_48000.pio)
pico_generate_pio_header(pico_spdif_rx ${CMAKE_CURRENT_BINARY_DIR}/spdif_rx_96000.pio)
pico_generate_pio_header(pico_spdif_rx ${CMAKE_CURRENT_BINARY_DIR}/spdif_rx_192000.pio)
pico_generate_pio_header(pico_spdif_rx ${CMAKE_CURRENT_LIST_DIR}/spdif_rx_capture.pio)
find_package (Python3 COMPONENTS Interpreter)
message(STATUS "Python: version=${Python3_VERSION} interpreter=${Python3_EXECUTABLE}")
if(NOT Python3_FOUND)
string(JOIN "\n" errmsg
" Python3 not found."
" - Python3_FOUND=${Python3_FOUND}"
)
message(FATAL_ERROR ${errmsg})
endif()
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 ${Python3_EXECUTABLE}
${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(pico_spdif_rx INTERFACE
${CMAKE_CURRENT_LIST_DIR}/spdif_rx.c
)
target_include_directories(pico_spdif_rx INTERFACE
${CMAKE_CURRENT_LIST_DIR}
)
target_link_libraries(pico_spdif_rx INTERFACE
pico_stdlib
hardware_dma
hardware_pio
hardware_irq
pico_audio_32b
)
endif()