# Where did \`--generate\` come from, and where did it go?

**URL:** https://discourse.cmake.org/t/where-did-generate-come-from-and-where-did-it-go/3057
**Category:** Usage
**Created:** [March 31, 2021, 6:18pm UTC](https://discourse.cmake.org/t/where-did-generate-come-from-and-where-did-it-go/3057 "2021-03-31T18:18:58Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Chris](https://discourse.cmake.org/user_avatar/discourse.cmake.org/chris/32/470_2.png) [@Chris](https://discourse.cmake.org/u/Chris)
#### Post date: [March 31, 2021, 6:18pm UTC](https://discourse.cmake.org/t/where-did-generate-come-from-and-where-did-it-go/3057/1 "2021-03-31T18:18:58Z")

</div>

I have some local build utility scripts that I use to keep different generates updated. Somehow, I wound up with this:

```
cmake --generate _ninja
cmake --generate _vs

```

As a way to make sure local `CMakeLists.txt` changes are reflected in my projects.

This works fine on CMake 3.19.7, but updating to 3.20.0 appears to have removed this flag. I tried searching for more context on this and cannot find anything online that suggests this flag even exists. I tried Release Notes, `--help`, and grepping the CMake code on GitHub. No dice.

Was this an internal CLI flag? Where did it go? I’m fine adjusting my scripts but I’m frustrated that:

1. Used an internal/unstable flag by accident for so long
2. Cannot find any reference to it anywhere. Where in the CMake code was this defined?!

Any guidance is appreciated. Thanks!

---

<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 31, 2021, 6:51pm UTC](https://discourse.cmake.org/t/where-did-generate-come-from-and-where-did-it-go/3057/2 "2021-03-31T18:51:23Z")

</div>

`--generate` was never a CMake flag. It was never in the documentation. It “worked” before because CMake silently ignored `-` arguments that it didn’t recognize. Starting with CMake 3.20, such arguments are now an error.

Are `_ninja` and `_vs` build directories? Source directories?

---

<div class="post-metadata">

### Author: ![Chris](https://discourse.cmake.org/user_avatar/discourse.cmake.org/chris/32/470_2.png) [@Chris](https://discourse.cmake.org/u/Chris)
#### Post date: [March 31, 2021, 6:57pm UTC](https://discourse.cmake.org/t/where-did-generate-come-from-and-where-did-it-go/3057/3 "2021-03-31T18:57:45Z")

</div>

Yes, they are build directories. Made the usual way: `cmake -B _ninja -G Ninja`, etc.

> It “worked” before because CMake silently ignored

… that makes sense, and now I just feel silly. This is a good improvement in 3.20, and explains why I couldn’t find any references to it.

Thanks!

---

<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 31, 2021, 6:59pm UTC](https://discourse.cmake.org/t/where-did-generate-come-from-and-where-did-it-go/3057/4 "2021-03-31T18:59:16Z")

</div>

Cc: @robert.maynard
