find_package: Test rejection of required+optional components

This commit is contained in:
Brad King 2012-03-19 10:49:01 -04:00
parent d81d83c218
commit 6d100f9f46
4 changed files with 11 additions and 0 deletions

View File

@ -0,0 +1,8 @@
CMake Error at ComponentRequiredAndOptional.cmake:1 \(find_package\):
find_package called with components that are both required and optional:
CompA
CompB
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)

View File

@ -0,0 +1 @@
find_package(NotHere REQUIRED CompA CompB CompC OPTIONAL_COMPONENTS CompA CompB CompD)

View File

@ -1,5 +1,6 @@
include(RunCMake) include(RunCMake)
run_cmake(ComponentRequiredAndOptional)
run_cmake(MissingNormal) run_cmake(MissingNormal)
run_cmake(MissingNormalRequired) run_cmake(MissingNormalRequired)
run_cmake(MissingNormalVersion) run_cmake(MissingNormalVersion)