diff options
author | Alex Neundorf <neundorf@kde.org> | 2012-03-18 18:15:42 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-03-19 14:53:36 (GMT) |
commit | b15c0b418bc1239cfea1c605603e61c74023a8fb (patch) | |
tree | c86fd7b121a01226927e6e7d61e9454aff5e7d7e /Tests | |
parent | 34108cd3b3bf992c0e77ae604125cb73e023f6a8 (diff) | |
download | CMake-b15c0b418bc1239cfea1c605603e61c74023a8fb.zip CMake-b15c0b418bc1239cfea1c605603e61c74023a8fb.tar.gz CMake-b15c0b418bc1239cfea1c605603e61c74023a8fb.tar.bz2 |
FPHSA(): add HANDLE_COMPONENTS option
if the HANDLE_COMPONENTS is used, FPHSA() now also checks all required COMPONENTS,
i.e. all elements from <name>_FIND_COMPONENTS for which <name>_FIND_REQUIRED_<comp>
is true, and sets <name>_FOUND only to true if all have been found.
As discussed on cmake-developers.
Alex
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/FindPackageTest/CMakeLists.txt | 6 | ||||
-rw-r--r-- | Tests/FindPackageTest/FindLotsOfComponents.cmake | 10 |
2 files changed, 16 insertions, 0 deletions
diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt index eba9db9..eebebc0 100644 --- a/Tests/FindPackageTest/CMakeLists.txt +++ b/Tests/FindPackageTest/CMakeLists.txt @@ -37,6 +37,12 @@ FIND_PACKAGE(VersionTestB 1.2) FIND_PACKAGE(VersionTestC 1.2.3) FIND_PACKAGE(VersionTestD 1.2.3.4) + +FIND_PACKAGE(LotsOfComponents COMPONENTS AComp OPTIONAL_COMPONENTS BComp CComp) +IF(NOT LOTSOFCOMPONENTS_FOUND) + MESSAGE(SEND_ERROR "LotsOfComponents not found !") +ENDIF() + #----------------------------------------------------------------------------- # Test system package registry if possible. SET(CMakeTestSystemPackage "") diff --git a/Tests/FindPackageTest/FindLotsOfComponents.cmake b/Tests/FindPackageTest/FindLotsOfComponents.cmake new file mode 100644 index 0000000..9076d86 --- /dev/null +++ b/Tests/FindPackageTest/FindLotsOfComponents.cmake @@ -0,0 +1,10 @@ +set(LOC_FOO TRUE) + +set(LotsOfComponents_AComp_FOUND TRUE) +set(LotsOfComponents_BComp_FOUND FALSE) +set(LotsOfComponents_CComp_FOUND TRUE) + +include(FindPackageHandleStandardArgs) + +find_package_handle_standard_args(LotsOfComponents REQUIRED_VARS LOC_FOO + HANDLE_COMPONENTS) |