diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-02-18 22:50:36 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-02-20 20:35:58 (GMT) |
commit | 37b88d348a20921c835ce7aa99f6db62271503a7 (patch) | |
tree | 96259ea4c15995957740dfbf421ebed066cb221f /Source/cmGlobalGenerator.cxx | |
parent | a281809384cc19cc9a7d1726b243020b380b9395 (diff) | |
download | CMake-37b88d348a20921c835ce7aa99f6db62271503a7.zip CMake-37b88d348a20921c835ce7aa99f6db62271503a7.tar.gz CMake-37b88d348a20921c835ce7aa99f6db62271503a7.tar.bz2 |
cmAlgorithms: Add cmWrap.
Port some existing cmJoin to use it.
cmJoin is cumbersome to use in cases where the objective is to
somehow 'quote' each item and then join it with a separator. In that
case, the joiner string is harder to read and reason about. cmWrap
aims to solve that.
Provide an overload taking char wrappers to simplify the case
of surrounding every element in quotes without needing to escape
the quote character.
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index ac4489a..93692f6 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -2295,15 +2295,8 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) std::ostringstream ostr; if (!componentsSet->empty()) { - ostr << "Available install components are:"; - std::set<std::string>::iterator it; - for ( - it = componentsSet->begin(); - it != componentsSet->end(); - ++ it ) - { - ostr << " \"" << *it << "\""; - } + ostr << "Available install components are: "; + ostr << cmWrap('"', *componentsSet, '"', " "); } else { |