Skip to content

RolandStolz/cpp-cmake-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cpp-CMake-Template

This is a template for a C++ project using CMake.

Description

There are currently three different templates available:

  1. branch main: This is the most complete template. It contains a main.cpp file that uses a simple library in the src folder. This library also uses a private sub-library in the src folder.
  2. branch basic: This is the most basic template. It contains a main.cpp file that uses a simple library in the src folder.
  3. branch testing: This template has the same structure as the main branch, but it also implements unit tests using the Catch2 library.

Getting Started

Dependencies

  • CMake is required to build the project.
  • Boost is required, only for the purpose of showing how to use an external library.
  • Catch2 is fetched automatically by CMake when using the testing branch, so no need to install it manually.

Installing

Git clone the repository and specify the branch you want to use:

git clone <repository_url> -b <branch_name>

Executing program

In the top-level directory type:

  1. configure: cmake -B build
  2. generate: cmake --build build
  3. run: ./build CMakeTemplate

Resources for learning more about CMake

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published