-
Notifications
You must be signed in to change notification settings - Fork 39
Built in Libraries
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.