A CMake toolchain for cross-compiling projects to Arduino-compatible boards (AVR, ESP32, etc.) using standard CMake workflows.
Arduino CMake Toolchain is a CMake toolchain file that enables cross-compilation of CMake-based projects for Arduino-compatible boards like AVR and ESP32. It solves the problem of being limited to the Arduino IDE by allowing developers to use professional CMake workflows, favorite IDEs, and advanced build features while maintaining compatibility with Arduino's build system.
Embedded developers and professionals who work with Arduino boards but prefer or require CMake-based build systems, IDE integration, and more control over the compilation process.
Developers choose this toolchain because it provides a portable, generic CMake interface that works with any Arduino-compatible board without modifying project CMake scripts, unlike other Arduino CMake solutions that are board-specific or require Arduino-specific functions.
CMake toolchain for all Arduino compatible boards
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports all Arduino-compatible platforms like AVR and ESP32 through a single toolchain file, enabling cross-compilation without board-specific modifications.
Works with generic CMake projects by simply passing -D CMAKE_TOOLCHAIN_FILE, making it portable and IDE-agnostic, as emphasized in the project philosophy.
Uses the same build rules, flags, and configuration files (e.g., boards.txt) as Arduino IDE, ensuring consistency with official Arduino workflows.
Provides target_link_arduino_libraries for linking with native and third-party libraries, including automatic dependency resolution similar to Arduino IDE.
Supports multiple upload methods like serial port, network provisioning, and programmer-based uploads through target_enable_arduino_upload, as detailed in the usage section.
Has issues with some boards where uploaded applications fail due to variant source linking problems, requiring fixes in development branches like release-1.1-dev.
target_link_arduino_libraries may not detect libraries if include names don't match library names, necessitating manual workarounds as noted in known issues.
Lacks serial port monitoring, .ino/.pde file support, and standalone board/library management, which are standard in Arduino IDE but marked as missing features.
Requires separate build trees or complex configurations for projects targeting multiple Arduino boards, as CMake doesn't support multiple architectures in one build tree.