Skip to content

docs: add CMake getting-started guide for new users#3105

Open
leno23 wants to merge 2 commits into
catchorg:develfrom
leno23:docs/improve-cmake-getting-started-2351
Open

docs: add CMake getting-started guide for new users#3105
leno23 wants to merge 2 commits into
catchorg:develfrom
leno23:docs/improve-cmake-getting-started-2351

Conversation

@leno23
Copy link
Copy Markdown

@leno23 leno23 commented May 17, 2026

Summary

Adds a Getting started with CMake section that answers common first-time questions from #2351:

  • Where CMake snippets belong (CMakeLists.txt in the project root)
  • Minimal directory layout (CMakeLists.txt + test.cpp)
  • When to use Catch2::Catch2WithMain vs Catch2::Catch2 (custom main)
  • A smallest working CMakeLists.txt and build/run commands

Also links to this section from tutorial.md.

Fixes #2351.

Test plan

  • Documentation-only change; markdown renders correctly.

Made with Cursor

leno23 added 2 commits May 17, 2026 22:43
Explain project layout, when to use Catch2WithMain vs Catch2, and a
minimal CMakeLists.txt example. Link from the tutorial.

Fixes catchorg#2351.
Use lowercase include(FetchContent) per CMake conventions.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.31%. Comparing base (69e0473) to head (21e20c5).

Additional details and impacted files
@@            Coverage Diff             @@
##            devel    #3105      +/-   ##
==========================================
+ Coverage   91.26%   91.31%   +0.04%     
==========================================
  Files         204      204              
  Lines        8905     8905              
==========================================
+ Hits         8127     8131       +4     
+ Misses        778      774       -4     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve documentation for new users

1 participant