# Detect presence of multi-config generators

**URL:** https://discourse.cmake.org/t/detect-presence-of-multi-config-generators/6987
**Category:** Code
**Created:** [November 30, 2022, 2:40pm UTC](https://discourse.cmake.org/t/detect-presence-of-multi-config-generators/6987 "2022-11-30T14:40:36Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![eriols](https://discourse.cmake.org/user_avatar/discourse.cmake.org/eriols/32/945_2.png) [@eriols](https://discourse.cmake.org/u/eriols)
#### Post date: [November 30, 2022, 2:40pm UTC](https://discourse.cmake.org/t/detect-presence-of-multi-config-generators/6987/1 "2022-11-30T14:40:36Z")

</div>

If I have multi-config generators there are some configs I would like to remove for performance reasons I read about [here](https://discourse.cmake.org/t/why-is-cmake-on-linux-so-much-faster-than-on-windows/1918), what’s the best way to do this?  
I.e. at what stage can I expect the `GENERATOR_IS_MULTI_CONFIG` to be set? Naively tried at the top of a project but even on eg MacOS it was not set then. Thanks!

---

<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: [November 30, 2022, 8:12pm UTC](https://discourse.cmake.org/t/detect-presence-of-multi-config-generators/6987/2 "2022-11-30T20:12:18Z")

</div>

It’s a property, not a variable:

```cmake
get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
# use `is_multi_config`

```

---

<div class="post-metadata">

### Author: ![eriols](https://discourse.cmake.org/user_avatar/discourse.cmake.org/eriols/32/945_2.png) [@eriols](https://discourse.cmake.org/u/eriols)
#### Post date: [November 30, 2022, 8:19pm UTC](https://discourse.cmake.org/t/detect-presence-of-multi-config-generators/6987/3 "2022-11-30T20:19:41Z")

</div>

Thanks, yes should have stated that I’ve gotten so far. I just don’t see it ever kicking in for my Xcode or VS builds, so that’s where I’m confused.  
It seems like just hard-coding the `CMAKE_CONFIGURATION_TYPES` to the types I use has a positive impact on the configuration time, so would just like to have that soft-coded instead.

---

<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: [November 30, 2022, 8:23pm UTC](https://discourse.cmake.org/t/detect-presence-of-multi-config-generators/6987/4 "2022-11-30T20:23:15Z")

</div>

What version of CMake are you using? Note that it’s new in 3.9. That seems older than most would use, but it’s the first thing to check…

---

<div class="post-metadata">

### Author: ![eriols](https://discourse.cmake.org/user_avatar/discourse.cmake.org/eriols/32/945_2.png) [@eriols](https://discourse.cmake.org/u/eriols)
#### Post date: [November 30, 2022, 8:28pm UTC](https://discourse.cmake.org/t/detect-presence-of-multi-config-generators/6987/5 "2022-11-30T20:28:32Z")

</div>

Yes sorry, it’s 3.16.3, and looks like this:

```auto
cmake_minimum_required(VERSION 3.15.4)
project(myproj)
get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if (is_multi_config)
	message(STATUS "is multiconfig")
else()
	message(STATUS "not multiconfig")
endif()

```

---

<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: [November 30, 2022, 8:34pm UTC](https://discourse.cmake.org/t/detect-presence-of-multi-config-generators/6987/6 "2022-11-30T20:34:05Z")

</div>

That’s really strange… Probably worth an issue AFAICT from that code.

---

<div class="post-metadata">

### Author: ![eriols](https://discourse.cmake.org/user_avatar/discourse.cmake.org/eriols/32/945_2.png) [@eriols](https://discourse.cmake.org/u/eriols)
#### Post date: [November 30, 2022, 9:04pm UTC](https://discourse.cmake.org/t/detect-presence-of-multi-config-generators/6987/7 "2022-11-30T21:04:43Z")

</div>

Thanks - probably something stupid I do anyway. I hope to upgrade cmake quite soon so can test then again (I can’t test these locally alas).
