mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-07 22:59:56 -05:00
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
This commit is contained in:
@@ -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.",
|
||||
|
||||
Reference in New Issue
Block a user