CMakeLists.txt (1981B)
1cmake_minimum_required(VERSION 3.5) 2 3include(${CMAKE_CURRENT_SOURCE_DIR}/lib/tinyusb/hw/bsp/family_support.cmake) 4 5family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR}) 6 7project(${PROJECT}) 8 9family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR}) 10 11add_executable(${PROJECT}) 12 13pico_generate_pio_header(${PROJECT} ${CMAKE_CURRENT_SOURCE_DIR}/src/ws2812.pio) 14pico_generate_pio_header(${PROJECT} ${CMAKE_CURRENT_SOURCE_DIR}/src/uart_tx.pio) 15pico_generate_pio_header(${PROJECT} ${CMAKE_CURRENT_SOURCE_DIR}/src/uart_rx.pio) 16 17target_sources(${PROJECT} PUBLIC 18 ${CMAKE_CURRENT_SOURCE_DIR}/src/main.c 19 ${CMAKE_CURRENT_SOURCE_DIR}/src/util.c 20 ${CMAKE_CURRENT_SOURCE_DIR}/src/hid.c 21 ${CMAKE_CURRENT_SOURCE_DIR}/src/keysym/consumer.c 22 ${CMAKE_CURRENT_SOURCE_DIR}/src/keysym/system.c 23 ${CMAKE_CURRENT_SOURCE_DIR}/src/split.c 24 ${CMAKE_CURRENT_SOURCE_DIR}/src/ws2812.c 25 ${CMAKE_CURRENT_SOURCE_DIR}/src/led.c 26 ${CMAKE_CURRENT_SOURCE_DIR}/src/keymat.c 27 ${CMAKE_CURRENT_SOURCE_DIR}/src/keymap.c 28 ${CMAKE_CURRENT_SOURCE_DIR}/src/usb_stdio.c 29 ${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c 30) 31 32target_include_directories(${PROJECT} PUBLIC 33 ${CMAKE_CURRENT_SOURCE_DIR}/src 34 ${PICO_SDK_PATH}/src/rp2_common/hardware_gpio/include 35 ${PICO_SDK_PATH}/src/rp2_common/hardware_pio/include 36 ${PICO_SDK_PATH}/src/rp2_common/hardware_timer/include 37 ${PICO_SDK_PATH}/src/rp2_common/hardware_uart/include 38 ${PICO_SDK_PATH}/src/rp2_common/hardware_clocks/include 39) 40 41target_link_libraries(${PROJECT} PRIVATE 42 pico_stdlib 43 pico_stdio 44 pico_bootsel_via_double_reset 45 hardware_pio 46 hardware_gpio 47 tinyusb_device 48) 49 50target_compile_options(pico_stdio INTERFACE 51 -Wno-shadow # issue in picosdk/src/rp2_common/hardware_flash/flash.c 52 -Wno-unused-parameter 53) 54 55set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_EXTRA_FLAGS}") 56 57family_configure_target(${PROJECT}) 58family_add_default_example_warnings(${PROJECT}) 59suppress_tinyusb_warnings() 60 61#pico_enable_stdio_usb(${PROJECT} 1) 62pico_enable_stdio_uart(${PROJECT} 0)