A little addendum to what I wrote earlier.<br><br><div class="gmail_quote">On Wed, Jan 25, 2012 at 8:54 AM, Alfa Omega <span dir="ltr"><<a href="mailto:queezythegreat@gmail.com">queezythegreat@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><div class="gmail_quote"><div class="im">2012/1/24 Alexander Neundorf <span dir="ltr"><<a href="mailto:a.neundorf-work@gmx.net" target="_blank">a.neundorf-work@gmx.net</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<div><br>
On Tuesday 24 January 2012, Alfa Omega wrote:<br>
> Hi,<br>
><br>
> What part does not follow the convention? I'm using a toolchain file, plus<br>
> when I was writing this I based it on a existing module bundled with CMake<br>
> (but cant remember which).<br>
><br>
> I'm open to modifying my project to match the convention. If you could<br>
> point out which parts don't quite meet the convention, I would greatly<br>
> appreciate that.<br>
<br>
</div>The functions in ArduinoProcessing.cmake should have a common prefix to show<br>
where they come from, e.g. ARDUINO_<br></blockquote></div><div>ArduinoProcessing.cmake is a prototype, and isn't used with Arduino CMake, so you can ignore that.<br> <br></div><div class="im"><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Same for the functions in FindArduino.cmake<br>
The documentation for the functions should be at the top of the file, so when<br>
cmake generates documentation, it will be included.<br></blockquote></div><div>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). <br>
</div></div></blockquote><div>When I originally wrote this, I wanted to hide as much of the boilerplate code as I could (hence I wanted people to use those two functions documentated at the top). Now I'm starting to think that apart from setup_arduino_compiler and setup_arduino_core (which could be merged into one) everything else could be used if someone who wanted control the build process manually. So that's why the documentation for the rest of the function where omitted from the top.<br>
<br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail_quote"><div>
<br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
setup_arduino_compiler() looks wrong.<br></blockquote><div>What do you mean by it looks wrong (the name might not be the best :))?<br></div></div></blockquote><div>Do you mean setup_arduino_compiler and setup_arduino_core should be merged?<br>
<br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail_quote"><div> <br></div><div class="im"><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Did you consider adding Arduino as "operating system" ?<br>
Then you could add a<br>
Platforms/Arduino.cmake<br>
which is loaded automatically when CMAKE_SYSTEM_NAME is set to Arduino. <br></blockquote><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Ah, I just see, you did.<br>
Is there are reason why you didn't put all the functions, settings, etc. there<br>
?<br>
Then it wouldn't be necessary to use FindArduino.cmake when you already know<br>
you are building for Arduino.<br>
(e.g. there is no FindWindows.cmake, you simply are on Windows, or the cmake<br>
run fails).<br></blockquote></div><div>That is a good point, but then how could I specify that I want a specific minimal version? <br><br></div><div class="im"><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
The toolchain file should be mostly done after the first three set() calls you<br>
have. More or less all of the rest should be in Arduino.cmake or Arduino-GNU-<br>
C/CXX.cmake.<br></blockquote></div></div></blockquote><div>What is the best way to initialize the compiler flags? And where should I move the rest of the stuff that in the toolchain file?<br><br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
The functions for setting up additional targets look ok.<br>
<br>
What should find_sources() be used for ?<br></blockquote></div><div>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).<br>
<br></div><div class="im"><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
This looks out of place.<br>
<br>
Thanks<br>
Alex<br>
</blockquote></div></div></blockquote></div><br>