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 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 use the library in the target_link_libraries command. A complete examle can be found here

Clone this wiki locally