find_package: additional test for checking the error message

This patch adds a test which checks the error message, which is
produced in the case that a Config file has set Foo_FOUND to FALSE
by itself.

Alex
This commit is contained in:
Alex Neundorf 2012-03-13 21:19:56 +01:00 committed by Brad King
parent 56ae3f9412
commit 0cf84472d7
4 changed files with 13 additions and 0 deletions

View File

@ -12,3 +12,4 @@ run_cmake(MissingConfigOneName)
run_cmake(MissingConfigRequired)
run_cmake(MissingConfigVersion)
run_cmake(MixedModeOptions)
run_cmake(SetFoundFALSE)

View File

@ -0,0 +1,9 @@
CMake Warning at SetFoundFALSE.cmake:2 \(find_package\):
Found package configuration file:
.*/Tests/RunCMake/find_package/SetFoundFALSEConfig.cmake
but it set SetFoundFALSE_FOUND to FALSE so package "SetFoundFALSE" is
considered to be NOT FOUND.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)

View File

@ -0,0 +1,2 @@
set(SetFoundFALSE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
find_package(SetFoundFALSE CONFIG)

View File

@ -0,0 +1 @@
set(SetFoundFALSE_FOUND FALSE)