diff options
author | Daniel Schürmann <daschuer@mixxx.org> | 2021-08-29 21:05:38 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-09-10 13:46:55 (GMT) |
commit | 059b90a0b4760c3c0bb761870be2a0811f80ce70 (patch) | |
tree | 78875945c1e64300ad5a1d2a40811ef4bb2389af /Tests | |
parent | ed9abd99772cbdcb2e4dd195eb4a62104ce86c95 (diff) | |
download | CMake-059b90a0b4760c3c0bb761870be2a0811f80ce70.zip CMake-059b90a0b4760c3c0bb761870be2a0811f80ce70.tar.gz CMake-059b90a0b4760c3c0bb761870be2a0811f80ce70.tar.bz2 |
CMakeDependentOption: Introduce policy CMP0127 for full Condition Syntax
Fixes: #22303
Diffstat (limited to 'Tests')
12 files changed, 51 insertions, 1 deletions
diff --git a/Tests/RunCMake/CMakeDependentOption/Regex-stdout.txt b/Tests/RunCMake/CMakeDependentOption/Parentheses-CMP0127-NEW-stdout.txt index 15b56a1..15b56a1 100644 --- a/Tests/RunCMake/CMakeDependentOption/Regex-stdout.txt +++ b/Tests/RunCMake/CMakeDependentOption/Parentheses-CMP0127-NEW-stdout.txt diff --git a/Tests/RunCMake/CMakeDependentOption/Parentheses-CMP0127-NEW.cmake b/Tests/RunCMake/CMakeDependentOption/Parentheses-CMP0127-NEW.cmake new file mode 100644 index 0000000..5a2b018 --- /dev/null +++ b/Tests/RunCMake/CMakeDependentOption/Parentheses-CMP0127-NEW.cmake @@ -0,0 +1,9 @@ +include(CMakeDependentOption) + +cmake_policy(SET CMP0127 NEW) + +set(A 1) +set(B 1) +set(C 0) +cmake_dependent_option(USE_FOO "Use Foo" ON "A AND (B OR C)" OFF) +message(STATUS "USE_FOO='${USE_FOO}'") diff --git a/Tests/RunCMake/CMakeDependentOption/Parentheses-CMP0127-WARN-stderr.txt b/Tests/RunCMake/CMakeDependentOption/Parentheses-CMP0127-WARN-stderr.txt new file mode 100644 index 0000000..b16e84b --- /dev/null +++ b/Tests/RunCMake/CMakeDependentOption/Parentheses-CMP0127-WARN-stderr.txt @@ -0,0 +1,9 @@ +^CMake Warning \(dev\) at [^ +]*/Modules/CMakeDependentOption.cmake:[0-9]+ \(message\): + Policy CMP0127 is not set: cmake_dependent_option\(\) supports full Condition + Syntax. Run "cmake --help-policy CMP0127" for policy details. Use the + cmake_policy command to set the policy and suppress this warning. +Call Stack \(most recent call first\): + [^ +]*/Tests/RunCMake/CMakeDependentOption/Parentheses-CMP0127-WARN.cmake:[0-9]+ \(cmake_dependent_option\) +This warning is for project developers. Use -Wno-dev to suppress it.$ diff --git a/Tests/RunCMake/CMakeDependentOption/Parentheses-CMP0127-WARN-stdout.txt b/Tests/RunCMake/CMakeDependentOption/Parentheses-CMP0127-WARN-stdout.txt new file mode 100644 index 0000000..d89dbd3 --- /dev/null +++ b/Tests/RunCMake/CMakeDependentOption/Parentheses-CMP0127-WARN-stdout.txt @@ -0,0 +1,2 @@ +-- USE_FOO='OFF' +-- USE_BAR='ON' diff --git a/Tests/RunCMake/CMakeDependentOption/Parentheses-CMP0127-WARN.cmake b/Tests/RunCMake/CMakeDependentOption/Parentheses-CMP0127-WARN.cmake new file mode 100644 index 0000000..00d440d --- /dev/null +++ b/Tests/RunCMake/CMakeDependentOption/Parentheses-CMP0127-WARN.cmake @@ -0,0 +1,9 @@ +include(CMakeDependentOption) + +set(A 1) +set(B 1) +set(C 0) +cmake_dependent_option(USE_FOO "Use Foo" ON "A AND (B OR C)" OFF) +message(STATUS "USE_FOO='${USE_FOO}'") +cmake_dependent_option(USE_BAR "Use Bar" ON "A;B" OFF) +message(STATUS "USE_BAR='${USE_BAR}'") diff --git a/Tests/RunCMake/CMakeDependentOption/Regex-CMP0127-NEW-stdout.txt b/Tests/RunCMake/CMakeDependentOption/Regex-CMP0127-NEW-stdout.txt new file mode 100644 index 0000000..15b56a1 --- /dev/null +++ b/Tests/RunCMake/CMakeDependentOption/Regex-CMP0127-NEW-stdout.txt @@ -0,0 +1 @@ +-- USE_FOO='ON' diff --git a/Tests/RunCMake/CMakeDependentOption/Regex-CMP0127-NEW.cmake b/Tests/RunCMake/CMakeDependentOption/Regex-CMP0127-NEW.cmake new file mode 100644 index 0000000..e92c1e6 --- /dev/null +++ b/Tests/RunCMake/CMakeDependentOption/Regex-CMP0127-NEW.cmake @@ -0,0 +1,7 @@ +include(CMakeDependentOption) + +cmake_policy(SET CMP0127 NEW) + +set(FOO "lower") +cmake_dependent_option(USE_FOO "Use Foo" ON "FOO MATCHES \"(UPPER|lower)\"" OFF) +message(STATUS "USE_FOO='${USE_FOO}'") diff --git a/Tests/RunCMake/CMakeDependentOption/Regex-CMP0127-OLD-stdout.txt b/Tests/RunCMake/CMakeDependentOption/Regex-CMP0127-OLD-stdout.txt new file mode 100644 index 0000000..15b56a1 --- /dev/null +++ b/Tests/RunCMake/CMakeDependentOption/Regex-CMP0127-OLD-stdout.txt @@ -0,0 +1 @@ +-- USE_FOO='ON' diff --git a/Tests/RunCMake/CMakeDependentOption/Regex.cmake b/Tests/RunCMake/CMakeDependentOption/Regex-CMP0127-OLD.cmake index 8342a01..81df003 100644 --- a/Tests/RunCMake/CMakeDependentOption/Regex.cmake +++ b/Tests/RunCMake/CMakeDependentOption/Regex-CMP0127-OLD.cmake @@ -1,5 +1,7 @@ include(CMakeDependentOption) +cmake_policy(SET CMP0127 OLD) + set(FOO "lower") cmake_dependent_option(USE_FOO "Use Foo" ON "FOO MATCHES (UPPER|lower)" OFF) message(STATUS "USE_FOO='${USE_FOO}'") diff --git a/Tests/RunCMake/CMakeDependentOption/RunCMakeTest.cmake b/Tests/RunCMake/CMakeDependentOption/RunCMakeTest.cmake index e1045f2..61e046f 100644 --- a/Tests/RunCMake/CMakeDependentOption/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMakeDependentOption/RunCMakeTest.cmake @@ -1,3 +1,6 @@ include(RunCMake) -run_cmake_script(Regex) +run_cmake_script(Regex-CMP0127-NEW) +run_cmake_script(Regex-CMP0127-OLD) +run_cmake_script(Parentheses-CMP0127-NEW) +run_cmake_script(Parentheses-CMP0127-WARN) diff --git a/Tests/RunCMake/CMakeDependentOption/Simple-CMP0127-OLD-stdout.txt b/Tests/RunCMake/CMakeDependentOption/Simple-CMP0127-OLD-stdout.txt new file mode 100644 index 0000000..15b56a1 --- /dev/null +++ b/Tests/RunCMake/CMakeDependentOption/Simple-CMP0127-OLD-stdout.txt @@ -0,0 +1 @@ +-- USE_FOO='ON' diff --git a/Tests/RunCMake/CMakeDependentOption/Simple-CMP0127-OLD.cmake b/Tests/RunCMake/CMakeDependentOption/Simple-CMP0127-OLD.cmake new file mode 100644 index 0000000..6db2128 --- /dev/null +++ b/Tests/RunCMake/CMakeDependentOption/Simple-CMP0127-OLD.cmake @@ -0,0 +1,6 @@ +include(CMakeDependentOption) + +set(A1 1) +set(bb 1) +cmake_dependent_option(USE_FOO "Use Foo" ON "A1;bb" OFF) +message(STATUS "USE_FOO='${USE_FOO}'") |