mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 08:20:18 -06:00
Add deprecation warnings for policies CMP0081 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.13 and below to encourage projects to port away from setting policies to OLD.
This commit is contained in:
@@ -4387,7 +4387,7 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id,
|
||||
|
||||
// Deprecate old policies, especially those that require a lot
|
||||
// of code to maintain the old behavior.
|
||||
if (status == cmPolicies::OLD && id <= cmPolicies::CMP0075 &&
|
||||
if (status == cmPolicies::OLD && id <= cmPolicies::CMP0081 &&
|
||||
!(this->GetCMakeInstance()->GetIsInTryCompile() &&
|
||||
(
|
||||
// Policies set by cmCoreTryCompile::TryCompileCode.
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
^CMake Deprecation Warning at [^
|
||||
]*/Tests/RunCMake/BundleUtilities/CMP0080-COMMAND.cmake:[0-9]+ \(cmake_policy\):
|
||||
The OLD behavior for policy CMP0080 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.$
|
||||
10
Tests/RunCMake/BundleUtilities/CMP0080-OLD-stderr.txt
Normal file
10
Tests/RunCMake/BundleUtilities/CMP0080-OLD-stderr.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
^CMake Deprecation Warning at CMP0080-OLD.cmake:[0-9]+ \(cmake_policy\):
|
||||
The OLD behavior for policy CMP0080 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\)$
|
||||
@@ -1 +0,0 @@
|
||||
0
|
||||
10
Tests/RunCMake/CMP0081/CMP0081-OLD-stderr.txt
Normal file
10
Tests/RunCMake/CMP0081/CMP0081-OLD-stderr.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
^CMake Deprecation Warning at CMP0081-OLD.cmake:[0-9]+ \(cmake_policy\):
|
||||
The OLD behavior for policy CMP0081 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\)$
|
||||
24
Tests/RunCMake/UseSWIG/CMP0078-OLD-stderr.txt
Normal file
24
Tests/RunCMake/UseSWIG/CMP0078-OLD-stderr.txt
Normal file
@@ -0,0 +1,24 @@
|
||||
^CMake Deprecation Warning at CMP0078-OLD.cmake:[0-9]+ \(cmake_policy\):
|
||||
The OLD behavior for policy CMP0078 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\)
|
||||
+
|
||||
CMake Deprecation Warning at [^
|
||||
]*/Modules/UseSWIG.cmake:[0-9]+ \(cmake_policy\):
|
||||
The OLD behavior for policy CMP0078 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\):
|
||||
CMP0078-common.cmake:[0-9]+ \(include\)
|
||||
CMP0078-OLD.cmake:[0-9]+ \(include\)
|
||||
CMakeLists.txt:[0-9]+ \(include\)$
|
||||
10
Tests/RunCMake/option/CMP0077-OLD-stderr.txt
Normal file
10
Tests/RunCMake/option/CMP0077-OLD-stderr.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
^CMake Deprecation Warning at CMP0077-OLD.cmake:[0-9]+ \(cmake_policy\):
|
||||
The OLD behavior for policy CMP0077 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\)$
|
||||
@@ -0,0 +1,10 @@
|
||||
^CMake Deprecation Warning at CMP0079-iface-OLD.cmake:[0-9]+ \(cmake_policy\):
|
||||
The OLD behavior for policy CMP0079 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\)$
|
||||
@@ -1,4 +1,15 @@
|
||||
^CMake Error at CMP0079-link/CMakeLists.txt:[0-9]+ \(target_link_libraries\):
|
||||
^CMake Deprecation Warning at CMP0079-link-OLD.cmake:[0-9]+ \(cmake_policy\):
|
||||
The OLD behavior for policy CMP0079 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\)
|
||||
+
|
||||
CMake Error at CMP0079-link/CMakeLists.txt:[0-9]+ \(target_link_libraries\):
|
||||
Attempt to add link library "foo" to target "top" which is not built in
|
||||
this directory.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user