Better generic CMake helpers.

Using arduino-cmake submodule from myself, pending this merge:
https://github.com/queezythegreat/arduino-cmake/pull/96