From c91a54db3766aea8f8ab9d5a011db3bba67b12d4 Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Tue, 6 Mar 2012 21:16:24 +0100 Subject: [PATCH] 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 --- Source/cmFindPackageCommand.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 917716272..f8139f902 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -1062,6 +1062,10 @@ bool cmFindPackageCommand::HandlePackageMode() this->Makefile->IssueMessage( this->Required? cmake::FATAL_ERROR : cmake::WARNING, e.str()); + if (this->Required) + { + cmSystemTools::SetFatalErrorOccured(); + } if (!aw.str().empty()) {