Skip to content
This repository has been archived by the owner on Aug 27, 2021. It is now read-only.

Add support to specify an arbitrary directory to track external libraries #193

Open
skraelings opened this issue Aug 13, 2014 · 12 comments
Open

Comments

@skraelings
Copy link

Currently there are two ways to add external dependecies, correct me if I am wrong:

  • arduino_libraries_dir
  • lib/ dir inside the project

it would be nice to specify a directory (ala 'sketchbook/libraries') for external dependencies as not to clutter the arduino_libraries and also not to copy-paste endlessly the same libraries across the projects I am working on.

@translucide
Copy link

I use a simple script I made that adds a symlink to the lib/ dir folder of my current project for the librairies i want to import to my project. That works and prevents copying same libs files in all projects.

@joelbschwartz
Copy link

@skraelings +1. Being able to reference external libraries, for example by defining a [lib] path within the 'ino.ini' file, would be awesome.

@translucide I haven't been able to get this to work. When I tried this, I kept 'lib' as a directory, and used symlinks for a sample header. In this case, replacing what was '/test-header/' (within 'lib') with a symlink to '~/Development/Sketchbook/Libraries/test-header'. Can you please give more detail on how this works for you?

@translucide
Copy link

@joelbschwartz I used a folder in my main librairies folder that has a foldername.h and a foldername.cpp in it. Then I symlink that "foldername" folder in the lib subfolder of my ino project, i.e. I have now myinoproject/lib/foldername as a symlink to my librairiesfolder/foldername... Scripting this for integration with any ide is pretty straight forwward... just have to pop up a dialog box that fetches a list of directories from my main librairies directory. On linux symlinks are the same as having the files in your myinoproject/libs directory, so first I suggest you try with a lib subfolder that works, then move it to your librairies main directory.... I do not see why it would not work. Let me know if you are not able to make it work with the info I provided, Ill be happy to help you and dig more into it if necessary.

@translucide
Copy link

@joelbschwartz However I do agree that having an .ini setting with additional librairies path would be really awesome !

@translucide
Copy link

Should anyone need this and understand PHP , here is my add library script that I use with Komodo IDE (of course, you can change the paths to the Librairies folder!) :

#!/bin/php

@translucide
Copy link

oups... where there is gray bg below code, it is encloded in backticks but they do not appear.... damn...where do we upload files here ???

@joelbschwartz
Copy link

@translucide Sorry, I realized from your response I had a typo (corrected) when I described the symlink. Based on your description and code, it seems like we're doing the same thing now. Not sure why it doesn't work for me...

@translucide
Copy link

@joelbschwartz Could file permissions be an issue ?

@translucide
Copy link

Did you start with a sub inoproject/lib/ folder and moved it to your lib directory after seeing it working ? Does your librairies folder resides on the same partition as your ino project one ?... jsut stating the obvious... you know we have to eliminate the basics first...

@translucide
Copy link

@joelbschwartz and moved it to your lib --> not lib, but main librairies folder I meant... sorry...

@translucide
Copy link

screenshot from 2014-09-27 23 22 14

Here is a screenshot: on the left a general librairies folder (created one on purpose cause I am not on my main computer right now).... on the right my ino prject named "libtest" in the lib subfolder. The link there refers to the MCP9701 folder in the Librairies folder. I thought that leaves no place for miscommunication.... so there we can tackle the remaining of the problem if you still have one ! So lets get this fixed for you !

@translucide
Copy link

I forgot to mention the obvious, I have in Librairies/MCP9701 folder a file named MCP9701.cpp and .h too.... will not work if files names are not named as the foldername

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants