# How to determine build type?

**URL:** https://discourse.cmake.org/t/how-to-determine-build-type/15200
**Category:** Usage
**Tags:** gen:xcode
**Created:** [September 28, 2025, 7:43am UTC](https://discourse.cmake.org/t/how-to-determine-build-type/15200 "2025-09-28T07:43:45Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![alexandr](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/71c47a/32.png) [@alexandr](https://discourse.cmake.org/u/alexandr)
#### Post date: [September 28, 2025, 7:43am UTC](https://discourse.cmake.org/t/how-to-determine-build-type/15200/1 "2025-09-28T07:43:45Z")

</div>

Hello all!

My CMake project is for iOS and using XCode generator. For now there are troubles with getting build type. The command that calling CMake is:

```auto
cmake --build /Project/build/iOS_Simulator --target ALL_BUILD --config Release

```

```auto
cmake --build /Project/build/iOS_Simulator --target ALL_BUILD --config Debug

```

How to determine value of the parameter “config“ inside of CMake file? Need to know which type of configs is using Debug or Release.

---

<div class="post-metadata">

### Author: ![marc.chevrier](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@marc.chevrier](https://discourse.cmake.org/u/marc.chevrier)
#### Post date: [September 28, 2025, 12:54pm UTC](https://discourse.cmake.org/t/how-to-determine-build-type/15200/2 "2025-09-28T12:54:15Z")

</div>

The `config` cannot be known at configure time because it is specified only at build time.

So, the only way to know what is the current config is to use the generator expression [`$<CONFIG>`](https://cmake.org/cmake/help/latest/manual/cmake-generator-expressions.7.html#configuration-expressions) and the various variants.
