{"id":14962011,"url":"https://github.com/hasselmm/cmake-toolchain-arduino-cli","last_synced_at":"2026-01-19T16:31:37.145Z","repository":{"id":253291730,"uuid":"842451723","full_name":"hasselmm/cmake-toolchain-arduino-cli","owner":"hasselmm","description":"A CMake toolchain for Arduino entirely based upon Arduino CLI","archived":false,"fork":false,"pushed_at":"2024-08-23T23:16:30.000Z","size":592,"stargazers_count":1,"open_issues_count":9,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T07:43:03.365Z","etag":null,"topics":["arduino","avr","cmake","cmake-toolchain","esp32","esp8266","samd","stm32"],"latest_commit_sha":null,"homepage":"","language":"CMake","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hasselmm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"hasselmm","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":null}},"created_at":"2024-08-14T11:32:58.000Z","updated_at":"2024-08-23T21:37:35.000Z","dependencies_parsed_at":"2024-09-24T13:44:44.967Z","dependency_job_id":"7abdcdbe-b024-4322-874f-5dc4fd22738c","html_url":"https://github.com/hasselmm/cmake-toolchain-arduino-cli","commit_stats":{"total_commits":103,"total_committers":1,"mean_commits":103.0,"dds":0.0,"last_synced_commit":"62b086554670fdcdcffc63394f2af5afaaebc6b0"},"previous_names":["hasselmm/cmake-toolchain-arduino-cli"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hasselmm/cmake-toolchain-arduino-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasselmm%2Fcmake-toolchain-arduino-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasselmm%2Fcmake-toolchain-arduino-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasselmm%2Fcmake-toolchain-arduino-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasselmm%2Fcmake-toolchain-arduino-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hasselmm","download_url":"https://codeload.github.com/hasselmm/cmake-toolchain-arduino-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasselmm%2Fcmake-toolchain-arduino-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28574292,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T16:29:19.148Z","status":"ssl_error","status_checked_at":"2026-01-19T16:29:17.772Z","response_time":67,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino","avr","cmake","cmake-toolchain","esp32","esp8266","samd","stm32"],"created_at":"2024-09-24T13:28:42.677Z","updated_at":"2026-01-19T16:31:37.123Z","avatar_url":"https://github.com/hasselmm.png","language":"CMake","funding_links":["https://github.com/sponsors/hasselmm"],"categories":[],"sub_categories":[],"readme":"# CMake toolchain for Arduino CLI\n\nHow about using [CMake](https://cmake.org) to build your [Arduino](https://arduino.cc/) projects?\n\nHow about using `CMakeLists.txt` files as simple as this?\n\n```CMake\ncmake_minimum_required(VERSION 3.19)\nproject(CMakeBlink LANGUAGES CXX)\nadd_executable(CMakeBlink CMakeBlink.ino)\n```\n\nThis all can be done using [Arduino CLI](https://github.com/arduino/arduino-cli).\nThis toolchain is fully based upon this really great tool: There are no tricks, no hacks, \nno manual parsing of obscure text files at undocumented locations. Just the official\nAPI and some pretty straight forward CMake. That's the main principle of this toolchain\nfile, and that's what hopefully makes it more robust than any other Arduino toolchain\nfile before *(— famous last words)*.\n\n## Status\n\nThis project is in **early development**.\nSo far nothing more than a fairly successful proof of concept.\n\n- There still are plenty of shorcuts and major FIXME comments in the scipts.\n- The toolchain only has been successfully tested with the Ninja generator so far.\n- CMake's MS-Build generator is known to fail.\n- Most importantly one cannot add libraries yet.\n- Annoyingly one still needs an `#include \u003cArduino.h\u003e` in the main sketch.\n- Many more problems, I guess...\n\nCheck [\"ready for public announcement\"][milestone-2] to see what's missing.\n\nThe following Arduino platforms are tested automatically:\n\n| Platform                                               | Status                                                    |\n| ------------------------------------------------------ | --------------------------------------------------------: |\n| [Arduino Core for AVR boards][arduino-avr]             | [![Status: AVR    ][arduino-avr.svg]    ][workflows/main] |\n| [Arduino Core for ESP32 boards][arduino-esp32]         | [![Status: ESP32  ][arduino-esp32.svg]  ][workflows/main] |\n| [Arduino Core for ESP8266 boards][arduino-esp8266]     | [![Status: ESP8266][arduino-esp8266.svg]][workflows/main] |\n| [Arduino Core for SAMD21 boards][arduino-samd]         | [![Status: SAM D  ][arduino-samd.svg]   ][workflows/main] |\n| [Arduino Core for STM32 boards][arduino-stm32]         | [![Status: STM32  ][arduino-stm32.svg]  ][workflows/main] |\n| [ATTinyCore Universal for ATtiny devices][attiny-core] | [![Status: ATtiny ][attiny-core.svg]    ][workflows/main] |\n\nAnyway, if you got some spare time, feel free to try out, to test, to give feedback,\nto contribute.\n\n## Usage\n### General\n\nIn general just configure your project like this:\n\n```Bash\ncmake -S ~/Arduino/YourProject \\\n    --toolchain PATH-TO/arduino-cli-toolchain.cmake \\\n    -D ARDUINO_BOARD=arduino:avr:nano\n```\n\nThe parameter `ARDUINO_BOARD` is mandatory and provides your device's FQBN to the toolchain.\n\nFor more information about the FQBN string, or so called \"fully qualified board names\" visit\nthe [Arduino CLI wiki](https://arduino.github.io/arduino-cli/1.0/FAQ/#whats-the-fqbn-string).\n\n### QtCreator\n\n![Setup a new kit](.assets/qtcreator-kit-setup.png)\n\n1. add a new kit to QtCreator\n2. name the new kit, e.g. \"Arduino (board name)\"\n3. select \"Bare Metal Device\"\n4. make sure no Qt version is selected\n5. configure CMake's initial configuration\n\n![Configure the kit's CMake settings](.assets/qtcreator-kit-setup-cmake.png)\n\n1. remove all old settings\n2. select the toolchain: `-DCMAKE_TOOLCHAIN_FILE:PATH=/YOUR/PATH/TO/cmake-toolchain-arduino-cli/toolchain/arduino-cli-toolchain.cmake`\n3. configure a board: `-DARDUINO_BOARD:STRING=esp8266:esp8266:nodemcuv2:baud=512000`\n\n![Setup a project](.assets/qtcreator-project-setup.png)\n\nHere you go! You are ready to open CMake based Arduino projects in QtCreator.\n\n## License\n\nThis toolchain file, its related tools, tests, and examples are provided by under the terms\nof the [MIT License](LICENSE).\n\n## Credits\n\nThis project would not have been possible without all the previous hard work\n[Arduino-CMake-Toolchain](https://github.com/a9183756-gh/Arduino-CMake-Toolchain).\nI took good inspiration from it, especially when it comes to making CMake's initial\ncompiler detection accept Arduinos very special binary layout.\n\n\u003c!-- The following are the link reference definitions used in this document --\u003e\n\n[arduino-avr]:          https://github.com/arduino/ArduinoCore-avr\n[arduino-samd]:         https://github.com/arduino/ArduinoCore-samd\n[arduino-esp32]:        https://github.com/arduino/arduino-esp32\n[arduino-esp8266]:      https://github.com/esp8266/Arduino\n[arduino-stm32]:        https://github.com/stm32duino/Arduino_Core_STM32\n[attiny-core]:          https://github.com/SpenceKonde/ATTinyCore\n\n[arduino-avr.svg]:      https://github.com/hasselmm/cmake-toolchain-arduino-cli/actions/workflows/badge-arduino-avr.yml/badge.svg\n[arduino-esp32.svg]:    https://github.com/hasselmm/cmake-toolchain-arduino-cli/actions/workflows/badge-esp32.yml/badge.svg\n[arduino-esp8266.svg]:  https://github.com/hasselmm/cmake-toolchain-arduino-cli/actions/workflows/badge-esp8266.yml/badge.svg\n[arduino-samd.svg]:     https://github.com/hasselmm/cmake-toolchain-arduino-cli/actions/workflows/badge-arduino-samd.yml/badge.svg\n[arduino-stm32.svg]:    https://github.com/hasselmm/cmake-toolchain-arduino-cli/actions/workflows/badge-stm32.yml/badge.svg\n[attiny-core.svg]:      https://github.com/hasselmm/cmake-toolchain-arduino-cli/actions/workflows/badge-attinycore.yml/badge.svg\n[workflows/main]:       https://github.com/hasselmm/cmake-toolchain-arduino-cli/actions/workflows/main.yml\n\n[milestone-2]:          https://github.com/hasselmm/cmake-toolchain-arduino-cli/milestone/2\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhasselmm%2Fcmake-toolchain-arduino-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhasselmm%2Fcmake-toolchain-arduino-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhasselmm%2Fcmake-toolchain-arduino-cli/lists"}