CMAKE_BUILD_TYPE — CMake 4.0.1 Documentation

# CMAKE_BUILD_TYPE

Specifies the build type on single-configuration generators (e.g. Makefile Generators or `Ninja`). Typical values include `Debug`, `Release`, `RelWithDebInfo` and `MinSizeRel`, but custom build types can also be defined.

This variable is initialized by the first `project()` or `enable_language()` command called in a project when a new build tree is first created. If the `CMAKE_BUILD_TYPE` environment variable is set, its value is used. Otherwise, a toolchain-specific default is chosen when a language is enabled. The default value is often an empty string, but this is usually not desirable and one of the other standard build types is usually more appropriate.

Depending on the situation, the value of this variable may be treated case-sensitively or case-insensitively. See Build Configurations for discussion of this and other related topics.

For multi-config generators, see `CMAKE_CONFIGURATION_TYPES`.