Merge topic 'post-rel-dev'

e517c1beb6 Configure CMake itself with policies through CMake 3.19
141dbf2c19 export: Increase maximum policy version in exported files to 3.19
58ea0d1255 Add deprecation warnings for policies CMP0081 and below

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5798
This commit is contained in:
Brad King
2021-02-11 13:56:53 +00:00
committed by Kitware Robot
13 changed files with 91 additions and 8 deletions

View File

@@ -1,7 +1,7 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
cmake_minimum_required(VERSION 3.1...3.18 FATAL_ERROR)
cmake_minimum_required(VERSION 3.1...3.19 FATAL_ERROR)
set(CMAKE_USER_MAKE_RULES_OVERRIDE_C ${CMAKE_CURRENT_SOURCE_DIR}/Source/Modules/OverrideC.cmake)
set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX ${CMAKE_CURRENT_SOURCE_DIR}/Source/Modules/OverrideCXX.cmake)
project(CMake)

View File

@@ -924,13 +924,13 @@ void cmExportFileGenerator::GeneratePolicyHeaderCode(std::ostream& os)
// Isolate the file policy level.
// Support CMake versions as far back as 2.6 but also support using NEW
// policy settings for up to CMake 3.18 (this upper limit may be reviewed
// policy settings for up to CMake 3.19 (this upper limit may be reviewed
// and increased from time to time). This reduces the opportunity for CMake
// warnings when an older export file is later used with newer CMake
// versions.
/* clang-format off */
os << "cmake_policy(PUSH)\n"
<< "cmake_policy(VERSION 2.6...3.18)\n";
<< "cmake_policy(VERSION 2.6...3.19)\n";
/* clang-format on */
}

View File

@@ -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.

View File

@@ -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.$

View 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\)$

View File

@@ -1 +0,0 @@
0

View 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\)$

View 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\)$

View 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\)$

View File

@@ -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\)$

View File

@@ -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.

View File

@@ -3,7 +3,7 @@
if(NOT CMake_SOURCE_DIR)
set(CMakeDeveloperReference_STANDALONE 1)
cmake_minimum_required(VERSION 3.1...3.18 FATAL_ERROR)
cmake_minimum_required(VERSION 3.1...3.19 FATAL_ERROR)
get_filename_component(tmp "${CMAKE_CURRENT_SOURCE_DIR}" PATH)
get_filename_component(CMake_SOURCE_DIR "${tmp}" PATH)
include(${CMake_SOURCE_DIR}/Modules/CTestUseLaunchers.cmake)

View File

@@ -3,7 +3,7 @@
if(NOT CMake_SOURCE_DIR)
set(CMakeHelp_STANDALONE 1)
cmake_minimum_required(VERSION 3.1...3.18 FATAL_ERROR)
cmake_minimum_required(VERSION 3.1...3.19 FATAL_ERROR)
get_filename_component(tmp "${CMAKE_CURRENT_SOURCE_DIR}" PATH)
get_filename_component(CMake_SOURCE_DIR "${tmp}" PATH)
include(${CMake_SOURCE_DIR}/Modules/CTestUseLaunchers.cmake)