Skip to content
This repository was archived by the owner on Apr 17, 2023. It is now read-only.

Built in Libraries

Timor Gruber edited this page Oct 2, 2018 · 1 revision

These are libraries that are included as part of the SDK or a custom platform.
They conform to a certain format/standard determined by Arduino, and for that reason they're also called "Arduino Libraries" in the Arduino-CMake terminology.
Besides, they consist only of sources - There are no pre-built binaries whatsoever.

These libraries have to be found at first, then linked to another target, preferably the executable target.
To find a library, one should call the find_arduino_library function.

Then, to link it, one would call the link_arduino_library function. It accepts the following parameters:

The following example shows how the Stepper, Servo and Ethernet libraries are included in a project:

find_arduino_library(stepper_lib Stepper ${board_id})
link_arduino_library(my_target stepper_lib ${board_id})

find_arduino_library(servo_lib Servo ${board_id})
link_arduino_library(my_target servo_lib ${board_id})

find_arduino_library(ethernet_lib Ethernet ${board_id})
link_arduino_library(my_target ethernet_lib ${board_id})

Note that the example above assumes the my_target target has already been created earlier.
Also, board's ID has been retrieved as well.