pi_pico/cmake/cmake_config/project_config.cmake
Mohamed Salem 3687e48684 Add complete firmware stack with USB-CDC proof of life
Dockerized build system (Dockerfile, docker-compose, build.sh) with
Pico SDK cross-compilation. Modular CMake split into project_config,
mcu_config, and sources_config under cmake/. Component architecture
following inc/prg/cfg convention: STD_TYPES, MCU_USB, HAL_COM,
APP_CLSW, SYS_ECU. Full call chain SYS_ECU -> APP_CLSW -> HAL_COM
-> MCU_USB verified end-to-end on RP2040-Zero hardware over USB-CDC.
Includes flash.sh for automated .uf2 flashing on macOS and
devcontainer config for VS Code.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 18:23:24 +02:00

39 lines
1.9 KiB
CMake

# ============================================================================
# project_config.cmake
# ----------------------------------------------------------------------------
# Project-wide identity and language settings. No side effects - this file
# only sets variables that later fragments (mcu_config, sources) and the
# top-level CMakeLists.txt read from.
# ============================================================================
# Human-readable project name. Used as the CMake project name AND as the
# build target name, so the final firmware artifact will be named
# Color_Switcher_PICO.uf2 / .elf / .bin etc.
set(PROJECT_NAME Color_Switcher_PICO)
# Semantic version of the firmware. Bump manually on releases.
set(PROJECT_VERSION 0.1.0)
# Languages this project compiles:
# - C : our application source files
# - CXX : parts of the Pico SDK are C++ internally, so CMake must enable it
# even though we write no C++ of our own
# - ASM : RP2040 startup code, vector table, and boot2 are .S files that
# must be passed through the assembler
set(PROJECT_LANGUAGES C CXX ASM)
# C standard used across all targets (C11 gives us _Static_assert, stdint,
# stdbool, etc. without relying on compiler extensions).
set(PROJECT_C_STANDARD 11)
# Tell CMake to emit a compile_commands.json file inside the build directory
# whenever the project is configured. This file lists every source file and
# the exact compile command (including every -I include path and -D define)
# that CMake will use to build it. clangd (the language server used by VS
# Code for C/C++ intellisense) reads it to resolve #include directives and
# provide accurate hover types, go-to-definition, and diagnostics. Without
# this flag, clangd would guess blindly and fail to find Pico SDK headers
# under /opt/pico-sdk. This setting is project-wide and safe - it costs
# nothing at build time and is ignored by the compiler itself.
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)