[CMake] [New Module] Arduino CMake

Alexander Neundorf a.neundorf-work at gmx.net
Tue Jan 24 14:12:04 EST 2012


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_
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.

setup_arduino_compiler() looks wrong.
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).
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 ?
This looks out of place.

Thanks
Alex


More information about the CMake mailing list