Skip to content

Instantly share code, notes, and snippets.

@acarabott
Last active October 12, 2016 20:50
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save acarabott/11043968 to your computer and use it in GitHub Desktop.
Save acarabott/11043968 to your computer and use it in GitHub Desktop.
openFrameworks Sublime Text Build
#!/bin/bash
# This lives in your project directory, alongside src/, bin/, config.make, etc
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR
make Debug && make RunDebug;
// This can live your Packages folder
// e.g. Packaages/openFrameworks/openFrameworks.sublime-build
{
"cmd": ["../buildAndRun.sh"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "ofApp.cpp"
}
@gdunstone
Copy link

If you use a laptop with bumblebee, and want to use your gfx card it is optimal to use the line make Debug && optirun make RunDebug; instead of make Debug && make RunDebug;
Also if you put the build script in the same directory as the sublime-build and change the build script to:

{
    "shell":true,
    "cmd": ["cp $packages/User/buildAndRun.sh ../;/bin/bash ../buildAndRun.sh"],
    "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
    "selector": "ofApp.cpp" // also for older oF change this to testApp.cpp
}

you can avoid a couple of problems, like with starting new projects, permissions etc.

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