From #23, it appears that the Arduino-CMake-NG framework hadn't had the ability to correctly manage Arduino Libraries's sources since some of them were added when not required, some not added at all.
This PR gives the framework a consistent approach to Arduino Libraries, where the following rules apply:
All sources under the src sub-directory and all of its sub-directories are included in the library target's sources, if the src sub-directory exists
If it doesn't, only the sources located directly under the root directory are included in library target's sources
This is taken from the Official Library Directory Structure/Layout Specifications, part of the Arduino documentation.
However, this won't suffice as users need to have an ability to manually add additional sources, and probably even entire source directories.
For that, a new feature and API has been introduced - the target_source_directories function which appends all sources under a given list of directories to a target, optionally recursively.
An example of the API's usage can be found in the 3rd-party-library example.
Nevertheless, full documentation will soon be added.
The PR also fixed a bug regarding platform libraries, where the same platform lib couldn't be used more than once.
Something really bad is happening in AppVeyor right now - It can't even git-clone the PR!
This only happens to one of the jobs, so let's assume it's passing and I'll just merge this.
From #23, it appears that the Arduino-CMake-NG framework hadn't had the ability to correctly manage Arduino Libraries's sources since some of them were added when not required, some not added at all.
This PR gives the framework a consistent approach to Arduino Libraries, where the following rules apply:
However, this won't suffice as users need to have an ability to manually add additional sources, and probably even entire source directories. For that, a new feature and API has been introduced - the
target_source_directories
function which appends all sources under a given list of directories to a target, optionally recursively. An example of the API's usage can be found in the 3rd-party-library example. Nevertheless, full documentation will soon be added.The PR also fixed a bug regarding platform libraries, where the same platform lib couldn't be used more than once.
Fixes #23.