This is a simple tool for creating C++ projects with vscode and premake, it's purpose is to ease the creation of vscode json files for tasks and launch configurations.
You must have premake5 configured in the command line, download it from here https://premake.github.io/ and add the directory where you extracted the .exe file to your PATH variable. If you speak portuguese you can follow this blog post https://crackthagamedev.com/posts/setup-cpp-vscode-premake, inside the post search for Baixar e instalar o Premake
.
You must also have Build Tools for Visual Studio installed, it comes with Visual Studio or you can download it independently from the microsoft website, again if you speak portuguese you can follow this blog post https://crackthagamedev.com/posts/setup-cpp-vscode-premake as it explains how the project generated by this tool is configured.
To execute this tool download the source code or clone this repository, I recommend you to install the program with npm install -g .
, this will make it available anywhere in your computer from the command line, it'll attend by the name cppproj
. The second option is to run npm start
. After running the tool, you will be prompted to enter the project location, workspace name, project name, etc. the tool will create the project location you entered, add a .vscode
folder and populate it with a tasks.json
and a launch.json
files, it will also add a premake5.lua
file with the projects configurations and add a .bat
file with instructions to open vscode within the Developer Command Prompt for Vs 2019.
Tasks | Action |
---|---|
Premake5Build | Invoke premake5 vs2019 to build the Visual Studio Project |
VS Build Debug WS | Build the visual Studio solution in debug mode |
Vs Build Release WS | Build the visual Studio solution in release mode |
Vs Build Debug <ProjectName> | Build the project in debug mode |
Vs Build Release <ProjectName> | Build the project in release mode |
Run Release <ProjectName> | Run the project in release mode, only for projects that generates .exe files(ConsoleApp/WindowedApp) |
It creates one launch configuration named Run Debug <ProjectName>
for each project that generates a .exe file(ConsoleApp/WindowedApp), stopAtEntry
will be true
Feel free to contribute to the project or to fork it, I may add some code to it as I feel the need.