Files
labs/lab-6
2026-10-20 08:58:53 +03:00
..
2026-10-20 08:58:53 +03:00
2026-10-20 08:58:53 +03:00
2026-10-20 08:58:53 +03:00
2026-10-20 08:58:53 +03:00
2026-10-20 08:58:53 +03:00
2026-10-20 08:58:53 +03:00

CMake C Template

A small C11 project template with a reusable library, executable, and CTest test.

Requirements

  • CMake 3.16 or newer
  • A C compiler with C11 support

Configure and build

cmake -S . -B build
cmake --build build

Run

./build/c_template

Test

ctest --test-dir build --output-on-failure

The greeting library is an example of how to separate reusable code into a public header and implementation. Replace it with your project's own modules.