quarnster/SublimeClang — Issue #23: relative directory reference
Author: knifter
Created: 2012-01-24 13:21:11+00:00
State: open

Would it be possible to allow relative (to a project dir for example) references?

I have a project consisting of a few directories. Say for example:
~/src/app/library1
~/src/app/library2
~/src/app/application

Now application is using header files in library1 and library2. library2 Is using headers in library1. This does work, as long a I give clang the complete paths like:
"-I/home/me/src/app/library1or2". But this is a little inconvenient. I tried using:
"-I../library" and "-I~/src/app/library" which both do not work. (The last one wouldn't be any more usefull either anyway, but just as an example.)

Would it be possible to find a way to use relative paths? By using for example a project root variable or allowing '..'?

I understand this has some difficulty, as the above example does not actually have a single defined project root (app/library and app/application are both equal directories in the project file). But there might be ways to solve this. (As by defining a workspace root in the user config and supplying that as a var, by looking at the first dir in the project or by (temporary) demanding that a project using SublimeClang can have only one project.

The problem is that each person working on a project has to use its own project files now. This becomes a bit inconvenient as each user has to adjust all settings for itself. (not only sublimeclang settings, but also settings like added files/directories). It is nice to have the project file checked in with the project.