summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-09-08 14:08:33 (GMT)
committerBrad King <brad.king@kitware.com>2008-09-08 14:08:33 (GMT)
commitd8bfafeff8087c90010053ba37b4072f23f36508 (patch)
tree7f97baed52c694372fa3f98a01ecdaa5d76da9ef
parent947521f437ca44939cfb55070a822310b2fbeba6 (diff)
downloadCMake-d8bfafeff8087c90010053ba37b4072f23f36508.zip
CMake-d8bfafeff8087c90010053ba37b4072f23f36508.tar.gz
CMake-d8bfafeff8087c90010053ba37b4072f23f36508.tar.bz2
ENH: Improve message for bad find_package call
Use the new-style error reporting mechanism to provide more context information for a find_package call with a bad package name. When the package is not required, issue a warning instead of an error.
-rw-r--r--Source/cmFindPackageCommand.cxx13
1 files changed, 3 insertions, 10 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index f8ec695..d60acea 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -699,7 +699,7 @@ bool cmFindPackageCommand::HandlePackageMode()
{
// The variable is not set.
cmOStringStream e;
- e << "could not find ";
+ e << "Could not find ";
if(!this->NoModule)
{
e << "module Find" << this->Name << ".cmake or ";
@@ -729,15 +729,8 @@ bool cmFindPackageCommand::HandlePackageMode()
e << " " << *ci << "\n";
}
}
- if(this->Required)
- {
- this->SetError(e.str().c_str());
- result = false;
- }
- else
- {
- cmSystemTools::Error("find_package ", e.str().c_str());
- }
+ this->Makefile->IssueMessage(
+ this->Required? cmake::FATAL_ERROR : cmake::WARNING, e.str());
}
// Set a variable marking whether the package was found.