summaryrefslogtreecommitdiffstats
path: root/Help/variable
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-06-29 17:34:28 (GMT)
committerBrad King <brad.king@kitware.com>2021-06-30 14:55:40 (GMT)
commite216b9bbd331e77e59634690a2be98f087acaf2c (patch)
treebbbb4bc6d552751772045ad3993dba2ba70b8536 /Help/variable
parent6986a382a912f4b982f4b20a6e04ff1d773ef1eb (diff)
downloadCMake-e216b9bbd331e77e59634690a2be98f087acaf2c.zip
CMake-e216b9bbd331e77e59634690a2be98f087acaf2c.tar.gz
CMake-e216b9bbd331e77e59634690a2be98f087acaf2c.tar.bz2
cmake: Allow CMAKE_BUILD_TYPE to be set by environment variable
When no `CMAKE_BUILD_TYPE` is explicitly specified while creating a new build tree, check for an environment variable of the same name. Issue: #20983
Diffstat (limited to 'Help/variable')
-rw-r--r--Help/variable/CMAKE_BUILD_TYPE.rst5
1 files changed, 3 insertions, 2 deletions
diff --git a/Help/variable/CMAKE_BUILD_TYPE.rst b/Help/variable/CMAKE_BUILD_TYPE.rst
index b29678a..9ad1481 100644
--- a/Help/variable/CMAKE_BUILD_TYPE.rst
+++ b/Help/variable/CMAKE_BUILD_TYPE.rst
@@ -26,8 +26,9 @@ value of ``CMAKE_BUILD_TYPE`` will be ``ReLeAsE``.
This variable is initialized by the first :command:`project` or
:command:`enable_language` command called in a project when a new build
-tree is first created. A toolchain-specific default is chosen when a
-language is enabled.
+tree is first created. If the :envvar:`CMAKE_BUILD_TYPE` environment
+variable is set, its value is used. Otherwise, a toolchain-specific
+default is chosen when a language is enabled.
See :variable:`CMAKE_CONFIGURATION_TYPES` for specifying the configuration
with multi-config generators.