# Generator property in presets

**URL:** https://discourse.cmake.org/t/generator-property-in-presets/3010
**Category:** Usage
**Created:** [March 25, 2021, 3:06am UTC](https://discourse.cmake.org/t/generator-property-in-presets/3010 "2021-03-25T03:06:09Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![friendlyanon](https://discourse.cmake.org/user_avatar/discourse.cmake.org/friendlyanon/32/970_2.png) [@friendlyanon](https://discourse.cmake.org/u/friendlyanon)
#### Post date: [March 25, 2021, 3:06am UTC](https://discourse.cmake.org/t/generator-property-in-presets/3010/1 "2021-03-25T03:06:09Z")

</div>

I figured this would be better as a discource than an issue.

Why is the `generator` property in the presets mandatory? This reduces the usability of presets and makes it difficult replace shell or other scripts to configure a project that does not care about which generator is in use, but still wants to have a set of common cache variables in.

Let’s assume that I have 10 CI workflows with 10 different build systems across 3 OS platforms. Now I either copy paste the preset that contains a bunch of cache variables for each CI workflow and make it more difficult if those variables need to be modified, or do the same but with `inherits` and still get a lot of repetition, or create scripts to invoke CMake with just to pass those cache variables with automatic generator recognition.

If presets allowed leaving the `generator` property out and instead CMake looked for a default one like it normally does, then a single preset could support any platform and those commonly used cache variables could be nicely bundled up in a preset.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [March 25, 2021, 6:22pm UTC](https://discourse.cmake.org/t/generator-property-in-presets/3010/2 "2021-03-25T18:22:02Z")

</div>

@kyle.edwards?

---

<div class="post-metadata">

### Author: ![kyle.edwards](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/k/65b543/32.png) [@kyle.edwards](https://discourse.cmake.org/u/kyle.edwards)
#### Post date: [March 25, 2021, 6:32pm UTC](https://discourse.cmake.org/t/generator-property-in-presets/3010/3 "2021-03-25T18:32:19Z")

</div>

This is left over from when we were originally trying to replicate `CMakeSettings.json` from Visual Studio, which required the build directory and generator. We could probably make it optional for version `3`.
