# CMake (/pipeline-sdk/reference/toolchains/cmake)



{/* Generated by docs-site/scripts/generate-dsl-docs.ts — do not edit. */}

## `cmake` [#cmake]

Callable singleton for the CMake toolchain — access as `hm.cmake`.

Call directly to construct a `CMakeProject`, or use the bare-form
action methods (`cmake.build()`, `cmake.test()`, etc.) for a
one-shot leaf.

```python
cmake(*, path='.', lang='c', image=None, base=None) -> CMakeProject
```

| Parameter                                        | Type           | Default | Description                                              |
| ------------------------------------------------ | -------------- | ------- | -------------------------------------------------------- |
| `path`                                           | `str`          | `'.'`   | Path to the project root (where `CMakeLists.txt` lives). |
| `lang`                                           | `str`          | `'c'`   | Language tag, either `"c"` or `"cpp"`. Affects label     |
| prefixes only; the cmake commands are identical. |                |         |                                                          |
| `image`                                          | `str \| None`  | `None`  | Local-mode Docker base image override.                   |
| `base`                                           | `Step \| None` | `None`  | Existing `Step` to attach to instead of emitting a fresh |
| apt-base step.                                   |                |         |                                                          |

**Returns** `CMakeProject` — A `CMakeProject` ready for action methods.

### `cmake.build()` [#cmakebuild]

```python
build(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

### `cmake.configure()` [#cmakeconfigure]

```python
configure(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

### `cmake.fmt()` [#cmakefmt]

```python
fmt(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

### `cmake.test()` [#cmaketest]

```python
test(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

## `CMakeEntry` [#cmakeentry]

Callable singleton for the CMake toolchain — access as `hm.cmake`.

Call directly to construct a `CMakeProject`, or use the bare-form
action methods (`cmake.build()`, `cmake.test()`, etc.) for a
one-shot leaf.

### `CMakeEntry.build()` [#cmakeentrybuild]

```python
build(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

### `CMakeEntry.configure()` [#cmakeentryconfigure]

```python
configure(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

### `CMakeEntry.fmt()` [#cmakeentryfmt]

```python
fmt(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

### `CMakeEntry.test()` [#cmakeentrytest]

```python
test(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

## `CMakeProject` [#cmakeproject]

CMake (C/C++) project install chain — constructed via `hm.cmake()`.

`installed` is the cmake-verify step. Action methods (`configure`,
`build`, `test`, `fmt`) attach leaves to `installed`.

### Fields [#fields]

| Field       | Type   | Default    |
| ----------- | ------ | ---------- |
| `path`      | `str`  | *required* |
| `installed` | `Step` | *required* |

### `CMakeProject.build()` [#cmakeprojectbuild]

```python
build(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

### `CMakeProject.configure()` [#cmakeprojectconfigure]

```python
configure(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

### `CMakeProject.fmt()` [#cmakeprojectfmt]

```python
fmt(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

### `CMakeProject.test()` [#cmakeprojecttest]

```python
test(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`
