Ofroot/addons in header search path (or adding it in addon_config.mk)

it seems that ofroot/addons is included in header search paths on VS / windows, but not in qt creator (at least on ubuntu). Ideally I’d like it to be included, because for my own addons at least I prefer to add full relative paths in the #include directives (e.g. #include ofxMSAControlFreak/src/ControlFreak/Parameter.h"). That way if I create custom projects without the PG (which I do occasionally, at least for adding my own addons) I don’t have to add anything to header search paths.
Alternatively, is it possible to add folders in the addons_config which is outside of the addon directory? e.g. is there access to an OF_ROOT variable? (If so what’s the name and syntax?)

why not just add the addon in the qbs of.addons that adds all the standard search paths and you don’t need to use the PG.

in any case there’s not anything like OR_ROOT path in the qtcreator parser for addon config (the project generator actually understands $OF_ROOT/…) you can add an includePath using of_root in the qbs, like:

of.includePaths = [FileInfo.joinPaths(of_root, "addons")]

oh yes that is actually what I’m doing right now. But if I do that then my addons don’t work for anybody else because my addons themselves include their own sources or my other addons by full path (e.g. https://github.com/memo/ofxMSAControlFreakImGui/blob/master/src/ofxMSAControlFreakImGui.h )

P.S. I was hoping for a solution which would be stored with the addon itself. If I implement it per project, the addons won’t work out of the box for others. OR it could be a global solution, e.g. ofroot/addons is already included in VS by default, just not in QTCreator (I don’t know about Xcode)

oh, i see, you mean you use those kind of include paths in the addons themselves. I’ll see to add an OF_ROOT path but you can also add in the addons_config.mk an include path to ../ like:

ADDON_INCLUDES = ../

which will effectively add a search path to the parent folder for the addon wherever it is (since you can also have local addons since a couple of versions ago which wouldn’t work with OF_ROOT)

oh that’s a great idea,handling local addons as well is even better. Unfortunately though, it doesn’t work :confused: (ubuntu 16.04.2, QTCreator 4.2.2). It just doesn’t find the headers. If I modify of.includePaths as you say above, it does work. If you’d like to try a quick test https://github.com/memo/ofxMSAControlFreakImGui

(maybe linked to same bug as Addon not correctly imported (QtCreator + Ubuntu) ?)

Just had a moment to test it and it’s working ok for me. I’m using OF from github though, so there might be some difference that makes it work there (the nightly builds should work the same)

oh ok, i’m mid project right now so can’t pull:) but will try it out separately asap. Thanks for checking.