Merge topic 'find_package_fatal_error_if_required_and_config_not_found'
c5ae733
find_package: Test that REQUIRED aborts processing correctlyc91a54d
find_package: error out if REQUIRED Config has not been found
This commit is contained in:
commit
fa0f065426
|
@ -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())
|
||||||
{
|
{
|
||||||
|
|
|
@ -11,3 +11,9 @@ CMake Warning at MissingConfig.cmake:1 \(find_package\):
|
||||||
been installed.
|
been installed.
|
||||||
Call Stack \(most recent call first\):
|
Call Stack \(most recent call first\):
|
||||||
CMakeLists.txt:3 \(include\)
|
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\)$
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
find_package(NotHere CONFIG)
|
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
|
"NotHere" provides a separate development package or SDK, be sure it has
|
||||||
been installed.
|
been installed.
|
||||||
Call Stack \(most recent call first\):
|
Call Stack \(most recent call first\):
|
||||||
CMakeLists.txt:3 \(include\)
|
CMakeLists.txt:3 \(include\)$
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
find_package(NotHere CONFIG REQUIRED)
|
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\):
|
Call Stack \(most recent call first\):
|
||||||
CMakeLists.txt:3 \(include\)
|
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.
|
||||||
|
|
||||||
|
CMake Warning at MissingModule.cmake:2 \(message\):
|
||||||
|
This warning must be reachable.
|
||||||
|
Call Stack \(most recent call first\):
|
||||||
|
CMakeLists.txt:3 \(include\)$
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
find_package(NotHere MODULE)
|
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\):
|
Call Stack \(most recent call first\):
|
||||||
CMakeLists.txt:3 \(include\)
|
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.$
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
find_package(NotHere MODULE REQUIRED)
|
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.
|
been installed.
|
||||||
Call Stack \(most recent call first\):
|
Call Stack \(most recent call first\):
|
||||||
CMakeLists.txt:3 \(include\)
|
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\)$
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
find_package(NotHere)
|
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
|
"NotHere" provides a separate development package or SDK, be sure it has
|
||||||
been installed.
|
been installed.
|
||||||
Call Stack \(most recent call first\):
|
Call Stack \(most recent call first\):
|
||||||
CMakeLists.txt:3 \(include\)
|
CMakeLists.txt:3 \(include\)$
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
find_package(NotHere REQUIRED)
|
find_package(NotHere REQUIRED)
|
||||||
|
message(FATAL_ERROR "This error must not be reachable.")
|
||||||
|
|
Loading…
Reference in New Issue