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
This commit is contained in:
Brad King
2021-06-29 13:34:28 -04:00
parent 6986a382a9
commit e216b9bbd3
10 changed files with 49 additions and 2 deletions
+10
View File
@@ -0,0 +1,10 @@
CMAKE_BUILD_TYPE
----------------
.. versionadded:: 3.22
.. include:: ENV_VAR.txt
The ``CMAKE_BUILD_TYPE`` environment variable specifies a default value
for the :variable:`CMAKE_BUILD_TYPE` variable when there is no explicit
configuration given on the first run while creating a new build tree.