# About --list-presets and 'condition'

**URL:** https://discourse.cmake.org/t/about-list-presets-and-condition/15767
**Category:** Development
**Created:** [July 31, 2026, 3:22pm UTC](https://discourse.cmake.org/t/about-list-presets-and-condition/15767 "2026-07-31T15:22:18Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![maximilian-tech](https://discourse.cmake.org/user_avatar/discourse.cmake.org/maximilian-tech/32/6201_2.png) [@maximilian-tech](https://discourse.cmake.org/u/maximilian-tech)
#### Post date: [July 31, 2026, 3:22pm UTC](https://discourse.cmake.org/t/about-list-presets-and-condition/15767/1 "2026-07-31T15:22:18Z")

</div>

Consider the following `CMakePresets.json` file:

```json
{
  "version": 6,
  "configurePresets":[
  {
    "name":"c1",
    "condition": {
      "type": "equals",
      "lhs": "$env{ __UNFULLFILLED__ }",
      "rhs": "set_value"
    }
  },
  {
    "name": "c2"
  }],
  "workflowPresets": [
  {
    "name": "p1",
      "steps": [
        { "type": "configure", "name": "c1" }
      ]
    },
    {
      "name": "p2",
      "steps": [
        { "type": "configure", "name": "c2" }
      ]
    }
  ]
}

```

The ‘condition’ correctly masks the `c1` configure preset.

```auto
$ cmake --list-presets=all
Available configure presets:

  "c2"

Available workflow presets:

  "p1"
  "p2"

```

But the workflow preset `p1`, is visible, but actually also disabled:

```auto
$ cmake --workflow --preset p1
CMake Error: Cannot use disabled configure preset in /home/max/tests/cmake_presets: "c1"￼``  

```

There also is also no way to see all presets and their state and reason, why they might be disabled.

I think it could be improved two-fold:

1. only show presets actually available (e.g. hide ‘p1’ workflow in this case)
2. add another option (–list-all-presets | --list-presets=all-defined ?? ) to show reason of unavailability.

```bash
$ cmake --list-presets=all
Available configure presets:

  "c2"

Available workflow presets:

  "p2"

$ cmake --list-presets=all-defined
All configure presets:

  "c1" - Unavailable: condition evaluated to false: {"lhs":"$env{ __UNFULLFILLED__ }","rhs":"set_value","type":"equals"}
  "c2"

All workflow presets:

  "p1" - Unavailable: step 1: configure preset "c1": condition evaluated to false: {"lhs":"$env{ __UNFULLFILLED__ }","rhs":"set_value","type":"equals"}
  "p2"

```

So the questions are

- Shall workflows also be hidden if they are disabled?
- What is a good cli argument to show all workflows and why they are not available?

Im am looking forward to your feedback!

---

<div class="post-metadata">

### Author: ![maximilian-tech](https://discourse.cmake.org/user_avatar/discourse.cmake.org/maximilian-tech/32/6201_2.png) [@maximilian-tech](https://discourse.cmake.org/u/maximilian-tech)
#### Post date: [August 4, 2026, 4:37pm UTC](https://discourse.cmake.org/t/about-list-presets-and-condition/15767/2 "2026-08-04T16:37:47Z")

</div>

Continued in [https://gitlab.kitware.com/cmake/cmake/-/work\_items/28016](https://gitlab.kitware.com/cmake/cmake/-/work_items/28016)
