summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CMP0057/CMP0057-NEW.cmake
diff options
context:
space:
mode:
authorNils Gladitz <nilsgladitz@gmail.com>2015-04-29 15:25:13 (GMT)
committerBrad King <brad.king@kitware.com>2015-04-30 14:21:19 (GMT)
commitaed6239e40e7046c3f32e018d9c360ad0f624336 (patch)
tree704a638d740870f5c2c94d56d09e5f9b8a240472 /Tests/RunCMake/CMP0057/CMP0057-NEW.cmake
parent32a2f41402d38e1c5be3547bd042328df0b28124 (diff)
downloadCMake-aed6239e40e7046c3f32e018d9c360ad0f624336.zip
CMake-aed6239e40e7046c3f32e018d9c360ad0f624336.tar.gz
CMake-aed6239e40e7046c3f32e018d9c360ad0f624336.tar.bz2
if: Implement new IN_LIST operator
Diffstat (limited to 'Tests/RunCMake/CMP0057/CMP0057-NEW.cmake')
-rw-r--r--Tests/RunCMake/CMP0057/CMP0057-NEW.cmake31
1 files changed, 31 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMP0057/CMP0057-NEW.cmake b/Tests/RunCMake/CMP0057/CMP0057-NEW.cmake
new file mode 100644
index 0000000..ebd7ba5
--- /dev/null
+++ b/Tests/RunCMake/CMP0057/CMP0057-NEW.cmake
@@ -0,0 +1,31 @@
+cmake_policy(SET CMP0057 NEW)
+
+set(MY_NON_EXISTENT_LIST)
+
+set(MY_EMPTY_LIST "")
+
+set(MY_LIST foo bar)
+
+if(NOT "foo" IN_LIST MY_LIST)
+ message(FATAL_ERROR "expected item 'foo' not found in list MY_LIST")
+endif()
+
+if("baz" IN_LIST MY_LIST)
+ message(FATAL_ERROR "unexpected item 'baz' found in list MY_LIST")
+endif()
+
+if("foo" IN_LIST MY_NON_EXISTENT_LIST)
+ message(FATAL_ERROR
+ "unexpected item 'baz' found in non existent list MY_NON_EXISTENT_LIST")
+endif()
+
+if("foo" IN_LIST MY_EMPTY_LIST)
+ message(FATAL_ERROR
+ "unexpected item 'baz' found in empty list MY_EMPTY_LIST")
+endif()
+
+set(VAR "foo")
+
+if(NOT VAR IN_LIST MY_LIST)
+ message(FATAL_ERROR "expected item VAR not found in list MY_LIST")
+endif()