LoginSignup
38
23

More than 3 years have passed since last update.

VSCodeでopenFrameworksをやる環境構築

Posted at

of0.11.0が出ました。
公式でVSCodeをサポートするようになったが、やり方が書いてなかったのでそれをやっていく。

  1. projectGeneratorの設定を選ぶ
    Screen Shot 2019-12-08 at 14.50.47.png

  2. Advanced optionsにチェックをつける
    Screen Shot 2019-12-08 at 14.50.59.png

  3. するとTemplateが選べるようになるのでVisual Studio Code選択
    Screen Shot 2019-12-08 at 14.51.02.png

  4. するとVSCodeのワークスペースが作られたプロジェクトが作られるので、ワークスペースをダブルクリック
    Screen Shot 2019-12-08 at 14.51.48.png

  5. ひらけた

  6. Screen Shot 2019-12-08 at 14.52.06.png

  7. cmd/ctrl + shit + bでタスクを選択できるので、build Debugを選択するとビルドできる

  8. make RunDebugとターミナルで実行すれば、アプリが起動する

ビルドとアプリの実行を同時に行う

  1. ビルドとアプリの実行を毎回別で行うのは面倒臭いので、アプリの実行をタスクにして、アプリの実行の前にビルドを走らせるようにする

.vscode/tasks.jsonに以下を追記。

  • "dependsOn"で先に実行させたいタスクを選択
.vscode/tasks.json
{
    "type": "shell",
    "label": "Run DEBUG",
    "presentation": {
        "reveal": "always",
        "panel": "shared"
    },
    "command": "make RunDebug",
    "group": {
        "kind": "build",
        "isDefault": true
    },
    "problemMatcher": {
        "owner": "cpp",
        "fileLocation": [
            "relative",
            "${workspaceFolder}"
        ],
        "pattern": {
            "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
            "file": 1,
            "line": 2,
            "column": 3,
            "severity": 4,
            "message": 5
        }
    },
    "dependsOn": [
        "Build DEBUG"
    ]
}

これで、憎きXcodeから離脱して快適なoFライフ!!

38
23
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
38
23