cmake_minimum_required(VERSION 3.13)

# Keep this board contract before SDK import and project/toolchain selection.
set(PICO_BOARD pico2_w CACHE STRING "Exact Pico 2 W target")
if(NOT PICO_BOARD STREQUAL "pico2_w")
  message(FATAL_ERROR "This workspace requires PICO_BOARD=pico2_w")
endif()
set(PICO_PLATFORM rp2350-arm-s CACHE STRING "Arm Cortex-M33 platform")
if(NOT PICO_PLATFORM STREQUAL "rp2350-arm-s")
  message(FATAL_ERROR "This workspace selects the Arm Cortex-M33 platform")
endif()
if(NOT PICO_SDK_PATH AND DEFINED ENV{PICO_SDK_PATH})
  set(PICO_SDK_PATH "$ENV{PICO_SDK_PATH}")
endif()
if(NOT PICO_SDK_PATH)
  message(FATAL_ERROR "Set PICO_SDK_PATH to the installed Pico SDK 2.3.1 directory")
endif()
if(NOT EXISTS "${PICO_SDK_PATH}/external/pico_sdk_import.cmake")
  message(FATAL_ERROR "PICO_SDK_PATH does not contain a complete Pico SDK")
endif()
include("${PICO_SDK_PATH}/external/pico_sdk_import.cmake")
project(club_pico2w_first LANGUAGES C CXX ASM)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
pico_sdk_init()
if(NOT PICO_SDK_VERSION_STRING VERSION_EQUAL "2.3.1")
  message(FATAL_ERROR "Reviewed SDK baseline is 2.3.1; review before changing it")
endif()
add_executable(club_pico2w_first src/main.cpp)
target_link_libraries(club_pico2w_first pico_stdlib pico_cyw43_arch_none)
pico_enable_stdio_usb(club_pico2w_first 1)
pico_enable_stdio_uart(club_pico2w_first 0)
pico_add_extra_outputs(club_pico2w_first)
