find_package: error out if REQUIRED Config has not been found

If in Config mode a configuration file could not be found, cmake printed
an error, but did not actually stop processing. With SetFatalErrorOccured
it does.

Alex
This commit is contained in:
Alex Neundorf 2012-03-06 21:16:24 +01:00
parent ec50093be7
commit c91a54db37
1 changed files with 4 additions and 0 deletions

View File

@ -1062,6 +1062,10 @@ bool cmFindPackageCommand::HandlePackageMode()
this->Makefile->IssueMessage( this->Makefile->IssueMessage(
this->Required? cmake::FATAL_ERROR : cmake::WARNING, e.str()); this->Required? cmake::FATAL_ERROR : cmake::WARNING, e.str());
if (this->Required)
{
cmSystemTools::SetFatalErrorOccured();
}
if (!aw.str().empty()) if (!aw.str().empty())
{ {