# CMake (C / C++) (/examples/cmake)



Harmont has first-class CMake support. One `hm.cmake(...)` call picks the
compiler, passes cache `defines`, and gives you `test()`, `lint()`, and
`fmt()` actions backed by CTest and clang-format. This example uses an explicit
compiler and a Release build with C++20.

## Project layout [#project-layout]

<Tree path="cmake-advanced" maxDepth="3" />

## Pipeline [#pipeline]

**Python**

<RemoteCode src="cmake-advanced/.hm/pipeline.py" lang="python" title=".hm/pipeline.py" />

**TypeScript**

<RemoteCode src="cmake-advanced/.hm/pipeline.ts" lang="typescript" title=".hm/pipeline.ts" />

## Run it [#run-it]

```bash
hm run ci
```

For a minimal single-binary setup, see the `c/` and `cpp/` examples in the
[harmont-cli repo](https://github.com/harmont-dev/harmont-cli/tree/main/examples).
