summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-06-30 11:32:50 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-06-30 11:32:56 (GMT)
commita2f2634a5d9e479fcfb13e3c92238a7f608dbd29 (patch)
treec1ca85619464e1d4a7a8f26d2c60bbf3e16efb66 /Tests
parent0e2040f36f9ddff9622e2ad9d258a71d399aabde (diff)
parent616972197a21ec94504c1fa40f8608d430325eac (diff)
downloadCMake-a2f2634a5d9e479fcfb13e3c92238a7f608dbd29.zip
CMake-a2f2634a5d9e479fcfb13e3c92238a7f608dbd29.tar.gz
CMake-a2f2634a5d9e479fcfb13e3c92238a7f608dbd29.tar.bz2
Merge topic 'CMP0126-WARNING'
616972197a Merge branch 'backport-3.21-CMP0126-WARNING' into CMP0126-WARNING 16208ac113 CMP0126: Add control for warnings Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Ben Boeckel <ben.boeckel@kitware.com> Merge-request: !6282
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CMP0126/CMP0126-WARN-default.cmake3
-rw-r--r--Tests/RunCMake/CMP0126/CMP0126-WARN-stderr.txt10
-rw-r--r--Tests/RunCMake/CMP0126/CMP0126-WARN.cmake5
-rw-r--r--Tests/RunCMake/CMP0126/RunCMakeTest.cmake2
4 files changed, 20 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMP0126/CMP0126-WARN-default.cmake b/Tests/RunCMake/CMP0126/CMP0126-WARN-default.cmake
new file mode 100644
index 0000000..3147fc4
--- /dev/null
+++ b/Tests/RunCMake/CMP0126/CMP0126-WARN-default.cmake
@@ -0,0 +1,3 @@
+
+set(MY_VAR 1)
+set(MY_VAR 2 CACHE STRING "")
diff --git a/Tests/RunCMake/CMP0126/CMP0126-WARN-stderr.txt b/Tests/RunCMake/CMP0126/CMP0126-WARN-stderr.txt
new file mode 100644
index 0000000..2301511
--- /dev/null
+++ b/Tests/RunCMake/CMP0126/CMP0126-WARN-stderr.txt
@@ -0,0 +1,10 @@
+CMake Warning \(dev\) at CMP0126-WARN.cmake:[0-9]+ \(set\):
+ Policy CMP0126 is not set: set\(CACHE\) does not remove a normal variable of
+ the same name\. Run "cmake --help-policy CMP0126" for policy details\. Use
+ the cmake_policy command to set the policy and suppress this warning\.
+
+ For compatibility with older versions of CMake, normal variable "MY_VAR"
+ will be removed from the current scope\.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
diff --git a/Tests/RunCMake/CMP0126/CMP0126-WARN.cmake b/Tests/RunCMake/CMP0126/CMP0126-WARN.cmake
new file mode 100644
index 0000000..111c824
--- /dev/null
+++ b/Tests/RunCMake/CMP0126/CMP0126-WARN.cmake
@@ -0,0 +1,5 @@
+
+set(CMAKE_POLICY_WARNING_CMP0126 1)
+
+set(MY_VAR 1)
+set(MY_VAR 2 CACHE STRING "")
diff --git a/Tests/RunCMake/CMP0126/RunCMakeTest.cmake b/Tests/RunCMake/CMP0126/RunCMakeTest.cmake
index ae988f4..77c3878 100644
--- a/Tests/RunCMake/CMP0126/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMP0126/RunCMakeTest.cmake
@@ -4,3 +4,5 @@ run_cmake(CMP0126-OLD)
run_cmake_with_options(CMP0126-OLD_CL -DVAR=3)
run_cmake(CMP0126-NEW)
run_cmake_with_options(CMP0126-NEW_CL -DVAR=3)
+run_cmake(CMP0126-WARN)
+run_cmake(CMP0126-WARN-default)