# CMakePresets: why not expand macros in name or inherits fields?

**URL:** https://discourse.cmake.org/t/cmakepresets-why-not-expand-macros-in-name-or-inherits-fields/8747
**Category:** Code
**Created:** [August 16, 2023, 1:44pm UTC](https://discourse.cmake.org/t/cmakepresets-why-not-expand-macros-in-name-or-inherits-fields/8747 "2023-08-16T13:44:33Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![ClausKlein](https://discourse.cmake.org/user_avatar/discourse.cmake.org/clausklein/32/352_2.png) [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)
#### Post date: [August 16, 2023, 1:44pm UTC](https://discourse.cmake.org/t/cmakepresets-why-not-expand-macros-in-name-or-inherits-fields/8747/1 "2023-08-16T13:44:33Z")

</div>

```json
{
    "version": 7,
    "cmakeMinimumRequired": {
        "major": 3,
        "minor": 27,
        "patch": 0
    },
    "configurePresets": [
        {
            "name": "default-config",
            "hidden": true,
            "generator": "Ninja",
            "cacheVariables": {
                "CMAKE_HOST_SYSTEM_PROCESSOR": "$penv{PROCESSOR_ARCHITECTURE}"
            },
            "environment": { "VARIANT": "MSVC" }
        },
        {
            "name": "$penv{CC}-config",
            "hidden": false,
            "inherits": "default-config",
            "cacheVariables": {
                "CMAKE_C_COMPILER": "$penv{CC}",
                "CMAKE_CXX_COMPILER": "$penv{CXX}"
            },
            "environment": { "VARIANT": "unknown" }
        },
        {
            "name": "clang-config",
            "hidden": true,
            "inherits": "default-config",
            "cacheVariables": {
                "CMAKE_C_COMPILER": "clang",
                "CMAKE_CXX_COMPILER": "clang++"
            },
            "environment": { "VARIANT": "Clang" }
        },
        {
            "name": "ninja-multi-vcpkg",
            "displayName": "Ninja Multi-Config",
            "description": "Configure with vcpkg toolchain and generate Ninja Multi-Config project files for all variants",
            "vendor": {
                "ClausKlein.de/CMake/1.0": {
                    "description": "FIXME: We need macro expansion here!",
                    "inherits": "$penv{CC}-config"
                }
            },
            "inherits": "default-config",
            "generator": "Ninja Multi-Config",
            "hidden": true,
            "cacheVariables": {
                "CMAKE_TOOLCHAIN_FILE": {
                    "type": "FILEPATH",
                    "value": "${sourceDir}/vcpkg/scripts/buildsystems/vcpkg.cmake"
                },
                "VCPKG_CHAINLOAD_TOOLCHAIN_FILE": {
                    "type": "FILEPATH",
                    "value": "${sourceDir}/toolchain/WindowsToolchain/Windows.$env{VARIANT}.toolchain.cmake"
                }
            }
        }
    ]
}

```

```auto
CXX=g++ CC=gcc cmake --list-presets
Available configure presets:

  "user-config"
  "gcc-debug" - gcc Debug
  "gcc-release" - gcc Release
  "clang-debug" - clang Debug
  "clang-release" - clang Release
  "$penv{CC}-config"

```

---

_[View the full topic](https://discourse.cmake.org/t/cmakepresets-why-not-expand-macros-in-name-or-inherits-fields/8747)._
