Workflow presets not working in CMakeUserPresets

Has anyone had success getting workflow presets to work in CMakeUserPresets?

If I just include a single configure step, it works fine:

{
  "version": 6,
  "cmakeMinimumRequired": {
    "major": 3,
    "minor": 25,
    "patch": 0
  },
  "configurePresets": [
    {
      "name": "my-v140-x64-RelWithDebInfo-configure",
      "inherits": "v140-x64-RelWithDebInfo",
      "binaryDir": "C:/my-build",
      "installDir": "C:/my-install"
    }
  ],
  "buildPresets": [
    {
      "name": "my-v140-x64-RelWithDebInfo-build",
      "inherits": "v140-x64-RelWithDebInfo"
    }
  ],
  "workflowPresets": [
    {
      "name": "foo",
      "steps": [
        {
          "type": "configure",
          "name": "my-v140-x64-RelWithDebInfo-configure"
        }
      ]
    }
  ]
}

But if I add a build step, cmake then complains that the configure step is invalid:

{
  "version": 6,
  "cmakeMinimumRequired": {
    "major": 3,
    "minor": 25,
    "patch": 0
  },
  "configurePresets": [
    {
      "name": "my-v140-x64-RelWithDebInfo-configure",
      "inherits": "v140-x64-RelWithDebInfo",
      "binaryDir": "C:/my-build",
      "installDir": "C:/my-install"
    }
  ],
  "buildPresets": [
    {
      "name": "my-v140-x64-RelWithDebInfo-build",
      "inherits": "v140-x64-RelWithDebInfo"
    }
  ],
  "workflowPresets": [
    {
      "name": "foo",
      "steps": [
        {
          "type": "configure",
          "name": "my-v140-x64-RelWithDebInfo-configure"
        },
        {
          "type": "build",
          "name": "my-v140-x64-RelWithDebInfo-build"
        }
      ]
    }
  ]
}
>"\Program Files\CMake\bin\cmake.exe" --workflow --preset foo
CMake Error: Could not read presets from XXXXXX:
Invalid workflow step "my-v140-x64-RelWithDebInfo-configure"

I am using CMake 3.27.4.

Your build preset is invalid. The inherits field in a build preset can only list other build presets. The configurePreset field is how you specify which configure preset a build preset is associated with. A build preset must have a configurePreset field, or one of the build presets it inherits from must have it.

EDIT: Ah, wait, I think you’ve only shown your CMakeUserPresets.json file and not your CMakePresets.json file. Maybe if you showed both, that may help uncover further details.

see cmake_template/CMakeUserPresets.json at feature/add-workflow-presets · ClausKlein/cmake_template · GitHub
and cmake_template/CMakePresets.json at feature/add-workflow-presets · ClausKlein/cmake_template · GitHub