summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-06-29 20:58:16 (GMT)
committerBrad King <brad.king@kitware.com>2021-06-30 14:55:40 (GMT)
commitef56eefc9bb9ae0ad23c80c01a3e15086dcf207e (patch)
tree274a1fe332a115cc18061c7c026e367a75c63226 /Source/cmMakefile.cxx
parente216b9bbd331e77e59634690a2be98f087acaf2c (diff)
downloadCMake-ef56eefc9bb9ae0ad23c80c01a3e15086dcf207e.zip
CMake-ef56eefc9bb9ae0ad23c80c01a3e15086dcf207e.tar.gz
CMake-ef56eefc9bb9ae0ad23c80c01a3e15086dcf207e.tar.bz2
cmake: Allow CMAKE_CONFIGURATION_TYPES to be set by environment variable
When no `CMAKE_CONFIGURATION_TYPES` is explicitly specified while creating a new build tree, check for an environment variable of the same name. Issue: #20983
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 120cae7..3c4e9cd 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -3187,8 +3187,12 @@ void cmMakefile::InitCMAKE_CONFIGURATION_TYPES(std::string const& genDefault)
if (this->GetDefinition("CMAKE_CONFIGURATION_TYPES")) {
return;
}
+ std::string initConfigs;
+ if (!cmSystemTools::GetEnv("CMAKE_CONFIGURATION_TYPES", initConfigs)) {
+ initConfigs = genDefault;
+ }
this->AddCacheDefinition(
- "CMAKE_CONFIGURATION_TYPES", genDefault,
+ "CMAKE_CONFIGURATION_TYPES", initConfigs,
"Semicolon separated list of supported configuration types, "
"only supports Debug, Release, MinSizeRel, and RelWithDebInfo, "
"anything else will be ignored.",