This example demonstrates how to use standard Arduino libraries. The magic happens in the CMakeLists.txt
For details consult my Blog