raspikeyer/CMakeLists.txt

70 lines
1.7 KiB
Text
Raw Normal View History

2024-02-06 15:50:50 +01:00
# Generated Cmake Pico project file
2024-02-13 12:56:39 +01:00
cmake_minimum_required(VERSION 3.26)
2024-02-06 15:50:50 +01:00
set(CMAKE_C_STANDARD 11)
2024-02-13 12:53:25 +01:00
set(CMAKE_CXX_STANDARD 20)
2024-02-06 15:50:50 +01:00
# Initialise pico_sdk from installed location
# (note this can come from environment, CMake cache etc)
2024-02-13 09:11:28 +01:00
#set(PICO_SDK_PATH "/home/myuser/pico/pico-sdk")
2024-02-06 15:50:50 +01:00
set(PICO_BOARD pico CACHE STRING "Board type")
# Pull in Raspberry Pi Pico SDK (must be before project)
include(pico_sdk_import.cmake)
2024-02-06 20:51:02 +01:00
if (PICO_SDK_VERSION_STRING VERSION_LESS "1.5.0")
message(FATAL_ERROR "Raspberry Pi Pico SDK version 1.5.0 (or later) required. Your version is ${PICO_SDK_VERSION_STRING}")
2024-02-06 15:50:50 +01:00
endif()
2024-02-13 08:24:32 +01:00
project(raspi_keyer C CXX ASM)
2024-02-06 15:50:50 +01:00
# Initialise the Raspberry Pi Pico SDK
pico_sdk_init()
2024-02-13 09:11:28 +01:00
# Add executable. Default name is the project name
2024-02-13 08:24:32 +01:00
add_executable(raspi_keyer)
2024-02-09 11:10:06 +01:00
add_subdirectory(src)
2024-02-06 15:50:50 +01:00
2024-02-13 08:24:32 +01:00
pico_set_program_name(raspi_keyer "raspi_keyer")
2024-02-13 09:11:28 +01:00
pico_set_program_version(raspi_keyer "0.0.1")
2024-02-06 15:50:50 +01:00
2024-02-13 08:24:32 +01:00
pico_enable_stdio_uart(raspi_keyer 1)
2024-02-19 13:34:38 +01:00
pico_enable_stdio_usb(raspi_keyer 0)
2024-02-06 15:50:50 +01:00
2024-02-13 09:11:28 +01:00
target_compile_options(raspi_keyer PRIVATE -Wall -Wextra -Werror)
2024-02-06 15:50:50 +01:00
# Add the standard library to the build
2024-02-13 08:24:32 +01:00
target_link_libraries(raspi_keyer
2024-02-06 20:51:02 +01:00
pico_stdlib)
2024-02-06 15:50:50 +01:00
# Add the standard include files to the build
2024-02-13 08:24:32 +01:00
target_include_directories(raspi_keyer PRIVATE
2024-02-06 15:50:50 +01:00
${CMAKE_CURRENT_LIST_DIR}
${CMAKE_CURRENT_LIST_DIR}/.. # for our common lwipopts or any other standard includes, if required
)
2024-02-19 13:34:38 +01:00
# Make sure TinyUSB can find tusb_config.h
target_include_directories(raspi_keyer PUBLIC
${CMAKE_CURRENT_LIST_DIR}/src
)
2024-02-06 15:50:50 +01:00
# Add any user requested libraries
2024-02-13 08:24:32 +01:00
target_link_libraries(raspi_keyer
2024-02-06 22:11:58 +01:00
hardware_flash
hardware_exception
2024-02-12 15:57:50 +01:00
hardware_pwm
2024-02-06 22:11:58 +01:00
pico_flash
2024-02-14 10:13:50 +01:00
pico_multicore
2024-02-21 10:45:46 +01:00
hardware_adc
2024-02-19 13:34:38 +01:00
tinyusb_device
2024-02-19 14:23:33 +01:00
tinyusb_board
2024-02-21 10:47:42 +01:00
#hardware_pio
#hardware_uart
2024-02-06 22:11:58 +01:00
)
2024-02-06 15:50:50 +01:00
2024-02-13 08:24:32 +01:00
pico_add_extra_outputs(raspi_keyer)
2024-02-06 15:50:50 +01:00