summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CMP0057/CMP0057-NEW.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-04-30 14:32:03 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-04-30 14:32:03 (GMT)
commit735b7092e88bea92e000bf88a0925cfa44f9b315 (patch)
treec8247c0b401103a303034b37118013d9d34cec9c /Tests/RunCMake/CMP0057/CMP0057-NEW.cmake
parentb39929ab42f3b6204a9689846cbc24c96ee50349 (diff)
parentaed6239e40e7046c3f32e018d9c360ad0f624336 (diff)
downloadCMake-735b7092e88bea92e000bf88a0925cfa44f9b315.zip
CMake-735b7092e88bea92e000bf88a0925cfa44f9b315.tar.gz
CMake-735b7092e88bea92e000bf88a0925cfa44f9b315.tar.bz2
Merge topic 'if-IN_LIST'
aed6239e 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()