diff options
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r-- | Source/cmFindPackageCommand.cxx | 33 |
1 files changed, 5 insertions, 28 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 7746980..26bd4b9 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -329,10 +329,7 @@ bool cmFindPackageCommand { std::ostringstream e; e << "called with components that are both required and optional:\n"; - for(unsigned int i=0; i<doubledComponents.size(); ++i) - { - e << " " << doubledComponents[i] << "\n"; - } + e << cmWrap(" ", doubledComponents, "", "\n") << "\n"; this->SetError(e.str()); return false; } @@ -808,13 +805,8 @@ bool cmFindPackageCommand::HandlePackageMode() { e << "Could not find a package configuration file provided by \"" << this->Name << "\"" << requestedVersionString - << " with any of the following names:\n"; - for(std::vector<std::string>::const_iterator ci = - this->Configs.begin(); - ci != this->Configs.end(); ++ci) - { - e << " " << *ci << "\n"; - } + << " with any of the following names:\n" + << cmWrap(" ", this->Configs, "", "\n") << "\n"; } e << "Add the installation prefix of \"" << this->Name << "\" to " @@ -1064,26 +1056,11 @@ void cmFindPackageCommand::AppendToFoundProperty(bool found) } - std::string tmp; - const char* sep =""; - for(size_t i=0; i<foundContents.size(); i++) - { - tmp += sep; - tmp += foundContents[i]; - sep = ";"; - } - + std::string tmp = cmJoin(foundContents, ";"); this->Makefile->GetCMakeInstance()->SetProperty("PACKAGES_FOUND", tmp.c_str()); - tmp = ""; - sep = ""; - for(size_t i=0; i<notFoundContents.size(); i++) - { - tmp += sep; - tmp += notFoundContents[i]; - sep = ";"; - } + tmp = cmJoin(notFoundContents, ";"); this->Makefile->GetCMakeInstance()->SetProperty("PACKAGES_NOT_FOUND", tmp.c_str()); } |