[CMake] [New Module] Arduino CMake

Alfa Omega queezythegreat at gmail.com
Wed Jan 25 02:54:57 EST 2012


2012/1/24 Alexander Neundorf <a.neundorf-work at gmx.net>

> Hi,
>
> On Tuesday 24 January 2012, Alfa Omega wrote:
> > Hi,
> >
> > What part does not follow the convention? I'm using a toolchain file,
> plus
> > when I was writing this I based it on a existing module bundled with
> CMake
> > (but cant remember which).
> >
> > I'm open to modifying my project to match the convention. If you could
> > point out which parts don't quite meet the convention, I would greatly
> > appreciate that.
>
> The functions in ArduinoProcessing.cmake should have a common prefix to
> show
> where they come from, e.g. ARDUINO_
>
ArduinoProcessing.cmake is a prototype, and isn't used with Arduino CMake,
so you can ignore that.


> Same for the functions in FindArduino.cmake
> The documentation for the functions should be at the top of the file, so
> when
> cmake generates documentation, it will be included.
>
The documentation for the module is located at the top (only those two
function should be used), all other function are for internal use (but are
documented).

setup_arduino_compiler() looks wrong.
>
What do you mean by it looks wrong (the name might not be the best :))?


> Did you consider adding Arduino as "operating system" ?
> Then you could add a
> Platforms/Arduino.cmake
> which is loaded automatically when CMAKE_SYSTEM_NAME is set to Arduino.
>
Ah, I just see, you did.
> Is there are reason why you didn't put all the functions, settings, etc.
> there
> ?
> Then it wouldn't be necessary to use FindArduino.cmake when you already
> know
> you are building for Arduino.
> (e.g. there is no FindWindows.cmake, you simply are on Windows, or the
> cmake
> run fails).
>
That is a good point, but then how could I specify that I want a specific
minimal version?

The toolchain file should be mostly done after the first three set() calls
> you
> have. More or less all of the rest should be in Arduino.cmake or
> Arduino-GNU-
> C/CXX.cmake.
>
> The functions for setting up additional targets look ok.
>
> What should find_sources() be used for ?
>
It's used for getting all the sources located at specified path, because
there is some processing of the sources (for Arduino library detection
based on the header includes).

This looks out of place.
>
> Thanks
> Alex
>



-- 

------=[QTZ]=------
QueezyTheGreat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120125/631c65a8/attachment.htm>


More information about the CMake mailing list