Skip to content

simionrobert/cpp-template-layout

Repository files navigation

cpp-template-layout

cpp-template-layout is a template for a simple Visual Studio based C++ solution: it can be used as a base for new projects.

It is designed for Visual Studio Community 2019 for single or multiple projects inside one solution.

Project structure

This project has been set up with a specific file/folder structure in mind. The following describes some important features of this setup:

  • bin : Contains the final executabiles (generated)
  • build: Contains intermediate files generated during build time (generated)
  • include: Public projects header files that need to be exposed (generated)
  • lib: External libraries used in the projects
  • src: Solution source files (*.cpp), organised in separate folders for multiple .vxcproj projects or only a main.cpp for single projects

How to set up the project

  1. This github project is just an example. I am going to show you how I made the solution as it is.
  2. Create an empty solution.
  3. Switch to Folder view by clicking Toggle between Solution and Folder views.
  4. Add the folders bin, build, docs, lib, src
  5. Switch to Solution view by clicking Toggle between Solution and Folder views.
  6. Right click the solution and add the first project in the src folder! You can add multiple projects in this step.
  7. Right click the first project and enter $(SolutionDir)bin\$(Configuration)\ in Properties/General/OutputDirectory.
  8. Right click the first project and enter $(SolutionDir)build\$(ProjectName)\$(Configuration)\ in Properties/General/IntermediateDirectory.

Options

You can generate the .gitignore file using gitignore.io

About

Template layout for a simple Visual Studio-based C++ project

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published