diff options
author | Alex Neundorf <neundorf@kde.org> | 2010-08-31 19:10:00 (GMT) |
---|---|---|
committer | Alex Neundorf <neundorf@kde.org> | 2010-08-31 19:10:00 (GMT) |
commit | 5cdfc9c8ea675658c14d21848917f0e2d9ab93da (patch) | |
tree | 2c80cb6afc5c7f49df46eafecf56e5ae034d0ba7 /Source/cmFindPackageCommand.cxx | |
parent | 4969c3b5bbf929d3f59e98c90849a85aadb7351a (diff) | |
download | CMake-5cdfc9c8ea675658c14d21848917f0e2d9ab93da.zip CMake-5cdfc9c8ea675658c14d21848917f0e2d9ab93da.tar.gz CMake-5cdfc9c8ea675658c14d21848917f0e2d9ab93da.tar.bz2 |
Improve wording of the error message of find_package() in config-mode
As suggested by Brad, this improves the wording of the error message
in config-mode when config-files were found, but no suitable version.
The patch also contains the small loop-optimization suggested by Brad.
Alex
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r-- | Source/cmFindPackageCommand.cxx | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 8ee8fc7..55c7cb9 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -820,10 +820,12 @@ bool cmFindPackageCommand::HandlePackageMode() // have been found, but they didn't have appropriate versions. if (this->ConsideredConfigs.size() > 0) { - e << "Could not find configuration file for package " << this->Name - << " with " << (this->VersionExact ? "exact " : "at least ") - << "version " << this->Version << " .\n" - << "Found the following files:\n"; + e << "Could not find a configuration file for package \"" + << this->Name << "\" that " + << (this->VersionExact? "exactly matches" : "is compatible with") + << " requested version \"" << this->Version << "\".\n" + << "The following configuration files were considered but not " + "accepted:\n"; for(std::vector<ConfigFileInfo>::size_type i=0; i<this->ConsideredConfigs.size(); i++) { @@ -932,16 +934,15 @@ bool cmFindPackageCommand::HandlePackageMode() std::string consideredConfigFiles; std::string consideredVersions; + const char* sep = ""; for(std::vector<ConfigFileInfo>::size_type i=0; i<this->ConsideredConfigs.size(); i++) { - if (i>0) - { - consideredConfigFiles += ";"; - consideredVersions += ";"; - } + consideredConfigFiles += sep; + consideredVersions += sep; consideredConfigFiles += this->ConsideredConfigs[i].filename; consideredVersions += this->ConsideredConfigs[i].version; + sep = ";"; } this->Makefile->AddDefinition(consideredConfigsVar.c_str(), |