summaryrefslogtreecommitdiffstats
path: root/Source/cmFindPackageCommand.cxx
diff options
context:
space:
mode:
authorAlex Neundorf <neundorf@kde.org>2012-02-17 10:37:29 (GMT)
committerBrad King <brad.king@kitware.com>2012-02-28 14:58:31 (GMT)
commit6d8308314adbc3ff504b836b3989db9939de1e0b (patch)
tree33c63e6d90200849e132b4f9f00902d980f9706f /Source/cmFindPackageCommand.cxx
parent9c39bbd47420a74d50fab2b421baf630f13343ec (diff)
downloadCMake-6d8308314adbc3ff504b836b3989db9939de1e0b.zip
CMake-6d8308314adbc3ff504b836b3989db9939de1e0b.tar.gz
CMake-6d8308314adbc3ff504b836b3989db9939de1e0b.tar.bz2
find_package: mention requested version number in error message
When neither a Find-module or a config file can be found print the required version so the user knows which version of the package to install.
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r--Source/cmFindPackageCommand.cxx13
1 files changed, 11 insertions, 2 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 8e6debb..86eb2c8 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -962,6 +962,14 @@ bool cmFindPackageCommand::HandlePackageMode()
}
else
{
+ std::string requestedVersionString;
+ if(!this->Version.empty())
+ {
+ requestedVersionString = " (requested version ";
+ requestedVersionString += this->Version;
+ requestedVersionString += ")";
+ }
+
if (this->UseConfigFiles)
{
if(this->UseFindModules)
@@ -976,12 +984,13 @@ bool cmFindPackageCommand::HandlePackageMode()
{
e << "Could not find a package configuration file named \""
<< this->Configs[0] << "\" provided by package \""
- << this->Name << "\".\n";
+ << this->Name << "\"" << requestedVersionString <<".\n";
}
else
{
e << "Could not find a package configuration file provided by \""
- << this->Name << "\" with any of the following names:\n";
+ << 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)