Skip to content

Using Arduino Libraries

Phil Schatzmann edited this page Oct 4, 2025 · 8 revisions

I am providing a cmake include that makes the use of Arduino libraries quite simple. Here is an example how you define a library that will be installed from github:

# add the arduino-SAM library
include(${CMAKE_SOURCE_DIR}/ArduinoLibrary.cmake)
arduino_library(sam "https://github.com/pschatzmann/arduino-SAM")

Alternatively you can point to an existing directory.

After this, you can add sam in the target_link_libraries command.

A complete example can is available in the examples directory.

Clone this wiki locally