Commit fa0f0654 authored by David Cole's avatar David Cole Committed by Kitware Robot

Merge topic 'find_package_fatal_error_if_required_and_config_not_found'

c5ae7331 find_package: Test that REQUIRED aborts processing correctly
c91a54db find_package: error out if REQUIRED Config has not been found
parents da43d8fa c5ae7331
......@@ -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())
{
......
......@@ -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\)$
find_package(NotHere CONFIG)
message(WARNING "This warning must be reachable.")
......@@ -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\)$
find_package(NotHere CONFIG REQUIRED)
message(FATAL_ERROR "This error must not be reachable.")
......@@ -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\)$
find_package(NotHere MODULE)
message(WARNING "This warning must be reachable.")
......@@ -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.$
find_package(NotHere MODULE REQUIRED)
message(FATAL_ERROR "This error must not be reachable.")
......@@ -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\)$
find_package(NotHere)
message(WARNING "This warning must be reachable.")
......@@ -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\)$
find_package(NotHere REQUIRED)
message(FATAL_ERROR "This error must not be reachable.")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment