Is there a way to automatically install all libraries used by a project?

Suppose I clone an Arduino project from Github that uses a bunch of third party libraries. These libraries are all listed in the Arduino Library Index and available to install via the Library manager. Is there a way to install all the required libraries automatically?

Other frameworks often offer something like packages, where a project's source code contains a file listing the required packages and which version of said package was used. The IDE or a command line tool like NPM can then automatically download and install the required packages upon compilation.

Is something like that available for Arduino, or is it up to the repository's developer to list the required libraries and the specific versions, for instance in the readme.md, so that other developers can manually install them?

Hi @basp. This is supported for the library dependencies of libraries. A library can specify its dependencies on other libraries and the installation of the specifiied versions of those library dependencies is offered by the Arduino IDE Library Manager:

https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format

A capability like that for sketches was added recently:

https://arduino.github.io/arduino-cli/latest/sketch-project-file/#build-profiles

However, this feature is currently only available when using Arduino CLI from the command line. Arduino IDE doesn't have support for sketch build profiles at this time.

1 Like

Hi @ptillisch, that's interesting to hear! I was aware that Library Manager automatically installs dependencies but I was looking for this specific functionality for sketches as well. Good to hear that it's available for the CLI! Hopefully this willl eventually come to the IDE and find more widespread use. Thanks for the information!

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.