Skip to content

Template project as a starting point to use CMake with Catch2(v3) for a C++ project

License

Notifications You must be signed in to change notification settings

pieromarini/cmake-catch2-cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CMake C++ Project with Catch2 testing

Directory Layout

.
├── lib                     # Dependencies
├── src                     # Source files
├── tests                   # Automated tests
├── cmake                   # cmake scripts
├── CMakeLists.txt          # main build config
├── LICENSE
└── README.md

Requirements:

  • cmake
  • gcc / clang / msvc

Usage

mkdir build
cd build

# Generate build files.
cmake ..

# Compile
make

# Run program (EXEC_NAME is set on CMakeLists.txt)
./[EXEC_NAME] 

# Run tests
make tests

Remarks

  • This project uses the v3 branch of Catch2.
  • Catch2 is built as a static library and then linked to our tests executable.
  • When generating the build files, all submodules will be fetched using the script SubmodulesCheck.cmake. This can be turned off by changing the variable GIT_SUBMODULE.

About

Template project as a starting point to use CMake with Catch2(v3) for a C++ project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published