mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 13:20:47 -06:00
Merge topic 'post-rel-dev'
8071304f2eConfigure CMake itself with policies through CMake 4.0f7380d8c4aexport: Increase maximum policy version in exported files to 4.094ff184a63Add deprecation warnings for policies CMP0143 and below Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !10925
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file LICENSE.rst or https://cmake.org/licensing for details.
|
||||
|
||||
cmake_minimum_required(VERSION 3.13...3.31 FATAL_ERROR)
|
||||
cmake_minimum_required(VERSION 3.13...4.0 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)
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
cmake_policy(PUSH)
|
||||
cmake_policy(VERSION 2.8.12...3.31)
|
||||
cmake_policy(VERSION 2.8.12...4.0)
|
||||
|
||||
#----------------------------------------------------------------
|
||||
# Generated CMake Java target import file.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
cmake_minimum_required(VERSION 3.13...3.31 FATAL_ERROR)
|
||||
cmake_minimum_required(VERSION 3.13...4.0 FATAL_ERROR)
|
||||
project(CheckCurses C)
|
||||
|
||||
set(CURSES_NEED_NCURSES TRUE)
|
||||
|
||||
@@ -173,7 +173,7 @@ void cmExportCMakeConfigGenerator::GeneratePolicyHeaderCode(std::ostream& os)
|
||||
// Isolate the file policy level.
|
||||
// Support CMake versions as far back as the
|
||||
// RequiredCMakeVersion{Major,Minor,Patch}, but also support using NEW
|
||||
// policy settings for up to CMake 3.31 (this upper limit may be reviewed
|
||||
// policy settings for up to CMake 4.0 (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.
|
||||
@@ -182,7 +182,7 @@ void cmExportCMakeConfigGenerator::GeneratePolicyHeaderCode(std::ostream& os)
|
||||
"cmake_policy(VERSION "
|
||||
<< this->RequiredCMakeVersionMajor << '.'
|
||||
<< this->RequiredCMakeVersionMinor << '.'
|
||||
<< this->RequiredCMakeVersionPatch << "...3.31)\n";
|
||||
<< this->RequiredCMakeVersionPatch << "...4.0)\n";
|
||||
/* clang-format on */
|
||||
}
|
||||
|
||||
|
||||
@@ -4077,7 +4077,7 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id,
|
||||
}
|
||||
|
||||
// Deprecate old policies.
|
||||
if (status == cmPolicies::OLD && id <= cmPolicies::CMP0142 &&
|
||||
if (status == cmPolicies::OLD && id <= cmPolicies::CMP0143 &&
|
||||
!(this->GetCMakeInstance()->GetIsInTryCompile() &&
|
||||
(
|
||||
// Policies set by cmCoreTryCompile::TryCompileCode.
|
||||
|
||||
8
Tests/RunCMake/VSSolution/CMP0143-OLD-stderr.txt
Normal file
8
Tests/RunCMake/VSSolution/CMP0143-OLD-stderr.txt
Normal file
@@ -0,0 +1,8 @@
|
||||
^CMake Deprecation Warning at CMakeLists\.txt:[0-9]+ \(cmake_minimum_required\):
|
||||
The OLD behavior for policy CMP0143 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\.$
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
if(NOT CMake_SOURCE_DIR)
|
||||
set(CMakeDeveloperReference_STANDALONE 1)
|
||||
cmake_minimum_required(VERSION 3.13...3.31 FATAL_ERROR)
|
||||
cmake_minimum_required(VERSION 3.13...4.0 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)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
if(NOT CMake_SOURCE_DIR)
|
||||
set(CMakeHelp_STANDALONE 1)
|
||||
cmake_minimum_required(VERSION 3.13...3.31 FATAL_ERROR)
|
||||
cmake_minimum_required(VERSION 3.13...4.0 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)
|
||||
|
||||
Reference in New Issue
Block a user