Răsfoiți Sursa

CMP0053: Remove support for OLD behavior

Brad King 10 luni în urmă
părinte
comite
1150fae89a
100 a modificat fișierele cu 67 adăugiri și 703 ștergeri
  1. 5 4
      Help/policy/CMP0053.rst
  2. 0 1
      Modules/CMakeParseImplicitLinkInfo.cmake
  3. 0 1
      Modules/CMakeParseLibraryArchitecture.cmake
  4. 0 1
      Modules/Internal/CMakeDetermineLinkerId.cmake
  5. 8 160
      Source/cmMakefile.cxx
  6. 5 15
      Source/cmMakefile.h
  7. 1 1
      Source/cmPolicies.h
  8. 1 1
      Tests/CMakeTests/StringTest.cmake.in
  9. 3 12
      Tests/CMakeTests/StringTestScript.cmake
  10. 0 13
      Tests/RunCMake/CMP0053/CMP0053-OLD-stderr.txt
  11. 0 8
      Tests/RunCMake/CMP0053/CMP0053-OLD.cmake
  12. 0 2
      Tests/RunCMake/CMP0053/CMP0053-WARN-stderr.txt
  13. 0 6
      Tests/RunCMake/CMP0053/CMP0053-WARN.cmake
  14. 1 1
      Tests/RunCMake/CMP0053/CMakeLists.txt
  15. 0 3
      Tests/RunCMake/CMP0053/RunCMakeTest.cmake
  16. 1 1
      Tests/RunCMake/CMakePresets/RunCMakeTest.cmake
  17. 0 3
      Tests/RunCMake/CommandLine/trace-expand-warn-uninitialized.cmake
  18. 4 34
      Tests/RunCMake/CommandLine/warn-uninitialized-stderr.txt
  19. 0 13
      Tests/RunCMake/CommandLine/warn-uninitialized.cmake
  20. 0 0
      Tests/RunCMake/Syntax/At-stderr.txt
  21. 0 2
      Tests/RunCMake/Syntax/At.cmake
  22. 1 1
      Tests/RunCMake/Syntax/AtWithVariable-stderr.txt
  23. 0 12
      Tests/RunCMake/Syntax/CMP0053-At-OLD-stderr.txt
  24. 0 9
      Tests/RunCMake/Syntax/CMP0053-At-OLD.cmake
  25. 0 27
      Tests/RunCMake/Syntax/CMP0053-At-WARN-newlines-stderr.txt
  26. 0 6
      Tests/RunCMake/Syntax/CMP0053-At-WARN-newlines.cmake
  27. 0 21
      Tests/RunCMake/Syntax/CMP0053-At-WARN-stderr.txt
  28. 0 4
      Tests/RunCMake/Syntax/CMP0053-At-WARN.cmake
  29. 0 24
      Tests/RunCMake/Syntax/CMP0053-Dollar-OLD-stderr.txt
  30. 0 6
      Tests/RunCMake/Syntax/CMP0053-Dollar-OLD.cmake
  31. 0 56
      Tests/RunCMake/Syntax/CMP0053-NUL-stderr.txt
  32. 0 6
      Tests/RunCMake/Syntax/CMP0053-NUL.cmake
  33. 0 4
      Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturn-stderr.txt
  34. 0 2
      Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturn.cmake
  35. 0 2
      Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturnQuoted.cmake
  36. 0 1
      Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpaces-result.txt
  37. 0 4
      Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpaces-stderr.txt
  38. 0 2
      Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpaces.cmake
  39. 0 2
      Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpacesQuoted.cmake
  40. 0 1
      Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabs-result.txt
  41. 0 4
      Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabs-stderr.txt
  42. 0 2
      Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabs.cmake
  43. 0 2
      Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabsQuoted.cmake
  44. 0 1
      Tests/RunCMake/Syntax/CMP0053-NameWithNewline-result.txt
  45. 0 4
      Tests/RunCMake/Syntax/CMP0053-NameWithNewline-stderr.txt
  46. 0 2
      Tests/RunCMake/Syntax/CMP0053-NameWithNewline.cmake
  47. 0 2
      Tests/RunCMake/Syntax/CMP0053-NameWithNewlineQuoted.cmake
  48. 0 1
      Tests/RunCMake/Syntax/CMP0053-NameWithSpaces-result.txt
  49. 0 12
      Tests/RunCMake/Syntax/CMP0053-NameWithSpaces-stderr.txt
  50. 0 2
      Tests/RunCMake/Syntax/CMP0053-NameWithSpaces.cmake
  51. 0 1
      Tests/RunCMake/Syntax/CMP0053-NameWithSpacesQuoted-result.txt
  52. 0 12
      Tests/RunCMake/Syntax/CMP0053-NameWithSpacesQuoted-stderr.txt
  53. 0 2
      Tests/RunCMake/Syntax/CMP0053-NameWithSpacesQuoted.cmake
  54. 0 1
      Tests/RunCMake/Syntax/CMP0053-NameWithTabs-result.txt
  55. 0 12
      Tests/RunCMake/Syntax/CMP0053-NameWithTabs-stderr.txt
  56. 0 2
      Tests/RunCMake/Syntax/CMP0053-NameWithTabs.cmake
  57. 0 1
      Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted-result.txt
  58. 0 12
      Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted-stderr.txt
  59. 0 2
      Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted.cmake
  60. 0 28
      Tests/RunCMake/Syntax/CMP0053-WARN-stderr.txt
  61. 0 5
      Tests/RunCMake/Syntax/CMP0053-WARN.cmake
  62. 1 1
      Tests/RunCMake/Syntax/CMakeLists.txt
  63. 0 0
      Tests/RunCMake/Syntax/Dollar-stderr.txt
  64. 0 2
      Tests/RunCMake/Syntax/Dollar.cmake
  65. 3 3
      Tests/RunCMake/Syntax/Escape2-stderr.txt
  66. 0 2
      Tests/RunCMake/Syntax/Escape2.cmake
  67. 2 2
      Tests/RunCMake/Syntax/EscapeChar-char-stderr.txt.in
  68. 0 2
      Tests/RunCMake/Syntax/EscapeChar-char.cmake.in
  69. 0 2
      Tests/RunCMake/Syntax/EscapeCharsAllowed.cmake
  70. 2 1
      Tests/RunCMake/Syntax/EscapeQuotes-stderr.txt
  71. 1 9
      Tests/RunCMake/Syntax/NameWithCarriageReturn-stderr.txt
  72. 0 1
      Tests/RunCMake/Syntax/NameWithCarriageReturnQuoted-result.txt
  73. 0 12
      Tests/RunCMake/Syntax/NameWithCarriageReturnQuoted-stderr.txt
  74. 2 10
      Tests/RunCMake/Syntax/NameWithEscapedSpaces-stderr.txt
  75. 0 1
      Tests/RunCMake/Syntax/NameWithEscapedSpacesQuoted-result.txt
  76. 0 12
      Tests/RunCMake/Syntax/NameWithEscapedSpacesQuoted-stderr.txt
  77. 2 10
      Tests/RunCMake/Syntax/NameWithEscapedTabs-stderr.txt
  78. 0 1
      Tests/RunCMake/Syntax/NameWithEscapedTabsQuoted-result.txt
  79. 0 12
      Tests/RunCMake/Syntax/NameWithEscapedTabsQuoted-stderr.txt
  80. 1 9
      Tests/RunCMake/Syntax/NameWithNewline-stderr.txt
  81. 0 1
      Tests/RunCMake/Syntax/NameWithNewlineQuoted-result.txt
  82. 0 12
      Tests/RunCMake/Syntax/NameWithNewlineQuoted-stderr.txt
  83. 1 1
      Tests/RunCMake/Syntax/NameWithSpaces-stderr.txt
  84. 1 1
      Tests/RunCMake/Syntax/NameWithSpacesQuoted-stderr.txt
  85. 1 1
      Tests/RunCMake/Syntax/NameWithTabs-stderr.txt
  86. 1 1
      Tests/RunCMake/Syntax/NameWithTabsQuoted-stderr.txt
  87. 0 1
      Tests/RunCMake/Syntax/ParenInENV-result.txt
  88. 0 0
      Tests/RunCMake/Syntax/ParenInENV1-result.txt
  89. 4 4
      Tests/RunCMake/Syntax/ParenInENV1-stderr.txt
  90. 0 0
      Tests/RunCMake/Syntax/ParenInENV1.cmake
  91. 0 0
      Tests/RunCMake/Syntax/ParenInENV2-stderr.txt
  92. 0 1
      Tests/RunCMake/Syntax/ParenInENV2.cmake
  93. 0 1
      Tests/RunCMake/Syntax/ParenInQuotedENV-stderr.txt
  94. 0 0
      Tests/RunCMake/Syntax/ParenInQuotedENV1-result.txt
  95. 13 0
      Tests/RunCMake/Syntax/ParenInQuotedENV1-stderr.txt
  96. 0 0
      Tests/RunCMake/Syntax/ParenInQuotedENV1.cmake
  97. 0 0
      Tests/RunCMake/Syntax/ParenInQuotedENV2-stderr.txt
  98. 0 1
      Tests/RunCMake/Syntax/ParenInQuotedENV2.cmake
  99. 2 2
      Tests/RunCMake/Syntax/ParenInVarName0-stderr.txt
  100. 0 2
      Tests/RunCMake/Syntax/ParenInVarName0.cmake

+ 5 - 4
Help/policy/CMP0053.rst

@@ -1,6 +1,9 @@
 CMP0053
 -------
 
+.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
+.. include:: REMOVED_PROLOGUE.txt
+
 .. versionadded:: 3.1
 
 Simplify variable reference and escape sequence evaluation.
@@ -45,7 +48,5 @@ variable references and escape sequences.  The ``NEW`` behavior is to
 use the simpler variable expansion and escape sequence evaluation rules.
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.1
-.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
-
-.. include:: DEPRECATED.txt
+.. |WARNED_OR_DID_NOT_WARN| replace:: warned
+.. include:: REMOVED_EPILOGUE.txt

+ 0 - 1
Modules/CMakeParseImplicitLinkInfo.cmake

@@ -2,7 +2,6 @@
 # file Copyright.txt or https://cmake.org/licensing for details.
 
 cmake_policy(PUSH)
-cmake_policy(SET CMP0053 NEW)
 cmake_policy(SET CMP0054 NEW)
 
 # Function to parse implicit linker options.

+ 0 - 1
Modules/CMakeParseLibraryArchitecture.cmake

@@ -2,7 +2,6 @@
 # file Copyright.txt or https://cmake.org/licensing for details.
 
 cmake_policy(PUSH)
-cmake_policy(SET CMP0053 NEW)
 cmake_policy(SET CMP0054 NEW)
 
 # Function parse implicit linker options.

+ 0 - 1
Modules/Internal/CMakeDetermineLinkerId.cmake

@@ -7,7 +7,6 @@
 # CMAKE_<lang>_COMPILER_LINKER_VERSION
 
 cmake_policy(PUSH)
-cmake_policy(SET CMP0053 NEW)
 cmake_policy(SET CMP0054 NEW)
 
 function(cmake_determine_linker_id lang linker)

+ 8 - 160
Source/cmMakefile.cxx

@@ -29,7 +29,6 @@
 #include "cmsys/FStream.hxx"
 #include "cmsys/RegularExpression.hxx"
 
-#include "cmCommandArgumentParserHelper.h"
 #include "cmCustomCommand.h"
 #include "cmCustomCommandLines.h"
 #include "cmCustomCommandTypes.h"
@@ -108,8 +107,6 @@ cmMakefile::cmMakefile(cmGlobalGenerator* globalGenerator,
 
   this->CheckSystemVars = this->GetCMakeInstance()->GetCheckSystemVars();
 
-  this->SuppressSideEffects = false;
-
   // Setup the default include complaint regular expression (match nothing).
   this->ComplainFileRegularExpression = "^$";
 
@@ -117,7 +114,6 @@ cmMakefile::cmMakefile(cmGlobalGenerator* globalGenerator,
 
   this->cmDefineRegex.compile("#([ \t]*)cmakedefine[ \t]+([A-Za-z_0-9]*)");
   this->cmDefine01Regex.compile("#([ \t]*)cmakedefine01[ \t]+([A-Za-z_0-9]*)");
-  this->cmAtVarRegex.compile("(@[A-Za-z_0-9/.+-]+@)");
   this->cmNamedCurly.compile("^[A-Za-z0-9/_.+-]+{");
 
   this->StateSnapshot =
@@ -2354,7 +2350,7 @@ cmValue cmMakefile::GetDefinition(const std::string& name) const
   }
 #ifndef CMAKE_BOOTSTRAP
   cmVariableWatch* vv = this->GetVariableWatch();
-  if (vv && !this->SuppressSideEffects) {
+  if (vv) {
     bool const watch_function_executed =
       vv->VariableAccessed(name,
                            def ? cmVariableWatch::VARIABLE_READ_ACCESS
@@ -2398,11 +2394,6 @@ const std::string& cmMakefile::ExpandVariablesInString(
   std::string& source, bool escapeQuotes, bool noEscapes, bool atOnly,
   const char* filename, long line, bool removeEmpty, bool replaceAt) const
 {
-  bool compareResults = false;
-  MessageType mtype = MessageType::LOG;
-  std::string errorstr;
-  std::string original;
-
   // Sanity check the @ONLY mode.
   if (atOnly && (!noEscapes || !removeEmpty)) {
     // This case should never be called.  At-only is for
@@ -2413,163 +2404,20 @@ const std::string& cmMakefile::ExpandVariablesInString(
     return source;
   }
 
-  // Variables used in the WARN case.
-  std::string newResult;
-  std::string newErrorstr;
-  MessageType newError = MessageType::LOG;
-
-  switch (this->GetPolicyStatus(cmPolicies::CMP0053)) {
-    case cmPolicies::WARN: {
-      // Save the original string for the warning.
-      original = source;
-      newResult = source;
-      compareResults = true;
-      // Suppress variable watches to avoid calling hooks twice. Suppress new
-      // dereferences since the OLD behavior is still what is actually used.
-      this->SuppressSideEffects = true;
-      newError = this->ExpandVariablesInStringNew(
-        newErrorstr, newResult, escapeQuotes, noEscapes, atOnly, filename,
-        line, replaceAt);
-      this->SuppressSideEffects = false;
-      CM_FALLTHROUGH;
-    }
-    case cmPolicies::OLD:
-      mtype = this->ExpandVariablesInStringOld(errorstr, source, escapeQuotes,
-                                               noEscapes, atOnly, filename,
-                                               line, removeEmpty, true);
-      break;
-    // Messaging here would be *very* verbose.
-    case cmPolicies::NEW:
-      mtype = this->ExpandVariablesInStringNew(errorstr, source, escapeQuotes,
-                                               noEscapes, atOnly, filename,
-                                               line, replaceAt);
-      break;
-  }
-
-  // If it's an error in either case, just report the error...
+  std::string errorstr;
+  MessageType mtype = this->ExpandVariablesInStringImpl(
+    errorstr, source, escapeQuotes, noEscapes, atOnly, filename, line,
+    replaceAt);
   if (mtype != MessageType::LOG) {
     if (mtype == MessageType::FATAL_ERROR) {
       cmSystemTools::SetFatalErrorOccurred();
     }
     this->IssueMessage(mtype, errorstr);
   }
-  // ...otherwise, see if there's a difference that needs to be warned about.
-  else if (compareResults && (newResult != source || newError != mtype)) {
-    auto msg =
-      cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0053), '\n');
-
-    std::string msg_input = original;
-    cmSystemTools::ReplaceString(msg_input, "\n", "\n  ");
-
-    std::string msg_old = source;
-    cmSystemTools::ReplaceString(msg_old, "\n", "\n  ");
-
-    msg += cmStrCat("For input:\n  '", msg_input, "'\n",
-                    "the old evaluation rules produce:\n  '", msg_old, "'\n");
-
-    if (newError == mtype) {
-      std::string msg_new = newResult;
-      cmSystemTools::ReplaceString(msg_new, "\n", "\n  ");
-      msg +=
-        cmStrCat("but the new evaluation rules produce:\n  '", msg_new, "'\n");
-    } else {
-      std::string msg_err = newErrorstr;
-      cmSystemTools::ReplaceString(msg_err, "\n", "\n  ");
-      msg += cmStrCat("but the new evaluation rules produce an error:\n  ",
-                      msg_err, '\n');
-    }
-
-    msg +=
-      "Using the old result for compatibility since the policy is not set.";
-
-    this->IssueMessage(MessageType::AUTHOR_WARNING, msg);
-  }
 
   return source;
 }
 
-MessageType cmMakefile::ExpandVariablesInStringOld(
-  std::string& errorstr, std::string& source, bool escapeQuotes,
-  bool noEscapes, bool atOnly, const char* filename, long line,
-  bool removeEmpty, bool replaceAt) const
-{
-  // Fast path strings without any special characters.
-  if (source.find_first_of("$@\\") == std::string::npos) {
-    return MessageType::LOG;
-  }
-
-  // Special-case the @ONLY mode.
-  if (atOnly) {
-    // Store an original copy of the input.
-    std::string input = source;
-
-    // Start with empty output.
-    source.clear();
-
-    // Look for one @VAR@ at a time.
-    const char* in = input.c_str();
-    while (this->cmAtVarRegex.find(in)) {
-      // Get the range of the string to replace.
-      const char* first = in + this->cmAtVarRegex.start();
-      const char* last = in + this->cmAtVarRegex.end();
-
-      // Store the unchanged part of the string now.
-      source.append(in, first - in);
-
-      // Lookup the definition of VAR.
-      std::string var(first + 1, last - first - 2);
-      if (cmValue val = this->GetDefinition(var)) {
-        // Store the value in the output escaping as requested.
-        if (escapeQuotes) {
-          source.append(cmEscapeQuotes(*val));
-        } else {
-          source.append(*val);
-        }
-      }
-
-      // Continue looking for @VAR@ further along the string.
-      in = last;
-    }
-
-    // Append the rest of the unchanged part of the string.
-    source.append(in);
-
-    return MessageType::LOG;
-  }
-
-  // This method replaces ${VAR} and @VAR@ where VAR is looked up
-  // with GetDefinition(), if not found in the map, nothing is expanded.
-  // It also supports the $ENV{VAR} syntax where VAR is looked up in
-  // the current environment variables.
-
-  cmCommandArgumentParserHelper parser;
-  parser.SetMakefile(this);
-  parser.SetLineFile(line, filename);
-  parser.SetEscapeQuotes(escapeQuotes);
-  parser.SetNoEscapeMode(noEscapes);
-  parser.SetReplaceAtSyntax(replaceAt);
-  parser.SetRemoveEmpty(removeEmpty);
-  int res = parser.ParseString(source, 0);
-  const char* emsg = parser.GetError();
-  MessageType mtype = MessageType::LOG;
-  if (res && !emsg[0]) {
-    source = parser.GetResult();
-  } else {
-    // Construct the main error message.
-    std::string error = "Syntax error in cmake code ";
-    if (filename && line > 0) {
-      // This filename and line number may be more specific than the
-      // command context because one command invocation can have
-      // arguments on multiple lines.
-      error += cmStrCat("at\n  ", filename, ':', line, '\n');
-    }
-    error += cmStrCat("when parsing string\n  ", source, '\n', emsg);
-    mtype = MessageType::FATAL_ERROR;
-    errorstr = std::move(error);
-  }
-  return mtype;
-}
-
 enum t_domain
 {
   NORMAL,
@@ -2680,7 +2528,7 @@ cm::optional<std::string> cmMakefile::DeferGetCall(std::string const& id) const
   return call;
 }
 
-MessageType cmMakefile::ExpandVariablesInStringNew(
+MessageType cmMakefile::ExpandVariablesInStringImpl(
   std::string& errorstr, std::string& source, bool escapeQuotes,
   bool noEscapes, bool atOnly, const char* filename, long line,
   bool replaceAt) const
@@ -2743,7 +2591,7 @@ MessageType cmMakefile::ExpandVariablesInStringNew(
             } else {
               varresult = *value;
             }
-          } else if (!this->SuppressSideEffects) {
+          } else {
             this->MaybeWarnUninitialized(lookup, filename);
           }
           result.replace(var.loc, result.size() - var.loc, varresult);
@@ -2859,7 +2707,7 @@ MessageType cmMakefile::ExpandVariablesInStringNew(
               cmValue def = this->GetDefinition(variable);
               if (def) {
                 varresult = *def;
-              } else if (!this->SuppressSideEffects) {
+              } else {
                 this->MaybeWarnUninitialized(variable, filename);
               }
             }

+ 5 - 15
Source/cmMakefile.h

@@ -1197,7 +1197,6 @@ private:
 
   mutable cmsys::RegularExpression cmDefineRegex;
   mutable cmsys::RegularExpression cmDefine01Regex;
-  mutable cmsys::RegularExpression cmAtVarRegex;
   mutable cmsys::RegularExpression cmNamedCurly;
 
   std::vector<cmMakefile*> UnConfiguredDirectories;
@@ -1239,19 +1238,11 @@ private:
   class BuildsystemFileScope;
   friend class BuildsystemFileScope;
 
-  // CMP0053 == old
-  MessageType ExpandVariablesInStringOld(std::string& errorstr,
-                                         std::string& source,
-                                         bool escapeQuotes, bool noEscapes,
-                                         bool atOnly, const char* filename,
-                                         long line, bool removeEmpty,
-                                         bool replaceAt) const;
-  // CMP0053 == new
-  MessageType ExpandVariablesInStringNew(std::string& errorstr,
-                                         std::string& source,
-                                         bool escapeQuotes, bool noEscapes,
-                                         bool atOnly, const char* filename,
-                                         long line, bool replaceAt) const;
+  MessageType ExpandVariablesInStringImpl(std::string& errorstr,
+                                          std::string& source,
+                                          bool escapeQuotes, bool noEscapes,
+                                          bool atOnly, const char* filename,
+                                          long line, bool replaceAt) const;
 
   bool ValidateCustomCommand(const cmCustomCommandLines& commandLines) const;
 
@@ -1270,6 +1261,5 @@ private:
   std::set<std::string> WarnedCMP0074;
   std::set<std::string> WarnedCMP0144;
   bool IsSourceFileTryCompile;
-  mutable bool SuppressSideEffects;
   ImportedTargetScope CurrentImportedTargetScope = ImportedTargetScope::Local;
 };

+ 1 - 1
Source/cmPolicies.h

@@ -158,7 +158,7 @@ class cmMakefile;
          3, 1, 0, NEW)                                                        \
   SELECT(POLICY, CMP0053,                                                     \
          "Simplify variable reference and escape sequence evaluation.", 3, 1, \
-         0, WARN)                                                             \
+         0, NEW)                                                              \
   SELECT(                                                                     \
     POLICY, CMP0054,                                                          \
     "Only interpret if() arguments as variables or keywords when unquoted.",  \

+ 1 - 1
Tests/CMakeTests/StringTest.cmake.in

@@ -84,7 +84,7 @@ check_cmake_test(String
 # Execute each test listed in StringTestScript.cmake:
 #
 set(scriptname "@CMAKE_CURRENT_SOURCE_DIR@/StringTestScript.cmake")
-set(number_of_tests_expected 74)
+set(number_of_tests_expected 72)
 
 include("@CMAKE_CURRENT_SOURCE_DIR@/ExecuteScriptTests.cmake")
 execute_all_script_tests(${scriptname} number_of_tests_executed)

+ 3 - 12
Tests/CMakeTests/StringTestScript.cmake

@@ -1,8 +1,6 @@
 message(STATUS "testname='${testname}'")
 
-function(test_configure_line_number EXPRESSION POLICY)
-  cmake_policy(PUSH)
-  cmake_policy(SET CMP0053 ${POLICY})
+function(test_configure_line_number EXPRESSION)
   string(CONFIGURE
   "${EXPRESSION}" v) # line should indicate string() call
   math(EXPR vplus3 "${v} + 3")
@@ -10,7 +8,6 @@ function(test_configure_line_number EXPRESSION POLICY)
     message(SEND_ERROR "Couldn't configure CMAKE_CURRENT_LIST_LINE, evaluated into '${v}'")
   endif()
   message(STATUS "v='${v}'")
-  cmake_policy(POP)
 endfunction()
 
 if(testname STREQUAL empty) # fail
@@ -45,16 +42,10 @@ elseif(testname STREQUAL configure_escape_quotes) # pass
   string(CONFIGURE "this is @testname@" v ESCAPE_QUOTES)
   message(STATUS "v='${v}'")
 
-elseif(testname STREQUAL configure_line_number_CMP0053_old) # pass
-  test_configure_line_number("\${CMAKE_CURRENT_LIST_LINE}" OLD)
-
-elseif(testname STREQUAL configure_line_number_CMP0053_new) # pass
+elseif(testname STREQUAL configure_line_number_curly) # pass
   test_configure_line_number("\${CMAKE_CURRENT_LIST_LINE}" NEW)
 
-elseif(testname STREQUAL configure_line_number_CMP0053_old_use_at) # pass
-  test_configure_line_number("\@CMAKE_CURRENT_LIST_LINE\@" OLD)
-
-elseif(testname STREQUAL configure_line_number_CMP0053_new_use_at) # pass
+elseif(testname STREQUAL configure_line_number_at) # pass
   test_configure_line_number("\@CMAKE_CURRENT_LIST_LINE\@" NEW)
 
 elseif(testname STREQUAL configure_bogus) # fail

+ 0 - 13
Tests/RunCMake/CMP0053/CMP0053-OLD-stderr.txt

@@ -1,13 +0,0 @@
-^CMake Deprecation Warning at CMP0053-OLD.cmake:1 \(cmake_policy\):
-  The OLD behavior for policy CMP0053 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:3 \(include\)
-+
-called
---><--$

+ 0 - 8
Tests/RunCMake/CMP0053/CMP0053-OLD.cmake

@@ -1,8 +0,0 @@
-cmake_policy(SET CMP0053 OLD)
-
-function (watch_callback)
-  message("called")
-endfunction ()
-
-variable_watch(test watch_callback)
-message("-->${test}<--")

+ 0 - 2
Tests/RunCMake/CMP0053/CMP0053-WARN-stderr.txt

@@ -1,2 +0,0 @@
-^called
---><--$

+ 0 - 6
Tests/RunCMake/CMP0053/CMP0053-WARN.cmake

@@ -1,6 +0,0 @@
-function (watch_callback)
-  message("called")
-endfunction ()
-
-variable_watch(test watch_callback)
-message("-->${test}<--")

+ 1 - 1
Tests/RunCMake/CMP0053/CMakeLists.txt

@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 3.0)
+cmake_minimum_required(VERSION 3.10)
 project(${RunCMake_TEST} CXX)
 include(${RunCMake_TEST}.cmake)

+ 0 - 3
Tests/RunCMake/CMP0053/RunCMakeTest.cmake

@@ -1,6 +1,3 @@
 include(RunCMake)
-set(RunCMake_IGNORE_POLICY_VERSION_DEPRECATION ON)
 
-run_cmake(CMP0053-OLD)
 run_cmake(CMP0053-NEW)
-run_cmake(CMP0053-WARN)

+ 1 - 1
Tests/RunCMake/CMakePresets/RunCMakeTest.cmake

@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.19) # CMP0053
+cmake_minimum_required(VERSION 3.19)
 
 include(RunCMake)
 

+ 0 - 3
Tests/RunCMake/CommandLine/trace-expand-warn-uninitialized.cmake

@@ -1,4 +1 @@
-cmake_policy(SET CMP0053 OLD)
-message(STATUS "'${uninitialized_variable}'")
-cmake_policy(SET CMP0053 NEW)
 message(STATUS "'${uninitialized_variable}'")

+ 4 - 34
Tests/RunCMake/CommandLine/warn-uninitialized-stderr.txt

@@ -1,52 +1,22 @@
-^CMake Warning \(dev\) at warn-uninitialized.cmake:3 \(set\):
-  uninitialized variable 'OLD_WARN_FROM_NORMAL_CMAKE_FILE_INSIDE_BRACES'
-Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)
-This warning is for project developers.  Use -Wno-dev to suppress it.
-
-CMake Warning \(dev\) at warn-uninitialized.cmake:4 \(set\):
-  uninitialized variable 'OLD_WARN_FROM_NORMAL_CMAKE_FILE_IN_ATS'
-Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)
-This warning is for project developers.  Use -Wno-dev to suppress it.
-
-CMake Warning \(dev\) at warn-uninitialized.cmake:5 \(string\):
-  uninitialized variable 'OLD_WARN_FROM_STRING_CONFIGURE_INSIDE_BRACES'
-Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)
-This warning is for project developers.  Use -Wno-dev to suppress it.
-
-CMake Warning \(dev\) at warn-uninitialized.cmake:7 \(configure_file\):
-  uninitialized variable 'OLD_WARN_FROM_CONFIGURE_FILE_INSIDE_AT'
-Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)
-This warning is for project developers.  Use -Wno-dev to suppress it.
-
-CMake Warning \(dev\) at warn-uninitialized.cmake:8 \(string\):
-  uninitialized variable 'OLD_WARN_FROM_STRING_CONFIGURE_INSIDE_AT'
-Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)
-This warning is for project developers.  Use -Wno-dev to suppress it.
-
-CMake Warning \(dev\) at warn-uninitialized.cmake:13 \(set\):
+CMake Warning \(dev\) at warn-uninitialized.cmake:1 \(set\):
   uninitialized variable 'NEW_WARN_FROM_NORMAL_CMAKE_FILE_INSIDE_BRACES'
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)
 This warning is for project developers.  Use -Wno-dev to suppress it.
 
-CMake Warning \(dev\) at warn-uninitialized.cmake:14 \(string\):
+CMake Warning \(dev\) at warn-uninitialized.cmake:2 \(string\):
   uninitialized variable 'NEW_WARN_FROM_STRING_CONFIGURE_INSIDE_BRACES'
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)
 This warning is for project developers.  Use -Wno-dev to suppress it.
 
-CMake Warning \(dev\) at warn-uninitialized.cmake:16 \(configure_file\):
+CMake Warning \(dev\) at warn-uninitialized.cmake:4 \(configure_file\):
   uninitialized variable 'NEW_WARN_FROM_CONFIGURE_FILE_INSIDE_AT'
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)
 This warning is for project developers.  Use -Wno-dev to suppress it.
 
-CMake Warning \(dev\) at warn-uninitialized.cmake:17 \(string\):
+CMake Warning \(dev\) at warn-uninitialized.cmake:5 \(string\):
   uninitialized variable 'NEW_WARN_FROM_STRING_CONFIGURE_INSIDE_AT'
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)

+ 0 - 13
Tests/RunCMake/CommandLine/warn-uninitialized.cmake

@@ -1,18 +1,5 @@
-cmake_policy(PUSH)
-cmake_policy(SET CMP0053 OLD)
-set(FOO "${OLD_WARN_FROM_NORMAL_CMAKE_FILE_INSIDE_BRACES}")
-set(FOO "@OLD_WARN_FROM_NORMAL_CMAKE_FILE_IN_ATS@")
-string(CONFIGURE "\${OLD_WARN_FROM_STRING_CONFIGURE_INSIDE_BRACES}" OUT1)
-file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/file1.in "\@OLD_WARN_FROM_CONFIGURE_FILE_INSIDE_AT\@")
-configure_file(${CMAKE_CURRENT_BINARY_DIR}/file1.in file1.out)
-string(CONFIGURE "\@OLD_WARN_FROM_STRING_CONFIGURE_INSIDE_AT\@" OUT2)
-cmake_policy(POP)
-
-cmake_policy(PUSH)
-cmake_policy(SET CMP0053 NEW)
 set(FOO "${NEW_WARN_FROM_NORMAL_CMAKE_FILE_INSIDE_BRACES}")
 string(CONFIGURE "\${NEW_WARN_FROM_STRING_CONFIGURE_INSIDE_BRACES}" OUT3)
 file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/file2.in "\@NEW_WARN_FROM_CONFIGURE_FILE_INSIDE_AT\@")
 configure_file(${CMAKE_CURRENT_BINARY_DIR}/file2.in file2.out)
 string(CONFIGURE "@NEW_WARN_FROM_STRING_CONFIGURE_INSIDE_AT@" OUT4)
-cmake_policy(POP)

+ 0 - 0
Tests/RunCMake/Syntax/CMP0053-At-NEW-stderr.txt → Tests/RunCMake/Syntax/At-stderr.txt


+ 0 - 2
Tests/RunCMake/Syntax/CMP0053-At-NEW.cmake → Tests/RunCMake/Syntax/At.cmake

@@ -1,5 +1,3 @@
-cmake_policy(SET CMP0053 NEW)
-
 set(right "wrong")
 set(var "\${right}")
 # Not expanded here with the new policy.

+ 1 - 1
Tests/RunCMake/Syntax/AtWithVariable-stderr.txt

@@ -1 +1 @@
--->wrong<--
+-->\${right}<--

+ 0 - 12
Tests/RunCMake/Syntax/CMP0053-At-OLD-stderr.txt

@@ -1,12 +0,0 @@
-^CMake Deprecation Warning at CMP0053-At-OLD.cmake:1 \(cmake_policy\):
-  The OLD behavior for policy CMP0053 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:3 \(include\)
-+
--->wrong<--$

+ 0 - 9
Tests/RunCMake/Syntax/CMP0053-At-OLD.cmake

@@ -1,9 +0,0 @@
-cmake_policy(SET CMP0053 OLD)
-
-set(right "wrong")
-set(var "\${right}")
-# Expanded here with the old policy.
-set(ref "@var@")
-
-string(CONFIGURE "${ref}" output)
-message("-->${output}<--")

+ 0 - 27
Tests/RunCMake/Syntax/CMP0053-At-WARN-newlines-stderr.txt

@@ -1,27 +0,0 @@
-^CMake Warning \(dev\) at CMP0053-At-WARN-newlines.cmake:4 \(set\):
-  Policy CMP0053 is not set: Simplify variable reference and escape sequence
-  evaluation.  Run "cmake --help-policy CMP0053" for policy details.  Use the
-  cmake_policy command to set the policy and suppress this warning.
-
-  For input:
-
-    '
-    @var@
-    '
-
-  the old evaluation rules produce:
-
-    '
-    \${right}
-    '
-
-  but the new evaluation rules produce:
-
-    '
-    @var@
-    '
-
-  Using the old result for compatibility since the policy is not set.
-Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)
-This warning is for project developers.  Use -Wno-dev to suppress it.$

+ 0 - 6
Tests/RunCMake/Syntax/CMP0053-At-WARN-newlines.cmake

@@ -1,6 +0,0 @@
-set(right "wrong")
-set(var "\${right}")
-# Expanded here with the old policy.
-set(ref "
-@var@
-")

+ 0 - 21
Tests/RunCMake/Syntax/CMP0053-At-WARN-stderr.txt

@@ -1,21 +0,0 @@
-^CMake Warning \(dev\) at CMP0053-At-WARN.cmake:4 \(set\):
-  Policy CMP0053 is not set: Simplify variable reference and escape sequence
-  evaluation.  Run "cmake --help-policy CMP0053" for policy details.  Use the
-  cmake_policy command to set the policy and suppress this warning.
-
-  For input:
-
-    '@var@'
-
-  the old evaluation rules produce:
-
-    '\${right}'
-
-  but the new evaluation rules produce:
-
-    '@var@'
-
-  Using the old result for compatibility since the policy is not set.
-Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)
-This warning is for project developers.  Use -Wno-dev to suppress it.$

+ 0 - 4
Tests/RunCMake/Syntax/CMP0053-At-WARN.cmake

@@ -1,4 +0,0 @@
-set(right "wrong")
-set(var "\${right}")
-# Expanded here with the old policy.
-set(ref "@var@")

+ 0 - 24
Tests/RunCMake/Syntax/CMP0053-Dollar-OLD-stderr.txt

@@ -1,24 +0,0 @@
-^CMake Deprecation Warning at CMP0053-Dollar-OLD.cmake:1 \(cmake_policy\):
-  The OLD behavior for policy CMP0053 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:3 \(include\)
-+
--->value<--
-CMake Error at CMP0053-Dollar-OLD.cmake:6 \(message\):
-  Syntax error in cmake code at
-
-    .*CMP0053-Dollar-OLD.cmake:6
-
-  when parsing string
-
-    -->\${\$}<--
-
-  syntax error, unexpected \$, expecting } \(6\)
-Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)$

+ 0 - 6
Tests/RunCMake/Syntax/CMP0053-Dollar-OLD.cmake

@@ -1,6 +0,0 @@
-cmake_policy(SET CMP0053 OLD)
-
-set($ value)
-set(dollar $)
-message("-->${${dollar}}<--")
-message("-->${$}<--")

+ 0 - 56
Tests/RunCMake/Syntax/CMP0053-NUL-stderr.txt

@@ -1,56 +0,0 @@
-^CMake Warning \(dev\) at CMP0053-NUL.cmake:1 \(set\):
-  Policy CMP0053 is not set: Simplify variable reference and escape sequence
-  evaluation.  Run "cmake --help-policy CMP0053" for policy details.  Use the
-  cmake_policy command to set the policy and suppress this warning.
-
-  For input:
-
-    '\\0'
-
-  the old evaluation rules produce:
-
-    ''
-
-  but the new evaluation rules produce an error:
-
-    Syntax error in cmake code at
-      .*/Tests/RunCMake/Syntax/CMP0053-NUL.cmake:1
-    when parsing string
-      \\0
-    Invalid character escape '\\0'.
-
-  Using the old result for compatibility since the policy is not set.
-Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)
-This warning is for project developers.  Use -Wno-dev to suppress it.
-
-CMake Warning \(dev\) at CMP0053-NUL.cmake:2 \(set\):
-  Policy CMP0053 is not set: Simplify variable reference and escape sequence
-  evaluation.  Run "cmake --help-policy CMP0053" for policy details.  Use the
-  cmake_policy command to set the policy and suppress this warning.
-
-  For input:
-
-    '\\0'
-
-  the old evaluation rules produce:
-
-    ''
-
-  but the new evaluation rules produce an error:
-
-    Syntax error in cmake code at
-      .*/Tests/RunCMake/Syntax/CMP0053-NUL.cmake:2
-    when parsing string
-      \\0
-    Invalid character escape '\\0'.
-
-  Using the old result for compatibility since the policy is not set.
-Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)
-This warning is for project developers.  Use -Wno-dev to suppress it.
-
---><--
---><--
---><--
---><--$

+ 0 - 6
Tests/RunCMake/Syntax/CMP0053-NUL.cmake

@@ -1,6 +0,0 @@
-set(qnul "\0")
-set(nul \0)
-message(-->${nul}<--)
-message(-->${qnul}<--)
-message("-->${nul}<--")
-message("-->${qnul}<--")

+ 0 - 4
Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturn-stderr.txt

@@ -1,4 +0,0 @@
-^CMake Error at CMP0053-NameWithCarriageReturn.cmake:2 \(message\):
-  message called with incorrect number of arguments
-Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)$

+ 0 - 2
Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturn.cmake

@@ -1,2 +0,0 @@
-cmake_policy(SET CMP0053 NEW)
-message(${var\rwith\rcarriagereturn})

+ 0 - 2
Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturnQuoted.cmake

@@ -1,2 +0,0 @@
-cmake_policy(SET CMP0053 NEW)
-message("${var\rwith\rcarriagereturn}")

+ 0 - 1
Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpaces-result.txt

@@ -1 +0,0 @@
-1

+ 0 - 4
Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpaces-stderr.txt

@@ -1,4 +0,0 @@
-^CMake Error at CMP0053-NameWithEscapedSpaces.cmake:2 \(message\):
-  message called with incorrect number of arguments
-Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)

+ 0 - 2
Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpaces.cmake

@@ -1,2 +0,0 @@
-cmake_policy(SET CMP0053 NEW)
-message(${var\ with\ escaped\ space})

+ 0 - 2
Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpacesQuoted.cmake

@@ -1,2 +0,0 @@
-cmake_policy(SET CMP0053 NEW)
-message("${var\ with\ escaped\ space}")

+ 0 - 1
Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabs-result.txt

@@ -1 +0,0 @@
-1

+ 0 - 4
Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabs-stderr.txt

@@ -1,4 +0,0 @@
-^CMake Error at CMP0053-NameWithEscapedTabs.cmake:2 \(message\):
-  message called with incorrect number of arguments
-Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)

+ 0 - 2
Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabs.cmake

@@ -1,2 +0,0 @@
-cmake_policy(SET CMP0053 NEW)
-message(${var\	with\	escaped\	tab})

+ 0 - 2
Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabsQuoted.cmake

@@ -1,2 +0,0 @@
-cmake_policy(SET CMP0053 NEW)
-message("${var\	with\	escaped\	tab}")

+ 0 - 1
Tests/RunCMake/Syntax/CMP0053-NameWithNewline-result.txt

@@ -1 +0,0 @@
-1

+ 0 - 4
Tests/RunCMake/Syntax/CMP0053-NameWithNewline-stderr.txt

@@ -1,4 +0,0 @@
-^CMake Error at CMP0053-NameWithNewline.cmake:2 \(message\):
-  message called with incorrect number of arguments
-Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)$

+ 0 - 2
Tests/RunCMake/Syntax/CMP0053-NameWithNewline.cmake

@@ -1,2 +0,0 @@
-cmake_policy(SET CMP0053 NEW)
-message(${var\nwith\nnewline})

+ 0 - 2
Tests/RunCMake/Syntax/CMP0053-NameWithNewlineQuoted.cmake

@@ -1,2 +0,0 @@
-cmake_policy(SET CMP0053 NEW)
-message("${var\nwith\nnewline}")

+ 0 - 1
Tests/RunCMake/Syntax/CMP0053-NameWithSpaces-result.txt

@@ -1 +0,0 @@
-1

+ 0 - 12
Tests/RunCMake/Syntax/CMP0053-NameWithSpaces-stderr.txt

@@ -1,12 +0,0 @@
-^CMake Error at CMP0053-NameWithSpaces.cmake:2 \(message\):
-  Syntax error in cmake code at
-
-    .*/Tests/RunCMake/Syntax/CMP0053-NameWithSpaces.cmake:2
-
-  when parsing string
-
-    \${var
-
-  There is an unterminated variable reference.
-Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)$

+ 0 - 2
Tests/RunCMake/Syntax/CMP0053-NameWithSpaces.cmake

@@ -1,2 +0,0 @@
-cmake_policy(SET CMP0053 NEW)
-message(${var with space})

+ 0 - 1
Tests/RunCMake/Syntax/CMP0053-NameWithSpacesQuoted-result.txt

@@ -1 +0,0 @@
-1

+ 0 - 12
Tests/RunCMake/Syntax/CMP0053-NameWithSpacesQuoted-stderr.txt

@@ -1,12 +0,0 @@
-^CMake Error at CMP0053-NameWithSpacesQuoted.cmake:2 \(message\):
-  Syntax error in cmake code at
-
-    .*/Tests/RunCMake/Syntax/CMP0053-NameWithSpacesQuoted.cmake:2
-
-  when parsing string
-
-    \${var with space}
-
-  Invalid character \(' '\) in a variable name: 'var'
-Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)$

+ 0 - 2
Tests/RunCMake/Syntax/CMP0053-NameWithSpacesQuoted.cmake

@@ -1,2 +0,0 @@
-cmake_policy(SET CMP0053 NEW)
-message("${var with space}")

+ 0 - 1
Tests/RunCMake/Syntax/CMP0053-NameWithTabs-result.txt

@@ -1 +0,0 @@
-1

+ 0 - 12
Tests/RunCMake/Syntax/CMP0053-NameWithTabs-stderr.txt

@@ -1,12 +0,0 @@
-^CMake Error at CMP0053-NameWithTabs.cmake:2 \(message\):
-  Syntax error in cmake code at
-
-    .*/Tests/RunCMake/Syntax/CMP0053-NameWithTabs.cmake:2
-
-  when parsing string
-
-    \${var
-
-  There is an unterminated variable reference.
-Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)$

+ 0 - 2
Tests/RunCMake/Syntax/CMP0053-NameWithTabs.cmake

@@ -1,2 +0,0 @@
-cmake_policy(SET CMP0053 NEW)
-message(${var	with	tab})

+ 0 - 1
Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted-result.txt

@@ -1 +0,0 @@
-1

+ 0 - 12
Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted-stderr.txt

@@ -1,12 +0,0 @@
-^CMake Error at CMP0053-NameWithTabsQuoted.cmake:2 \(message\):
-  Syntax error in cmake code at
-
-    .*/Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted.cmake:2
-
-  when parsing string
-
-    \${var	with	tab}
-
-  Invalid character \('	'\) in a variable name: 'var'
-Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)$

+ 0 - 2
Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted.cmake

@@ -1,2 +0,0 @@
-cmake_policy(SET CMP0053 NEW)
-message("${var	with	tab}")

+ 0 - 28
Tests/RunCMake/Syntax/CMP0053-WARN-stderr.txt

@@ -1,28 +0,0 @@
-^CMake Warning \(dev\) at CMP0053-WARN.cmake:2 \(message\):
-  Policy CMP0053 is not set: Simplify variable reference and escape sequence
-  evaluation.  Run "cmake --help-policy CMP0053" for policy details.  Use the
-  cmake_policy command to set the policy and suppress this warning.
-
-  For input:
-
-    '\\'
-
-  the old evaluation rules produce:
-
-    '\\'
-
-  but the new evaluation rules produce an error:
-
-    Syntax error in cmake code at
-      .*/Tests/RunCMake/Syntax/CMP0053-WARN.cmake:2
-    when parsing string
-      \\
-    Invalid character escape '\\' \(at end of input\).
-
-  Using the old result for compatibility since the policy is not set.
-Call Stack \(most recent call first\):
-  CMP0053-WARN.cmake:5 \(escape\)
-  CMakeLists.txt:3 \(include\)
-This warning is for project developers.  Use -Wno-dev to suppress it.
-
-\\$

+ 0 - 5
Tests/RunCMake/Syntax/CMP0053-WARN.cmake

@@ -1,5 +0,0 @@
-macro (escape str)
-  message("${str}")
-endmacro ()
-
-escape("\\")

+ 1 - 1
Tests/RunCMake/Syntax/CMakeLists.txt

@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 3.0)
+cmake_minimum_required(VERSION 3.10)
 project(${RunCMake_TEST} NONE)
 include(${RunCMake_TEST}.cmake)

+ 0 - 0
Tests/RunCMake/Syntax/CMP0053-Dollar-NEW-stderr.txt → Tests/RunCMake/Syntax/Dollar-stderr.txt


+ 0 - 2
Tests/RunCMake/Syntax/CMP0053-Dollar-NEW.cmake → Tests/RunCMake/Syntax/Dollar.cmake

@@ -1,5 +1,3 @@
-cmake_policy(SET CMP0053 NEW)
-
 set($ value)
 set(dollar $)
 message("-->${${dollar}}<--")

+ 3 - 3
Tests/RunCMake/Syntax/Escape2-stderr.txt

@@ -1,7 +1,7 @@
-CMake Error at Escape2.cmake:4 \(message\):
+CMake Error at Escape2.cmake:2 \(message\):
   Syntax error in cmake code at
 
-    .*/Tests/RunCMake/Syntax/Escape2.cmake:4
+    .*/Tests/RunCMake/Syntax/Escape2.cmake:2
 
   when parsing string
 
@@ -9,5 +9,5 @@ CMake Error at Escape2.cmake:4 \(message\):
 
   Invalid character escape '\\' \(at end of input\).
 Call Stack \(most recent call first\):
-  Escape2.cmake:7 \(escape\)
+  Escape2.cmake:5 \(escape\)
   CMakeLists.txt:3 \(include\)

+ 0 - 2
Tests/RunCMake/Syntax/Escape2.cmake

@@ -1,5 +1,3 @@
-cmake_policy(SET CMP0053 NEW)
-
 macro (escape str)
   message("${str}")
 endmacro ()

+ 2 - 2
Tests/RunCMake/Syntax/EscapeChar-char-stderr.txt.in

@@ -1,7 +1,7 @@
-CMake Error at EscapeChar-@char@-@[email protected]:3 \(message\):
+CMake Error at EscapeChar-@char@-@[email protected]:1 \(message\):
   Syntax error in cmake code at
 
-    .*/Tests/RunCMake/Syntax/EscapeChar-@char@-@[email protected]:3
+    .*/Tests/RunCMake/Syntax/EscapeChar-@char@-@[email protected]:1
 
   when parsing string
 

+ 0 - 2
Tests/RunCMake/Syntax/EscapeChar-char.cmake.in

@@ -1,3 +1 @@
-cmake_policy(SET CMP0053 NEW)
-
 message("-->\@char@<--")

+ 0 - 2
Tests/RunCMake/Syntax/EscapeCharsAllowed.cmake

@@ -1,5 +1,3 @@
-cmake_policy(SET CMP0053 NEW)
-
 set("semicolon;in;name" semicolon)
 set("dollar$in$name" dollar)
 set("brace{in}name" brace)

+ 2 - 1
Tests/RunCMake/Syntax/EscapeQuotes-stderr.txt

@@ -1 +1,2 @@
--->"<--
+^-->\\"<--
+-->\\"<--$

+ 1 - 9
Tests/RunCMake/Syntax/NameWithCarriageReturn-stderr.txt

@@ -1,12 +1,4 @@
 ^CMake Error at NameWithCarriageReturn.cmake:1 \(message\):
-  Syntax error in cmake code at
-
-    .*/Tests/RunCMake/Syntax/NameWithCarriageReturn.cmake:1
-
-  when parsing string
-
-    \${var\\rwith\\rcarriagereturn}
-
-  syntax error, unexpected cal_SYMBOL, expecting } \(6\)
+  message called with incorrect number of arguments
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)$

+ 0 - 1
Tests/RunCMake/Syntax/NameWithCarriageReturnQuoted-result.txt

@@ -1 +0,0 @@
-1

+ 0 - 12
Tests/RunCMake/Syntax/NameWithCarriageReturnQuoted-stderr.txt

@@ -1,12 +0,0 @@
-^CMake Error at NameWithCarriageReturnQuoted.cmake:1 \(message\):
-  Syntax error in cmake code at
-
-    .*/Tests/RunCMake/Syntax/NameWithCarriageReturnQuoted.cmake:1
-
-  when parsing string
-
-    \${var\\rwith\\rcarriagereturn}
-
-  syntax error, unexpected cal_SYMBOL, expecting } \(6\)
-Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)$

+ 2 - 10
Tests/RunCMake/Syntax/NameWithEscapedSpaces-stderr.txt

@@ -1,12 +1,4 @@
 ^CMake Error at NameWithEscapedSpaces.cmake:1 \(message\):
-  Syntax error in cmake code at
-
-    .*/Tests/RunCMake/Syntax/NameWithEscapedSpaces.cmake:1
-
-  when parsing string
-
-    \${var\\ with\\ escaped\\ space}
-
-  syntax error, unexpected cal_SYMBOL, expecting } \(6\)
+  message called with incorrect number of arguments
 Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)$
+  CMakeLists.txt:3 \(include\)

+ 0 - 1
Tests/RunCMake/Syntax/NameWithEscapedSpacesQuoted-result.txt

@@ -1 +0,0 @@
-1

+ 0 - 12
Tests/RunCMake/Syntax/NameWithEscapedSpacesQuoted-stderr.txt

@@ -1,12 +0,0 @@
-^CMake Error at NameWithEscapedSpacesQuoted.cmake:1 \(message\):
-  Syntax error in cmake code at
-
-    .*/Tests/RunCMake/Syntax/NameWithEscapedSpacesQuoted.cmake:1
-
-  when parsing string
-
-    \${var\\ with\\ escaped\\ space}
-
-  syntax error, unexpected cal_SYMBOL, expecting } \(6\)
-Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)$

+ 2 - 10
Tests/RunCMake/Syntax/NameWithEscapedTabs-stderr.txt

@@ -1,12 +1,4 @@
 ^CMake Error at NameWithEscapedTabs.cmake:1 \(message\):
-  Syntax error in cmake code at
-
-    .*/Tests/RunCMake/Syntax/NameWithEscapedTabs.cmake:1
-
-  when parsing string
-
-    \${var\\	with\\	escaped\\	tab}
-
-  Invalid escape sequence \\.?
+  message called with incorrect number of arguments
 Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)$
+  CMakeLists.txt:3 \(include\)

+ 0 - 1
Tests/RunCMake/Syntax/NameWithEscapedTabsQuoted-result.txt

@@ -1 +0,0 @@
-1

+ 0 - 12
Tests/RunCMake/Syntax/NameWithEscapedTabsQuoted-stderr.txt

@@ -1,12 +0,0 @@
-^CMake Error at NameWithEscapedTabsQuoted.cmake:1 \(message\):
-  Syntax error in cmake code at
-
-    .*/Tests/RunCMake/Syntax/NameWithEscapedTabsQuoted.cmake:1
-
-  when parsing string
-
-    \${var\\	with\\	escaped\\	tab}
-
-  Invalid escape sequence \\.?
-Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)$

+ 1 - 9
Tests/RunCMake/Syntax/NameWithNewline-stderr.txt

@@ -1,12 +1,4 @@
 ^CMake Error at NameWithNewline.cmake:1 \(message\):
-  Syntax error in cmake code at
-
-    .*/Tests/RunCMake/Syntax/NameWithNewline.cmake:1
-
-  when parsing string
-
-    \${var\\nwith\\nnewline}
-
-  syntax error, unexpected cal_SYMBOL, expecting } \(6\)
+  message called with incorrect number of arguments
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)$

+ 0 - 1
Tests/RunCMake/Syntax/NameWithNewlineQuoted-result.txt

@@ -1 +0,0 @@
-1

+ 0 - 12
Tests/RunCMake/Syntax/NameWithNewlineQuoted-stderr.txt

@@ -1,12 +0,0 @@
-^CMake Error at NameWithNewlineQuoted.cmake:1 \(message\):
-  Syntax error in cmake code at
-
-    .*/Tests/RunCMake/Syntax/NameWithNewlineQuoted.cmake:1
-
-  when parsing string
-
-    \${var\\nwith\\nnewline}
-
-  syntax error, unexpected cal_SYMBOL, expecting } \(6\)
-Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)$

+ 1 - 1
Tests/RunCMake/Syntax/NameWithSpaces-stderr.txt

@@ -7,6 +7,6 @@
 
     \${var
 
-  syntax error, unexpected end of file, expecting } \(6\)
+  There is an unterminated variable reference.
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)$

+ 1 - 1
Tests/RunCMake/Syntax/NameWithSpacesQuoted-stderr.txt

@@ -7,6 +7,6 @@
 
     \${var with space}
 
-  syntax error, unexpected cal_SYMBOL, expecting } \(3\)
+  Invalid character \(' '\) in a variable name: 'var'
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)$

+ 1 - 1
Tests/RunCMake/Syntax/NameWithTabs-stderr.txt

@@ -7,6 +7,6 @@
 
     \${var
 
-  syntax error, unexpected end of file, expecting } \(6\)
+  There is an unterminated variable reference.
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)$

+ 1 - 1
Tests/RunCMake/Syntax/NameWithTabsQuoted-stderr.txt

@@ -7,6 +7,6 @@
 
     \${var	with	tab}
 
-  syntax error, unexpected cal_SYMBOL, expecting } \(3\)
+  Invalid character \('	'\) in a variable name: 'var'
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)$

+ 0 - 1
Tests/RunCMake/Syntax/ParenInENV-result.txt

@@ -1 +0,0 @@
-1

+ 0 - 0
Tests/RunCMake/Syntax/CMP0053-Dollar-OLD-result.txt → Tests/RunCMake/Syntax/ParenInENV1-result.txt


+ 4 - 4
Tests/RunCMake/Syntax/ParenInENV-stderr.txt → Tests/RunCMake/Syntax/ParenInENV1-stderr.txt

@@ -1,4 +1,4 @@
-CMake Warning \(dev\) at ParenInENV.cmake:2:
+CMake Warning \(dev\) at ParenInENV1.cmake:2:
   Syntax Warning in cmake code at column 21
 
   Argument not separated from preceding token by whitespace.
@@ -6,15 +6,15 @@ Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)
 This warning is for project developers.  Use -Wno-dev to suppress it.
 
-CMake Error at ParenInENV.cmake:2 \(message\):
+CMake Error at ParenInENV1.cmake:2 \(message\):
   Syntax error in cmake code at
 
-    .*/Tests/RunCMake/Syntax/ParenInENV.cmake:2
+    .*/Tests/RunCMake/Syntax/ParenInENV1.cmake:2
 
   when parsing string
 
     -->\$ENV{e
 
-  syntax error, unexpected end of file, expecting } \(10\)
+  There is an unterminated variable reference\.
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)

+ 0 - 0
Tests/RunCMake/Syntax/ParenInENV.cmake → Tests/RunCMake/Syntax/ParenInENV1.cmake


+ 0 - 0
Tests/RunCMake/Syntax/CMP0053-ParenInENV-stderr.txt → Tests/RunCMake/Syntax/ParenInENV2-stderr.txt


+ 0 - 1
Tests/RunCMake/Syntax/CMP0053-ParenInENV.cmake → Tests/RunCMake/Syntax/ParenInENV2.cmake

@@ -1,3 +1,2 @@
-cmake_policy(SET CMP0053 NEW)
 set("ENV{e(x)}" value)
 message(-->$ENV{e\(x\)}<--)

+ 0 - 1
Tests/RunCMake/Syntax/ParenInQuotedENV-stderr.txt

@@ -1 +0,0 @@
--->value<--

+ 0 - 0
Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturn-result.txt → Tests/RunCMake/Syntax/ParenInQuotedENV1-result.txt


+ 13 - 0
Tests/RunCMake/Syntax/ParenInQuotedENV1-stderr.txt

@@ -0,0 +1,13 @@
+^CMake Error at ParenInQuotedENV1\.cmake:2 \(message\):
+  Syntax error in cmake code at
+
+    [^
+]*/Tests/RunCMake/Syntax/ParenInQuotedENV1\.cmake:2
+
+  when parsing string
+
+    -->\$ENV{e\(x\)}<--
+
+  Invalid character \('\('\) in a variable name: 'e'
+Call Stack \(most recent call first\):
+  CMakeLists\.txt:3 \(include\)$

+ 0 - 0
Tests/RunCMake/Syntax/ParenInQuotedENV.cmake → Tests/RunCMake/Syntax/ParenInQuotedENV1.cmake


+ 0 - 0
Tests/RunCMake/Syntax/CMP0053-ParenInQuotedENV-stderr.txt → Tests/RunCMake/Syntax/ParenInQuotedENV2-stderr.txt


+ 0 - 1
Tests/RunCMake/Syntax/CMP0053-ParenInQuotedENV.cmake → Tests/RunCMake/Syntax/ParenInQuotedENV2.cmake

@@ -1,3 +1,2 @@
-cmake_policy(SET CMP0053 NEW)
 set("ENV{e(x)}" value)
 message("-->$ENV{e\(x\)}<--")

+ 2 - 2
Tests/RunCMake/Syntax/ParenInVarName0-stderr.txt

@@ -1,7 +1,7 @@
-CMake Error at ParenInVarName0.cmake:4 \(message\):
+CMake Error at ParenInVarName0.cmake:2 \(message\):
   Syntax error in cmake code at
 
-    .*/Tests/RunCMake/Syntax/ParenInVarName0.cmake:4
+    .*/Tests/RunCMake/Syntax/ParenInVarName0.cmake:2
 
   when parsing string
 

+ 0 - 2
Tests/RunCMake/Syntax/ParenInVarName0.cmake

@@ -1,4 +1,2 @@
-cmake_policy(SET CMP0053 NEW)
-
 set("e(x)" value)
 message("-->${e(x)}<--")

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff