Quick openFrameworks workspace initializer for Visual Studio Code.
Fork of vscode_oF by @hiroMTB modified for Arch systems.
This is not an addon, although the name suggests it is.
This project is intended to quickly initiate a vscode workspace in an existing or empty project or an addon example. Using the provided alias it is also possible to initiate a fresh openframeworks project.
It relies on the use of of aliases and command chaining in terminal to circumvent git clone <repo> .'s restrictions in a non empty directory.
After adding the alias to your shell config (in my case zsh) you can run ofxvsc in your current existing project.
This is particularly useful for quickly initiating addon examples for testing, without the need to go through the projectGenerator.
alias ofcode="git clone https://github.com/hsab/ofVSCode.git && mv ./ofVSCode/.vscode/ ./ && mv ./ofVSCode/.gitignore ./ && mv -n ./ofVSCode/addons.make ./ && mv -n ./ofVSCode/config.make ./ && mv -n ./ofVSCode/Makefile ./ && mv -n ./ofVSCode/src/ ./ && rm -rf ./ofVSCode"
If you'd like to immediately open the project in VSCode after initiation use the following alias instead:
alias ofcode="git clone https://github.com/hsab/ofVSCode.git && mv ./ofVSCode/.vscode/ ./ && mv ./ofVSCode/.gitignore ./ && mv -n ./ofVSCode/addons.make ./ && mv -n ./ofVSCode/config.make ./ && mv -n ./ofVSCode/Makefile ./ && mv -n ./ofVSCode/src/ ./ && rm -rf ./ofVSCode && code ./ &"
Running the above alias will:
- Create a
.vscodeworkspace folder and.gitignorein your current directory. - Create fresh
Makefile,addons.make, andconfig.makeif they don't already exist in your current directory. - Create a
srcfolder with an empty project includingmain.cpp,ofApp.cpp, andofApp.hif they don't already exist in your current directory. - Remove
ofxVSCodefolder entirely.
Note: By default the include and libraries are linked such that the project is in the myApps directory:
- Correct:
openframeworks/apps/myApps/yourProject/
This structure is my personal preference, because addon examples can easily be compile and initiated using the same technique. You can fork the repository and appropriately change every instance of ${workspaceRoot}/../../../ in the c_cpp_properties.json file if you need a different directory configuration.
- Edit addons.make file if you want to add addons.
- You might need to edit the
c_cpp_properties.jsonfile.
- Automatic path checking to ensure correct folder structure by running the
Check Pathstask. - Auto code completion (Requires Microsoft C++ extension).
- Step by step debugging (requires gdb or similar debugger).
- Browse source code under
/libs/openFrameworksand/addons/*folders. - Currently tested on macOS, Ubuntu(by @anselanza), and Arch (Manjaro).
/of
/apps
/myApps
/exampleProject <--
0.10.0
- Rebuilding does not work properly. As a fix prior to running the task, only the binary file(s) is removed:
- Build Debug:
rm -f ./bin/$(basename '$PWD')_debug && make Debug -j$(nproc)
- Build Release:
rm -f ./bin/$(basename '$PWD') && make Release -j$(nproc)
- Build Debug:
- macOS.sdk path is hard coded
#include error detectedfor header files which is not actualy included. For exampleGL/gl.his for Linux wihch is not included on macOS. This shold be fixed withlimitSymbolsToIncludedHeadersproperty inc_cpp_properties.json.
