summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-07-01 15:29:35 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-07-01 15:29:41 (GMT)
commit635a2525642c2e57b197a4a53b8457d6662daf14 (patch)
tree97b17739c156ab5295cb8de0e57a19cb74da14c5 /Source/cmMakefile.cxx
parenta10ca7f6679eb7a8c24127b5481de6dc4f2bbeb7 (diff)
parentef56eefc9bb9ae0ad23c80c01a3e15086dcf207e (diff)
downloadCMake-635a2525642c2e57b197a4a53b8457d6662daf14.zip
CMake-635a2525642c2e57b197a4a53b8457d6662daf14.tar.gz
CMake-635a2525642c2e57b197a4a53b8457d6662daf14.tar.bz2
Merge topic 'env-init-configs'
ef56eefc9b cmake: Allow CMAKE_CONFIGURATION_TYPES to be set by environment variable e216b9bbd3 cmake: Allow CMAKE_BUILD_TYPE to be set by environment variable 6986a382a9 Help: Document when CMAKE_BUILD_TYPE and CMAKE_CONFIGURATION_TYPES are set e96169a3ec Help: Cross-reference CMAKE_CONFIGURATION_TYPES from CMAKE_BUILD_TYPE 03bd9c4c10 cmMakefile: Add helper to initialize CMAKE_CONFIGURATION_TYPES Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6291
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index a2d64e2..f6ecf8e 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -3182,6 +3182,23 @@ void cmMakefile::RemoveVariablesInString(std::string& source,
}
}
+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", initConfigs,
+ "Semicolon separated list of supported configuration types, "
+ "only supports Debug, Release, MinSizeRel, and RelWithDebInfo, "
+ "anything else will be ignored.",
+ cmStateEnums::STRING);
+}
+
std::string cmMakefile::GetDefaultConfiguration() const
{
if (this->GetGlobalGenerator()->IsMultiConfig()) {