Custom /include and /lib paths with ProjectGenerator: config.make?

Hi everybody, I have openFrameworks projects which use code defined in external include/ and lib/ folders (.h and .cpp files), one directory outside the project directory. It’s setup like this so I can share my code between multiple openFrameworks projects.

I develop these projects on MacOS and Windows, so manually adding the include paths to XCode and Visual Studio every time I make a change to a project with the projectGenerator is a hassle.

I tried to add the custom header include path to config.make, but this hasn’t worked.
The /Include folder sits one directory outside of the project directory, so I thought using: PROJECT_EXTERNAL_SOURCE_PATHS = ../inc would add ../inc to the generated IDE project file. This hasn’t worked, and neither XCode nor VS can find the headers needed to compile the app.

Does anybody have any suggestions how to add custom include and library folders that the projectGenerator uses when updating openFrameworks projects?

For reference, here is the github repository folder I am referring to. This repository sits inside the openFrameworks/apps folder:

Hi @ross_hoyt

Thats interesting timing.
I recently added those features to the ProjectGenerator.
See: https://github.com/openframeworks/projectGenerator/pull/248

If you build the master branch of https://github.com/openframeworks/projectGenerator it should work for you. The next release will have this PG bundled with it.

If you want to give it a go on Mac here is a build:

2 Likes

Hi @theo!

Thanks much for your response. I used the projectGenerator App from the .zip after having an issue with building the repository in VS19. Here’s the issue I encountered on Mac:

I placed the downloaded projectGenerator folder inside my OpenFrameworks (of_v0.11.0_osx_release) directory, then opened projectGenerator and imported my existing OF project. It picked up the include path which I’d already added manually to config.make with PROJECT_EXTERNAL_SOURCE_PATHS ( …/inc showed up on the list of additional source folders). I then added the …/lib path as an Additional Source Folders in the projectGenerator.

However, once I updated the project, the Additional Source Folder I had added (…/lib) disappeared from the projectGenerator UI. When I opened it in IDE, the XCode project still didn’t have the correct header search path …/inc) or the path to …/lib, as I was intending.

I tried it with absolute paths and the same thing happened. I’m not sure if something else is causing the issue that I’m missing.

Again, thanks for taking the time to get back to me!

Hmm. Can you try selecting the lib path with the file explorer / selection prompt instead of just adding …/lib? I think the PG needs absolute paths which it makes relative ( if possible ) to the project.

If that doesn’t work could you share some screenshots of your process?

I have tested it on Mac and PC with some fairly complex projects but there could be something I didn’t catch.

Thanks so much!
Theo