Skip to content

Document library search paths #713

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
itsayellow opened this issue May 19, 2020 · 3 comments · Fixed by #748
Closed

Document library search paths #713

itsayellow opened this issue May 19, 2020 · 3 comments · Fixed by #748
Labels
topic: documentation Related to documentation for the project

Comments

@itsayellow
Copy link

This is a request that somewhere in the documentation the library search paths would be documented.

Currently I have my own library which lives in a git repo (and is not part of the arduino libraries index.) I couldn't find anything in the documentation about where to put it so that arduino-cli compile would find it.

Finally in a non-arduino webpage I found that if you put a library in ~/Documents/Arduino/libraries (on macOS) then arduino-cli compile will find it. It would be nice if this were documented somewhere.

@per1234
Copy link
Contributor

per1234 commented May 19, 2020

This information is documented in the "Sketch Build Process" documentation:
https://arduino.github.io/arduino-cli/sketch-build-process/#location-priority

However, that documentation was written with the Arduino IDE in mind and could use some updates to be more friendly to the Arduino CLI user. Arduino CLI uses the same system, but Arduino CLI uses the term "user directory" in place of the Arduino IDE's "sketchbook".

Note that the user directory location is configurable. You can find the location with arduino-cli config dump. You can configure it in the directories.data key of the arduino-cli.yaml configuration file created by arduino-cli config init, or by setting the ARDUINO_DIRECTORIES_USER environment variable.

@per1234 per1234 added the topic: documentation Related to documentation for the project label May 19, 2020
@itsayellow
Copy link
Author

That is very helpful information, thanks! Your last paragraph would be wonderful in the docs somewhere.

I did read that exact passage that you linked to, and could not parse that any of it referred to ~/Documents/Arduino/libraries

And yes, the "sketchbook" was the most confusing keyword. I assumed that {sketchbook path} referred to my current project directory (e.g. where my *.ino files are for the specific project I was compiling.) I didn't realize that {sketchbook path} means ~/Documents/Arduino.

Agreed, It would be nice to use the same keyword user that the arduino-cli dump config uses in the documentation instead of sketchbook.

Thanks for the clarifications.

@schnoberts1
Copy link

+1.

In the IDE if I set the Sketchbook location in preferences it finds all the libraries I have in <location>/libraries. If I simply do this:

ARDUINO_DIRECTORIES_USER=/Users/andy/code/dbc/gauge/SquareLine_Project/ arduino-cli compile --profile dbc

the libraries aren't auto-discovered. I'd like the option for it to work like it does in the IDE. To be fair, what I really want is a transparent build functions in CMake so I can use tested and scalable existing build solutions (I know there's a bunch of open source stuff) but I'd be happy if I could get the CLI to replicate what the IDE does with the same minimal effort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: documentation Related to documentation for the project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants