-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists!.txt
52 lines (30 loc) · 1.28 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
cmake_minimum_required(VERSION 3.13)
set(PICO_SDK_PATH /home/alayalava/git/pico/pico-sdk)
set(FAMILY rp2040)
set(BOARD pico_sdk)
include(${PICO_SDK_PATH}/external/pico_sdk_import.cmake)
include(${PICO_SDK_PATH}/lib/tinyusb/hw/bsp/${FAMILY}/family.cmake)
pico_sdk_init()
project(ymk C CXX ASM)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
add_executable(ymk)
target_sources(ymk PUBLIC
${CMAKE_CURRENT_LIST_DIR}/main.c
${CMAKE_CURRENT_LIST_DIR}/usb_descriptors.c
)
target_compile_options(ymk PRIVATE
-DFAMILY=rp2040
)
# Make sure TinyUSB can find tusb_config.h
target_include_directories(ymk PUBLIC
${CMAKE_CURRENT_LIST_DIR})
# In addition to pico_stdlib required for common PicoSDK functionality, add dependency on tinyusb_device
# for TinyUSB device support and tinyusb_board for the additional board support library used by the example
target_link_libraries(ymk PUBLIC pico_stdlib tinyusb_device tinyusb_board)
# Uncomment this line to enable fix for Errata RP2040-E5 (the fix requires use of GPIO 15)
#target_compile_definitions(dev_hid_composite PUBLIC PICO_RP2040_USB_DEVICE_ENUMERATION_FIX=1)
pico_add_extra_outputs(ymk)
# add url via pico_set_program_url
#example_auto_set_url(dev_hid_composite)
family_configure_device_example(ymk)