Setting a variable for OF root directory

Hi,
If I generate a project using the PG it places a relative path to my OF root directory.
What if I want to share my code or commit to a repo for someone else to use? The path to their OF folder may well be different.
I tried using $(OF_ROOT) as an environment variable and editing the .sln file but that’s not working.
Is this possible? If so any pointers?

Thanks

I’m on Windows and using VS 2017 btw

The way I work on shared projects (and I think the intended workflow) is to create a project and then only share the src folder and addons.make file. The collaborators can then use the project generator to reproduce the project on any platform within any directory. When you commit to the repo you don’t commit the project, just changes to the source (projects should be in the git.ignore). This seems to be close to many open source projects using other methods for project generation (like cmake). Collaborators will only have to regenerate the project when additional addons or include paths are used. On windows you can also share the property manager .props file, if these contain references to items in your PATH file they will work for using other libraries that don’t exist as addons.

Thank you @fresla that’s exactly the answer!
I thought that any addons are referenced sepcifically in the vs sln file and therefore that woudl have to be submitted to src too, I didn’t realise they were referenced in the addons.make file.
I’ve also figure using a ‘local addons’ folder in the project directory and cloning addon submodules into it then referencing them in the addons.make (i.e. localAddons/ofxTween) so I can easily share my projects with 3rd party code!

Thanks for your help :grinning:

hello,
for mananging addon depenedencies, you could also give the package manager a try. it works pretty similar to npm.
i have not yet tested the windows version. last time i tried i had difficulties linking libgit2. i guess it is not a difficult fix. contriibutions are very welcome.


i am also working on a frontend (https://github.com/thomasgeissl/ofPackageManager-frontend)

Thanks @thomasgeissl !
I will try that method too and let you know if I have any difficulties

Cheers

i uploaded a windows version. it is still a work in progess, but time to be tested.