Browse Source

find_package: Test rejection of required+optional components

Brad King 13 years ago
parent
commit
6d100f9f46

+ 1 - 0
Tests/RunCMake/find_package/ComponentRequiredAndOptional-result.txt

@@ -0,0 +1 @@
+1

+ 8 - 0
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\)

+ 1 - 0
Tests/RunCMake/find_package/ComponentRequiredAndOptional.cmake

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

+ 1 - 0
Tests/RunCMake/find_package/RunCMakeTest.cmake

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