From 34652be5d295ba2747765f96ef1971c510d814fd Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 5 Feb 2025 13:59:56 -0500 Subject: [PATCH] export: Increase maximum policy version in exported files to 3.31 The files generated by `install(EXPORT)`, `export()`, and `install_jar_exports()` commands are known to work with policies as of CMake 3.31, so enable them in sufficiently new CMake versions. --- Modules/UseJava/javaTargets.cmake.in | 2 +- Source/cmExportCMakeConfigGenerator.cxx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/UseJava/javaTargets.cmake.in b/Modules/UseJava/javaTargets.cmake.in index 11f1f0621e..4aa6560d78 100644 --- a/Modules/UseJava/javaTargets.cmake.in +++ b/Modules/UseJava/javaTargets.cmake.in @@ -1,5 +1,5 @@ cmake_policy(PUSH) -cmake_policy(VERSION 2.8.12...3.30) +cmake_policy(VERSION 2.8.12...3.31) #---------------------------------------------------------------- # Generated CMake Java target import file. diff --git a/Source/cmExportCMakeConfigGenerator.cxx b/Source/cmExportCMakeConfigGenerator.cxx index bb9de54f26..257ea26876 100644 --- a/Source/cmExportCMakeConfigGenerator.cxx +++ b/Source/cmExportCMakeConfigGenerator.cxx @@ -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.30 (this upper limit may be reviewed + // policy settings for up to CMake 3.31 (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.30)\n"; + << this->RequiredCMakeVersionPatch << "...3.31)\n"; /* clang-format on */ }