Setting-up project to include OF library inside project path

edit: I’ve got it figured out. Here’s a really barebones version of the tutorial.

this is written using the OS X release but it works for iOS, too

  1. Take a new OF project made by the project generator or the example project in the OF release and put it wherever you like
  2. Inside your project’s folder, create a new folder and call it “libs” or “libraries” or whatever you like
  3. Take the OF OSX release folder and put it inside this library folder; make sure you keep the folder structure intact (you can delete all the folders in the release except “lib”)
  4. open your project in Xcode
  5. The OF project inside your project will be missing (red); delete it and add your project-local OF .xccodeproj by navigating to …/libs/openFrameworksCompiled/project/osx and dragging the project into your project’s workspace
  6. Edit your project’s Project.xcconfig to reflect your custom OF_PATH and the include path to the OF project’s CoreOF.xcconfig file (e.g. OF_PATH = libraries/of_v0.8.4_osx_release instead of …/…/…/…)
  7. In Targets > Buid Phases > Target Dependencies : add openFrameworks
  8. In Targets > Build Phases > Link Binary With Libraries : add openFrameworksDebug.a
  9. in Targets > Build Phases > Run Script > edit the first line to match the OF_PATH you defined in Project.xcconfig
  10. Done

I’ve made an example project available via GitHub that you can clone/fork and avoid doing the above steps yourself.

I want to put together a tutorial on setting up an OF project to include the OF project inside the project folder (instead of vice-versa like the project generator does). It’s useful to make self-contained project that has the right version of OF inside. It’s been a boon when I’m working on an OF project with other people.

I’ve done this a couple times myself, but I always forget how to do it right the first time, so I figured I’d write it down.

In the interim, I’m wondering if anyone knows all the steps.

Here’s what I know to do (if you’re starting from a project generator OF project):

  • Put OF inside the project in a folder (probably named lib or libs or library)
  • Edit Project.xcconfig to the correct path to the new OF_PATH
  • Remove the old OF xcodeproj and add the new one
  • I think you need to double-check build settings for Dependencies and search paths?

I’m ending up with the OF project complaining about missing headers so I think I’m missing something.
The app is complaining about missing symbols for architecture i386 but I think that might fix itself if I include the OF library properly?


This is super helpful! Thank you for sharing. It worked perfectly on the most recent version too.