From b97b1d1ed41ac9ac337433f7c0540b1e70e4c004 Mon Sep 17 00:00:00 2001 From: Brad King Date: Sat, 16 Nov 2024 08:12:58 -0500 Subject: [PATCH] cmPolicies: Factor out macro to old VERSION update advice --- Source/cmPolicies.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index 9fb6fc3970..fa64029104 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -286,6 +286,10 @@ bool IsFromLegacyInstallEXPORT(cmMakefile* mf, unsigned int majorVer, cmSystemTools::Strucmp(mf->GetBacktrace().Top().Name.c_str(), "cmake_policy") == 0; } +#define ADVICE_UPDATE_VERSION_ARGUMENT \ + "Update the VERSION argument value. Or, use the ... " \ + "syntax to tell CMake that the project requires at least but has " \ + "been updated to work with policies introduced by or earlier." } bool cmPolicies::ApplyPolicyVersion(cmMakefile* mf, unsigned int majorVer, @@ -302,10 +306,7 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile* mf, unsigned int majorVer, mf->IssueMessage( MessageType::DEPRECATION_WARNING, "Compatibility with CMake < 3.10 will be removed from " - "a future version of CMake.\n" - "Update the VERSION argument value. Or, use the ... " - "syntax to tell CMake that the project requires at least but has " - "been updated to work with policies introduced by or earlier."); + "a future version of CMake.\n" ADVICE_UPDATE_VERSION_ARGUMENT); } // now loop over all the policies and set them as appropriate