Skip to content

Support of CMake #1973

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3 tasks done
FStefanni opened this issue Nov 14, 2022 · 2 comments
Open
3 tasks done

Support of CMake #1973

FStefanni opened this issue Nov 14, 2022 · 2 comments
Labels
topic: build-process Related to the sketch build process topic: code Related to content of the project itself type: enhancement Proposed improvement

Comments

@FStefanni
Copy link

FStefanni commented Nov 14, 2022

Describe the request

There are many use cases for which the custom-made Arduino compilation process does not fit well or easily.

Some issues related to these needs are #1473 and #1407.

I also need more complex builds for my needs at work.

Actually, the truth is that complex scenarios require something less automatic, but well known and supported, which, for C and C++, it is CMake. CMake is great since allows to implement complex scenarios for the ones who need it, but it also allows to compile easily for non experts.

There have been many unofficial projects, the most up-to-date being:

https://github.com/technyon/Arduino-CMake-Toolchain,

but all of them are unofficial, meaning that they could support partial cases, be not up-to-date with the latest specification, and so on.

Supporting CMake also allow developers to use their preferred IDE without pain, since many of them are able to interact with CMake to get include paths, compile, etc..

So what I am suggesting is one of the following:

  • Switch from the custom build system, to the more standard CMake
    • Maybe, leveraging CMake to provide the automation currently provided for those who do not have more complex requirements
  • Provide a flag to generate CMake files, starting from the specification files of boards, platforms, libraries, etc.

So, in conclusion, I believe that supporting CMake would provide great value for many programmers.

Regards

Describe the current behavior

No CMake is supported, making integration in complex builds hard.

Arduino CLI version

0.28.0

Operating system

Linux

Operating system version

Debian testing

Additional context

Additional requests

Related

Issue checklist

  • I searched for previous requests in the issue tracker
  • I verified the feature was still missing when using the nightly build
  • My request contains all necessary details
@FStefanni FStefanni added the type: enhancement Proposed improvement label Nov 14, 2022
@per1234 per1234 added the topic: code Related to content of the project itself label Nov 15, 2022
@umbynos umbynos added the topic: build-process Related to the sketch build process label May 29, 2023
@schnoberts1

This comment was marked as duplicate.

@da-phil
Copy link

da-phil commented Jun 23, 2024

Yes, it would be so great to use an industry standard build tool such as CMake under the hood!
Then we could just deal with platform specifics (e.g. AVR, ESP32 etc.) in toolchain files and just use plain simple CMakeLists.txt files in project folders. I think for switching between toolchain files and/or even adapting them, arduino-cli would be still the tool of choice, but also limited to only that, not trying to replace a whole build tool.
This would help software developers so much in order to make code platform agnostic and also testing on developer machines a lot easier. I'm really not happy how writing unit tests for libraries has this strong coupling to the Arduino platform bloat, although this should run on normal PCs and laptops, using simple abstractions.
Using a proper cross-platform build tool would be one key aspect to enable those use-cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: build-process Related to the sketch build process topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

No branches or pull requests

5 participants