diff options
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/CMP0057/CMP0057-NEW-stderr.txt | 4 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0057/CMP0057-NEW.cmake | 36 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0057/CMP0057-OLD-result.txt (renamed from Tests/RunCMake/CMP0057/CMP0057-NEW-result.txt) | 0 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0057/CMP0057-OLD-stderr.txt | 8 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0057/CMP0057-OLD.cmake | 14 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0057/CMP0057-WARN-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0057/CMP0057-WARN-stderr.txt | 20 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0057/CMP0057-WARN.cmake | 14 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0057/CMP0057-once_is_ok.cmake | 8 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0057/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0057/RunCMakeTest.cmake | 4 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0057/input.txt | 0 |
12 files changed, 61 insertions, 50 deletions
diff --git a/Tests/RunCMake/CMP0057/CMP0057-NEW-stderr.txt b/Tests/RunCMake/CMP0057/CMP0057-NEW-stderr.txt deleted file mode 100644 index 9607d54..0000000 --- a/Tests/RunCMake/CMP0057/CMP0057-NEW-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -CMake Error at CMP0057-NEW.cmake:8 \(add_custom_command\): - "input.txt" can only be specified as a custom command MAIN_DEPENDENCY once. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/CMP0057/CMP0057-NEW.cmake b/Tests/RunCMake/CMP0057/CMP0057-NEW.cmake index 22dbfb3..ebd7ba5 100644 --- a/Tests/RunCMake/CMP0057/CMP0057-NEW.cmake +++ b/Tests/RunCMake/CMP0057/CMP0057-NEW.cmake @@ -1,13 +1,31 @@ cmake_policy(SET CMP0057 NEW) -add_custom_command(OUTPUT out1 - COMMAND ${CMAKE_COMMAND} -E echo out1 - MAIN_DEPENDENCY input.txt -) +set(MY_NON_EXISTENT_LIST) -add_custom_command(OUTPUT out2 - COMMAND ${CMAKE_COMMAND} -E echo out2 - MAIN_DEPENDENCY input.txt -) +set(MY_EMPTY_LIST "") -add_custom_target(mytarget1 ALL DEPENDS out1 out2) +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() diff --git a/Tests/RunCMake/CMP0057/CMP0057-NEW-result.txt b/Tests/RunCMake/CMP0057/CMP0057-OLD-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/CMP0057/CMP0057-NEW-result.txt +++ b/Tests/RunCMake/CMP0057/CMP0057-OLD-result.txt diff --git a/Tests/RunCMake/CMP0057/CMP0057-OLD-stderr.txt b/Tests/RunCMake/CMP0057/CMP0057-OLD-stderr.txt new file mode 100644 index 0000000..f3fad8d --- /dev/null +++ b/Tests/RunCMake/CMP0057/CMP0057-OLD-stderr.txt @@ -0,0 +1,8 @@ +CMake Error at CMP0057-OLD.cmake:5 \(if\): + if given arguments: + + "foo" "IN_LIST" "MY_LIST" + + Unknown arguments specified +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/CMP0057/CMP0057-OLD.cmake b/Tests/RunCMake/CMP0057/CMP0057-OLD.cmake index ccf4fcb..cf9ec89 100644 --- a/Tests/RunCMake/CMP0057/CMP0057-OLD.cmake +++ b/Tests/RunCMake/CMP0057/CMP0057-OLD.cmake @@ -1,13 +1,7 @@ cmake_policy(SET CMP0057 OLD) -add_custom_command(OUTPUT out1 - COMMAND ${CMAKE_COMMAND} -E echo out1 - MAIN_DEPENDENCY input.txt -) +set(MY_LIST foo bar) -add_custom_command(OUTPUT out2 - COMMAND ${CMAKE_COMMAND} -E echo out2 - MAIN_DEPENDENCY input.txt -) - -add_custom_target(mytarget1 ALL DEPENDS out1 out2) +if("foo" IN_LIST MY_LIST) + message("foo is in MY_LIST") +endif() diff --git a/Tests/RunCMake/CMP0057/CMP0057-WARN-result.txt b/Tests/RunCMake/CMP0057/CMP0057-WARN-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMP0057/CMP0057-WARN-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMP0057/CMP0057-WARN-stderr.txt b/Tests/RunCMake/CMP0057/CMP0057-WARN-stderr.txt index da3a1cb..b1c9b63 100644 --- a/Tests/RunCMake/CMP0057/CMP0057-WARN-stderr.txt +++ b/Tests/RunCMake/CMP0057/CMP0057-WARN-stderr.txt @@ -1,9 +1,19 @@ -CMake Warning \(dev\) at CMP0057-WARN.cmake:6 \(add_custom_command\): - Policy CMP0057 is not set: Disallow multiple MAIN_DEPENDENCY specifications - for the same file. Run "cmake --help-policy CMP0057" for policy details. - Use the cmake_policy command to set the policy and suppress this warning. +CMake Warning \(dev\) at CMP0057-WARN.cmake:3 \(if\): + Policy CMP0057 is not set: Support new IN_LIST if\(\) operator. Run "cmake + --help-policy CMP0057" for policy details. Use the cmake_policy command to + set the policy and suppress this warning. - "input.txt" can only be specified as a custom command MAIN_DEPENDENCY once. + IN_LIST will be interpreted as an operator when the policy is set to NEW. + Since the policy is not set the OLD behavior will be used. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) This warning is for project developers. Use -Wno-dev to suppress it. + +CMake Error at CMP0057-WARN.cmake:3 \(if\): + if given arguments: + + "foo" "IN_LIST" "MY_LIST" + + Unknown arguments specified +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/CMP0057/CMP0057-WARN.cmake b/Tests/RunCMake/CMP0057/CMP0057-WARN.cmake index 1837968..45f53a5 100644 --- a/Tests/RunCMake/CMP0057/CMP0057-WARN.cmake +++ b/Tests/RunCMake/CMP0057/CMP0057-WARN.cmake @@ -1,11 +1,5 @@ -add_custom_command(OUTPUT out1 - COMMAND ${CMAKE_COMMAND} -E echo out1 - MAIN_DEPENDENCY input.txt -) +set(MY_LIST foo bar) -add_custom_command(OUTPUT out2 - COMMAND ${CMAKE_COMMAND} -E echo out2 - MAIN_DEPENDENCY input.txt -) - -add_custom_target(mytarget1 ALL DEPENDS out1 out2) +if("foo" IN_LIST MY_LIST) + message("foo is in MY_LIST") +endif() diff --git a/Tests/RunCMake/CMP0057/CMP0057-once_is_ok.cmake b/Tests/RunCMake/CMP0057/CMP0057-once_is_ok.cmake deleted file mode 100644 index 8ce02f9..0000000 --- a/Tests/RunCMake/CMP0057/CMP0057-once_is_ok.cmake +++ /dev/null @@ -1,8 +0,0 @@ -cmake_policy(SET CMP0057 NEW) - -add_custom_command(OUTPUT out1 - COMMAND ${CMAKE_COMMAND} -E echo out1 - MAIN_DEPENDENCY input.txt -) - -add_custom_target(mytarget1 ALL DEPENDS out1) diff --git a/Tests/RunCMake/CMP0057/CMakeLists.txt b/Tests/RunCMake/CMP0057/CMakeLists.txt index ef2163c..18dfd26 100644 --- a/Tests/RunCMake/CMP0057/CMakeLists.txt +++ b/Tests/RunCMake/CMP0057/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.2) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CMP0057/RunCMakeTest.cmake b/Tests/RunCMake/CMP0057/RunCMakeTest.cmake index f79235f..719e054 100644 --- a/Tests/RunCMake/CMP0057/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMP0057/RunCMakeTest.cmake @@ -1,7 +1,5 @@ include(RunCMake) run_cmake(CMP0057-OLD) -run_cmake(CMP0057-NEW) run_cmake(CMP0057-WARN) - -run_cmake(CMP0057-once_is_ok) +run_cmake(CMP0057-NEW) diff --git a/Tests/RunCMake/CMP0057/input.txt b/Tests/RunCMake/CMP0057/input.txt deleted file mode 100644 index e69de29..0000000 --- a/Tests/RunCMake/CMP0057/input.txt +++ /dev/null |