Skip to content

A template for C++ programs using CMake, Catch, and Visual Studio Code

Notifications You must be signed in to change notification settings

feixiao/cmake-catch-vsc-template

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C++ Starter Template for CMake

Can be used in Visual Studio Code

Features:

  • Building C++ files using CMake in Visual Studio Code
  • Supports Windows, Mac, and Linux
  • Catch Test for unit tests
  • Debugging with Visual Studio Code to provide breakpoints, watch, call stack, and pretty printing for STL containers such as std::map and std::vector

A Video on how to use this repo:

C++ Starter Template for CMake & Visual Studio Code with Catch test library

You can use this template for most of your C++ projects with minimal changes. Demo picture bottom

Prerequisite

Installing CMake

This repo uses CMake for building C++ files. You can install CMake using this link.

Installing Toolchain

CMake can detect and work with most toolchains. On Mac, you can install XCode. On Windows, you can use Visual Studio. On Linux, you can use gcc.

Visual Studio Code Extensions

If you are using Visual Studio Code, you need to install these extensions:

Cloning this repo

git clone https://github.com/ourarash/cmake-catch-vsc-template

Configuring CMake

Once CMake and CMake extensions are installed, type the following in the command line(osx command+shift+p):

CMake: Configure

This will create a subfolder called build. Once you do this, a new button on the left Activity Bar in Visual Studio Code will appear which allows you to run and debug the targets.

About

A template for C++ programs using CMake, Catch, and Visual Studio Code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 99.6%
  • CMake 0.4%