diff options
author | Brad King <brad.king@kitware.com> | 2023-10-03 16:09:23 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-10-03 21:21:47 (GMT) |
commit | 86d910ab73c83a949220ca7f0388f7aa5a32aa3c (patch) | |
tree | cfcafdc47bcef4a49bfffbb82d2a12e194796489 /Tests/RunCMake/UseSWIG | |
parent | 4459d25c4adb117ceda5ab368d40fbc55172895d (diff) | |
download | CMake-86d910ab73c83a949220ca7f0388f7aa5a32aa3c.zip CMake-86d910ab73c83a949220ca7f0388f7aa5a32aa3c.tar.gz CMake-86d910ab73c83a949220ca7f0388f7aa5a32aa3c.tar.bz2 |
Add deprecation warnings for policies CMP0126 and below
The OLD behaviors of all policies are deprecated, but only by
documentation. Add an explicit deprecation diagnostic for policies
introduced in CMake 3.21 and below to encourage projects to port
away from setting policies to OLD.
Diffstat (limited to 'Tests/RunCMake/UseSWIG')
-rw-r--r-- | Tests/RunCMake/UseSWIG/CMP0122-NEW-check.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/UseSWIG/CMP0122-OLD-check.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/UseSWIG/CMP0122-OLD-stderr.txt | 10 |
3 files changed, 12 insertions, 2 deletions
diff --git a/Tests/RunCMake/UseSWIG/CMP0122-NEW-check.cmake b/Tests/RunCMake/UseSWIG/CMP0122-NEW-check.cmake index a26c278..df14d15 100644 --- a/Tests/RunCMake/UseSWIG/CMP0122-NEW-check.cmake +++ b/Tests/RunCMake/UseSWIG/CMP0122-NEW-check.cmake @@ -1,5 +1,5 @@ -cmake_policy(VERSION 3.1) +cmake_policy(VERSION 3.5) file(STRINGS "${RunCMake_TEST_BINARY_DIR}/CMP0122-library-name.txt" prefixes) diff --git a/Tests/RunCMake/UseSWIG/CMP0122-OLD-check.cmake b/Tests/RunCMake/UseSWIG/CMP0122-OLD-check.cmake index 01657d0..6eb5c20 100644 --- a/Tests/RunCMake/UseSWIG/CMP0122-OLD-check.cmake +++ b/Tests/RunCMake/UseSWIG/CMP0122-OLD-check.cmake @@ -1,5 +1,5 @@ -cmake_policy(VERSION 3.1) +cmake_policy(VERSION 3.5) file(STRINGS "${RunCMake_TEST_BINARY_DIR}/CMP0122-library-name.txt" prefixes) diff --git a/Tests/RunCMake/UseSWIG/CMP0122-OLD-stderr.txt b/Tests/RunCMake/UseSWIG/CMP0122-OLD-stderr.txt new file mode 100644 index 0000000..84f2ee7 --- /dev/null +++ b/Tests/RunCMake/UseSWIG/CMP0122-OLD-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0122-OLD\.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0122 will be removed from a future version + of CMake\. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances\. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD\. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ |