Merge topic 'find_package_fatal_error_if_required_and_config_not_found'

c5ae733 find_package: Test that REQUIRED aborts processing correctly
c91a54d find_package: error out if REQUIRED Config has not been found
This commit is contained in:
David Cole 2012-03-08 15:14:23 -05:00 committed by CMake Topic Stage
commit fa0f065426
13 changed files with 30 additions and 3 deletions

View File

@ -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())
{

View File

@ -11,3 +11,9 @@ CMake Warning at MissingConfig.cmake:1 \(find_package\):
been installed.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
CMake Warning at MissingConfig.cmake:2 \(message\):
This warning must be reachable.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)$

View File

@ -1 +1,2 @@
find_package(NotHere CONFIG)
message(WARNING "This warning must be reachable.")

View File

@ -10,4 +10,4 @@ CMake Error at MissingConfigRequired.cmake:1 \(find_package\):
"NotHere" provides a separate development package or SDK, be sure it has
been installed.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
CMakeLists.txt:3 \(include\)$

View File

@ -1 +1,2 @@
find_package(NotHere CONFIG REQUIRED)
message(FATAL_ERROR "This error must not be reachable.")

View File

@ -19,3 +19,8 @@ CMake Warning \(dev\) at MissingModule.cmake:1 \(find_package\):
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning at MissingModule.cmake:2 \(message\):
This warning must be reachable.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)$

View File

@ -1 +1,2 @@
find_package(NotHere MODULE)
message(WARNING "This warning must be reachable.")

View File

@ -18,4 +18,4 @@ CMake Warning \(dev\) at MissingModuleRequired.cmake:1 \(find_package\):
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.
This warning is for project developers. Use -Wno-dev to suppress it.$

View File

@ -1 +1,2 @@
find_package(NotHere MODULE REQUIRED)
message(FATAL_ERROR "This error must not be reachable.")

View File

@ -15,3 +15,9 @@ CMake Warning at MissingNormal.cmake:1 \(find_package\):
been installed.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
CMake Warning at MissingNormal.cmake:2 \(message\):
This warning must be reachable.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)$

View File

@ -1 +1,2 @@
find_package(NotHere)
message(WARNING "This warning must be reachable.")

View File

@ -14,4 +14,4 @@ CMake Error at MissingNormalRequired.cmake:1 \(find_package\):
"NotHere" provides a separate development package or SDK, be sure it has
been installed.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
CMakeLists.txt:3 \(include\)$

View File

@ -1 +1,2 @@
find_package(NotHere REQUIRED)
message(FATAL_ERROR "This error must not be reachable.")