Skip to content
/ cpp_starter Public template

Private copy of TheLartians/ModernCppStarter with the changes based on the personal taste. A template for modern C++ projects using CMake, CI, code coverage, clang-format, reproducible dependency management and more.

License

Notifications You must be signed in to change notification settings

Cvelth/cpp_starter

Repository files navigation

C++ Project Starter

TODO:

  • Replace all occurrences of "Greeter" in the relevant CMakeLists.txt with the name of your project
  • Add your project's codecov token to your project's github secrets under CODECOV_TOKEN
  • Happy coding!
  • Don't forget to write a README for you new project.
  • Feel free to replace the License with one suited for your project.

Usage

Build and run the standalone target

Use the following command to build and run the executable target.

cmake -Hstandalone -Bbuild/standalone
cmake --build build/standalone
./build/standalone/Greeter --help

Build and run test suite

Use the following commands from the project's root directory to run the test suite.

cmake -Htest -Bbuild/test
cmake --build build/test
CTEST_OUTPUT_ON_FAILURE=1 cmake --build build/test --target test

# or simply call the executable: 
./build/test/GreeterTests

To collect code coverage information, run CMake with the -DENABLE_TEST_COVERAGE=1 option.

Run clang-format

Use the following commands from the project's root directory to run clang-format (must be installed on the host system).

cmake -Htest -Bbuild/test

# view changes
cmake --build build/test --target format

# apply changes
cmake --build build/test --target fix-format

See Format.cmake for more options.

Additional tools

The project includes an tools.cmake file that can be used to import additional tools on-demand through CMake configuration arguments. The following are currently supported.

  • -DUSE_SANITIZER=<Address | Memory | MemoryWithOrigins | Undefined | Thread | Leak | 'Address;Undefined'>
  • -DUSE_CCACHE=<YES | NO>

About

Private copy of TheLartians/ModernCppStarter with the changes based on the personal taste. A template for modern C++ projects using CMake, CI, code coverage, clang-format, reproducible dependency management and more.

Resources

License

Stars

Watchers

Forks

Packages

No packages published