Skip to content

Instantly share code, notes, and snippets.

@indefinit
Last active September 20, 2017 20:54
Show Gist options
  • Save indefinit/5989e112ee21b551d3b9 to your computer and use it in GitHub Desktop.
Save indefinit/5989e112ee21b551d3b9 to your computer and use it in GitHub Desktop.
Openframeworks: bundle app resources inside packaged contents

So you want to bundle your openframeworks app and not have to worry about that pesky "data/" directory... follow this stack overflow article:
http://stackoverflow.com/questions/4882572/how-to-bundle-an-openframeworks-application-in-xcode-relative-resource-linking

TLDR: First you need to tell xCode to copy your /bin/data directory into your application bundle by adding a build phase:

  1. Click on your project in the Project Navigator
  2. Select "Build Phases"
  3. Toggle open the "Run Script" section and paste in the following: cp -r bin/data "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Resources";

Then tell your app where to find the data folder relative to itself within the bundle.

Inside the setup method of your oF app: ofSetDataPathRoot("../Resources/data/");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment