-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
47 lines (32 loc) · 1.38 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
cmake_minimum_required(VERSION 3.12)
# initialize pico_sdk from GIT
# (note this can come from environment, CMake cache etc)
# set(PICO_SDK_FETCH_FROM_GIT on)
# pico_sdk_import.cmake is a single file copied from this SDK
# note: this must happen before project()
include(pico_sdk_import.cmake)
project(pico_microphone)
# initialize the Pico SDK
pico_sdk_init()
add_library(pico_pdm_microphone INTERFACE)
target_sources(pico_pdm_microphone INTERFACE
${CMAKE_CURRENT_LIST_DIR}/src/pdm_microphone.c
${CMAKE_CURRENT_LIST_DIR}/src/OpenPDM2PCM/OpenPDMFilter.c
)
target_include_directories(pico_pdm_microphone INTERFACE
${CMAKE_CURRENT_LIST_DIR}/src/include
)
pico_generate_pio_header(pico_pdm_microphone ${CMAKE_CURRENT_LIST_DIR}/src/pdm_microphone.pio)
target_link_libraries(pico_pdm_microphone INTERFACE pico_stdlib hardware_dma hardware_pio)
add_library(pico_analog_microphone INTERFACE)
target_sources(pico_analog_microphone INTERFACE
${CMAKE_CURRENT_LIST_DIR}/src/analog_microphone.c
)
target_include_directories(pico_analog_microphone INTERFACE
${CMAKE_CURRENT_LIST_DIR}/src/include
)
target_link_libraries(pico_analog_microphone INTERFACE pico_stdlib hardware_adc hardware_dma)
add_subdirectory("examples/hello_analog_microphone")
add_subdirectory("examples/hello_pdm_microphone")
add_subdirectory("examples/usb_microphone")
add_subdirectory("examples/usb_analog_microphone")