summaryrefslogtreecommitdiff
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorVitaly Stakhovsky <vvs31415@gitlab.org>2020-05-30 08:00:00 -0400
committerVitaly Stakhovsky <vvs31415@gitlab.org>2020-05-30 08:59:20 -0400
commit7ed8c9ebe33ccafc41ec9e096bf2884d617a0ebf (patch)
treeb17167b762c3257baf362b515fbf1a8fece7b356 /Source/cmMakefile.cxx
parent6bb20b51c9af40372b6a818826613e965cde5f19 (diff)
downloadcmake-7ed8c9ebe33ccafc41ec9e096bf2884d617a0ebf.tar.gz
cmMakefile: add GetDefExpandList() that splits value into std::vector
Combines cmMakefile:GetDefinition() and cmExpandList()
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx17
1 files changed, 13 insertions, 4 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 154da50520..c527a4917c 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -2745,6 +2745,18 @@ const std::string& cmMakefile::GetSafeDefinition(const std::string& name) const
return *def;
}
+bool cmMakefile::GetDefExpandList(const std::string& name,
+ std::vector<std::string>& out,
+ bool emptyArgs) const
+{
+ cmProp def = this->GetDef(name);
+ if (!def) {
+ return false;
+ }
+ cmExpandList(*def, out, emptyArgs);
+ return true;
+}
+
std::vector<std::string> cmMakefile::GetDefinitions() const
{
std::vector<std::string> res = this->StateSnapshot.ClosureKeys();
@@ -3273,10 +3285,7 @@ std::string cmMakefile::GetConfigurations(std::vector<std::string>& configs,
bool singleConfig) const
{
if (this->GetGlobalGenerator()->IsMultiConfig()) {
- if (const char* configTypes =
- this->GetDefinition("CMAKE_CONFIGURATION_TYPES")) {
- cmExpandList(configTypes, configs);
- }
+ this->GetDefExpandList("CMAKE_CONFIGURATION_TYPES", configs);
return "";
}
const std::string& buildType = this->GetSafeDefinition("CMAKE_BUILD_TYPE");