From 6d100f9f469b48ad25a3958e2b4865a9d9d37523 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 19 Mar 2012 10:49:01 -0400 Subject: find_package: Test rejection of required+optional components --- .../RunCMake/find_package/ComponentRequiredAndOptional-result.txt | 1 + .../RunCMake/find_package/ComponentRequiredAndOptional-stderr.txt | 8 ++++++++ Tests/RunCMake/find_package/ComponentRequiredAndOptional.cmake | 1 + Tests/RunCMake/find_package/RunCMakeTest.cmake | 1 + 4 files changed, 11 insertions(+) create mode 100644 Tests/RunCMake/find_package/ComponentRequiredAndOptional-result.txt create mode 100644 Tests/RunCMake/find_package/ComponentRequiredAndOptional-stderr.txt create mode 100644 Tests/RunCMake/find_package/ComponentRequiredAndOptional.cmake diff --git a/Tests/RunCMake/find_package/ComponentRequiredAndOptional-result.txt b/Tests/RunCMake/find_package/ComponentRequiredAndOptional-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/find_package/ComponentRequiredAndOptional-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/find_package/ComponentRequiredAndOptional-stderr.txt b/Tests/RunCMake/find_package/ComponentRequiredAndOptional-stderr.txt new file mode 100644 index 0000000..db8f512 --- /dev/null +++ b/Tests/RunCMake/find_package/ComponentRequiredAndOptional-stderr.txt @@ -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\) diff --git a/Tests/RunCMake/find_package/ComponentRequiredAndOptional.cmake b/Tests/RunCMake/find_package/ComponentRequiredAndOptional.cmake new file mode 100644 index 0000000..0355f5a --- /dev/null +++ b/Tests/RunCMake/find_package/ComponentRequiredAndOptional.cmake @@ -0,0 +1 @@ +find_package(NotHere REQUIRED CompA CompB CompC OPTIONAL_COMPONENTS CompA CompB CompD) diff --git a/Tests/RunCMake/find_package/RunCMakeTest.cmake b/Tests/RunCMake/find_package/RunCMakeTest.cmake index 34fa733..42705b7 100644 --- a/Tests/RunCMake/find_package/RunCMakeTest.cmake +++ b/Tests/RunCMake/find_package/RunCMakeTest.cmake @@ -1,5 +1,6 @@ include(RunCMake) +run_cmake(ComponentRequiredAndOptional) run_cmake(MissingNormal) run_cmake(MissingNormalRequired) run_cmake(MissingNormalVersion) -- cgit v0.12