-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
33 lines (22 loc) · 945 Bytes
/
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
cmake_minimum_required(VERSION 3.13)
#set(PICO_BOARD pico)
#set(PICO_BOARD pico_w)
set(PICO_BOARD pico2)
# If pico2 is selected you have to select PICO_PLATFORM
# set(PICO_PLATFORM rp2350-arm-s)
set(PICO_PLATFORM rp2350-riscv)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_COLOR_DIAGNOSTICS ON)
include($ENV{PICO_SDK_PATH}/pico_sdk_init.cmake)
project(sample C CXX ASM)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
pico_sdk_init()
add_executable(${CMAKE_PROJECT_NAME} main.cpp)
pico_enable_stdio_usb(${CMAKE_PROJECT_NAME} 1)
pico_enable_stdio_uart(${CMAKE_PROJECT_NAME} 1)
pico_add_extra_outputs(${CMAKE_PROJECT_NAME})
target_link_libraries(${CMAKE_PROJECT_NAME} pico_stdlib)
# Export path to project executable to file. File is used in vscode tasks (task.json and launch.json)
set(ELF_PATH "${CMAKE_CURRENT_BINARY_DIR}/${TARGET_FILE}${CMAKE_PROJECT_NAME}.elf")
file(WRITE "${CMAKE_BINARY_DIR}/elf_path.txt" "${ELF_PATH}\n")