LoginSignup
6
6

More than 5 years have passed since last update.

VSCodeでopenFrameworksのプロジェクトをショートカットキー1発でbuild and runする

Last updated at Posted at 2017-10-24

XCode、卒業。

IDE的な補完機能は非常に便利だけど、ぱっと試したりそんなにメソッドを多用しない場合は重たいXCodeを使ってまで欲しいわけではないこともある。もうターミナルで make しちゃえという思想に至ったのでそうする。

バージョンはoF v0.9.8

VSCodeのビルドタスク作成

oFのプロジェクトフォルダをvscodeで開いた状態でCmd + shift + Bすると、当然デフォルトでビルドタスクが無いので新しく作る。
以下の内容のjsonファイルを作成。

// Author @JotaroUT
// easy build of openFrameworks project in vscode

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "taskName": "Run",
            "command": "make; make RunRelease",
            "type": "shell",
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ]
}

あとはCmd + shift + Bするだけ。ぁ〜超簡単。

お気づきだろうか....

そう、単にterminalでmakemake RunReleaseしろと言ってるだけである。
実はopenFrameworksのプロジェクトをGenerateした段階でMakefileが作成されるため、makeすると、「コンパイル終わったからmake RunReleaseするなりで実行してね」と言われる。

make RunReleaseの文言はバージョンによって異なるので注意されたし。適宜json変えるなりしてください。

6
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6