2021-01-16 14:43:21 +00:00
|
|
|
cmake_minimum_required(VERSION 3.12)
|
|
|
|
|
|
|
|
# Pull in PICO SDK (must be before project)
|
|
|
|
include(pico_sdk_import.cmake)
|
|
|
|
|
|
|
|
project(pico_examples C CXX ASM)
|
|
|
|
set(CMAKE_C_STANDARD 11)
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
|
|
|
|
# Initialize the SDK
|
|
|
|
pico_sdk_init()
|
|
|
|
|
2021-01-17 16:59:58 +00:00
|
|
|
function(add_resource target file)
|
|
|
|
get_filename_component(NAME ${ARGV1} NAME_WE)
|
|
|
|
set(FILENAME ${ARGV1})
|
|
|
|
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${NAME}.o
|
|
|
|
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/${FILENAME}
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
|
|
|
|
COMMAND arm-none-eabi-ld -r -b binary -o ${NAME}.o ${FILENAME}
|
|
|
|
DEPENDS ${FILENAME}
|
|
|
|
)
|
|
|
|
|
|
|
|
target_sources(${ARGV0} PRIVATE ${NAME}.o)
|
|
|
|
endfunction(add_resource)
|
|
|
|
|
2021-05-13 12:06:01 +01:00
|
|
|
include_directories(
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}
|
|
|
|
)
|
|
|
|
|
2021-05-17 16:20:42 +01:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror")
|
|
|
|
|
2021-05-14 18:12:37 +01:00
|
|
|
add_subdirectory(common)
|
2021-01-16 15:02:18 +00:00
|
|
|
add_subdirectory(drivers)
|
|
|
|
add_subdirectory(libraries)
|
|
|
|
|
|
|
|
# Example Pico Pack projects
|
2021-01-16 16:00:15 +00:00
|
|
|
add_subdirectory(examples)
|