diff options
author | Brad King <brad.king@kitware.com> | 2010-09-08 18:54:49 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2010-09-08 18:54:49 (GMT) |
commit | b06fb1668424514bf45794d40bfc9f88dd5d619c (patch) | |
tree | 66ae0b807e08cf844b9786624ce441f5563f7a8c /Source/cmMakefile.cxx | |
parent | f444b9555f87ec187bff51d48cd29c22ab4a6121 (diff) | |
download | CMake-b06fb1668424514bf45794d40bfc9f88dd5d619c.zip CMake-b06fb1668424514bf45794d40bfc9f88dd5d619c.tar.gz CMake-b06fb1668424514bf45794d40bfc9f88dd5d619c.tar.bz2 |
No CMAKE_CONFIGURATION_TYPES in single-config generators (#10202)
Factor out reading of CMAKE_CONFIGURATION_TYPES and CMAKE_BUILD_TYPE
into cmMakefile::GetConfigurations. Read the former only in
multi-config generators.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 8eece6b..c64053a 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1436,16 +1436,7 @@ void cmMakefile::InitializeFromParent() this->SetProperty("COMPILE_DEFINITIONS", parent->GetProperty("COMPILE_DEFINITIONS")); std::vector<std::string> configs; - if(const char* configTypes = - this->GetDefinition("CMAKE_CONFIGURATION_TYPES")) - { - cmSystemTools::ExpandListArgument(configTypes, configs); - } - else if(const char* buildType = - this->GetDefinition("CMAKE_BUILD_TYPE")) - { - configs.push_back(buildType); - } + this->GetConfigurations(configs); for(std::vector<std::string>::const_iterator ci = configs.begin(); ci != configs.end(); ++ci) { @@ -2367,6 +2358,31 @@ void cmMakefile::AddDefaultDefinitions() cmake::GetCMakeFilesDirectory()); } +//---------------------------------------------------------------------------- +const char* +cmMakefile::GetConfigurations(std::vector<std::string>& configs, + bool single) const +{ + if(this->LocalGenerator->GetGlobalGenerator()->IsMultiConfig()) + { + if(const char* configTypes = + this->GetDefinition("CMAKE_CONFIGURATION_TYPES")) + { + cmSystemTools::ExpandListArgument(configTypes, configs); + } + return 0; + } + else + { + const char* buildType = this->GetDefinition("CMAKE_BUILD_TYPE"); + if(single && buildType && *buildType) + { + configs.push_back(buildType); + } + return buildType; + } +} + #if defined(CMAKE_BUILD_WITH_CMAKE) /** * Find a source group whose regular expression matches the filename |