[Cmake-commits] CMake branch, next, updated. v3.0.0-rc4-2649-g5ddfef2
Ben Boeckel
ben.boeckel at kitware.com
Wed Apr 30 16:35:16 EDT 2014
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 5ddfef24bced54892ee4a46ac00c95bfad038c63 (commit)
via 052254e84c73ec32d53bbec59bee1c7d94a5145b (commit)
via 44a22dda3d022e4fbc611e0de3137bd1fb7232f9 (commit)
via a89fc6bfb0807dc6730ee04e05cea2fe5be45fd4 (commit)
via 21333e007bdde9a786da377b7ae5784eb7a48692 (commit)
from ffc18aaf2c4b02c238ba09f3253bbbf3466f4aed (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5ddfef24bced54892ee4a46ac00c95bfad038c63
commit 5ddfef24bced54892ee4a46ac00c95bfad038c63
Merge: ffc18aa 052254e
Author: Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Wed Apr 30 16:35:14 2014 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Apr 30 16:35:14 2014 -0400
Merge topic 'dev/faster-evis' into next
052254e8 Utilities/Release: Use ${VAR} instead of @VAR@ syntax
44a22dda EVIS: Reimplement using custom parsing code
a89fc6bf tests: Add tests for syntax corner cases and CMP0053
21333e00 policy: Add policy CMP0053
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=052254e84c73ec32d53bbec59bee1c7d94a5145b
commit 052254e84c73ec32d53bbec59bee1c7d94a5145b
Author: Brad King <brad.king at kitware.com>
AuthorDate: Wed Feb 26 08:58:45 2014 -0500
Commit: Ben Boeckel <ben.boeckel at kitware.com>
CommitDate: Wed Apr 30 16:25:39 2014 -0400
Utilities/Release: Use ${VAR} instead of @VAR@ syntax
The Utilities/Release/Cygwin/CMakeLists.txt is processed in the project,
not configured, so we should avoid using @-replacement syntax.
diff --git a/Utilities/Release/Cygwin/CMakeLists.txt b/Utilities/Release/Cygwin/CMakeLists.txt
index c59a6fa..73a8220 100644
--- a/Utilities/Release/Cygwin/CMakeLists.txt
+++ b/Utilities/Release/Cygwin/CMakeLists.txt
@@ -14,9 +14,9 @@ message(STATUS "Using curses version: libncurses${MAX}")
configure_file("${CMake_SOURCE_DIR}/Utilities/Release/Cygwin/cygwin-setup.hint.in"
"${CMake_BINARY_DIR}/setup.hint")
configure_file("${CMake_SOURCE_DIR}/Utilities/Release/Cygwin/README.cygwin.in"
- "${CMake_BINARY_DIR}/Docs/@CPACK_PACKAGE_FILE_NAME at -@CPACK_CYGWIN_PATCH_NUMBER at .README")
+ "${CMake_BINARY_DIR}/Docs/${CPACK_PACKAGE_FILE_NAME}-${CPACK_CYGWIN_PATCH_NUMBER}.README")
install_files(/share/doc/Cygwin FILES
- ${CMake_BINARY_DIR}/Docs/@CPACK_PACKAGE_FILE_NAME at -@CPACK_CYGWIN_PATCH_NUMBER at .README
+ ${CMake_BINARY_DIR}/Docs/${CPACK_PACKAGE_FILE_NAME}-${CPACK_CYGWIN_PATCH_NUMBER}.README
)
configure_file("${CMake_SOURCE_DIR}/Utilities/Release/Cygwin/cygwin-package.sh.in"
${CPACK_CYGWIN_BUILD_SCRIPT})
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=44a22dda3d022e4fbc611e0de3137bd1fb7232f9
commit 44a22dda3d022e4fbc611e0de3137bd1fb7232f9
Author: Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Fri Feb 7 22:37:54 2014 -0500
Commit: Ben Boeckel <ben.boeckel at kitware.com>
CommitDate: Wed Apr 30 16:25:39 2014 -0400
EVIS: Reimplement using custom parsing code
Testing the configure (no generate) step with ParaView shows ~20%
performance improvement.
In terms of complete configure/generate steps, further testing with
ParaView shows a 20% performance improvement over 2.8.12.2 with Unix
Makefiles and minimal with Ninja. Ninja is less because it generate step
is the expensive part (future work will address this) by a long shot and
these changes help the configure step for the most part.
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 07cfe12..83e3198 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -204,6 +204,7 @@ void cmMakefile::Initialize()
this->cmDefineRegex.compile("#cmakedefine[ \t]+([A-Za-z_0-9]*)");
this->cmDefine01Regex.compile("#cmakedefine01[ \t]+([A-Za-z_0-9]*)");
this->cmAtVarRegex.compile("(@[A-Za-z_0-9/.+-]+@)");
+ this->cmNamedCurly.compile("^[A-Za-z0-9/_.+-]+{");
// Enter a policy level for this directory.
this->PushPolicy();
@@ -2589,23 +2590,107 @@ const char *cmMakefile::ExpandVariablesInString(std::string& source,
bool removeEmpty,
bool replaceAt) const
{
- if ( source.empty() || source.find_first_of("$@\\") == source.npos)
+ bool compareResults = false;
+ cmake::MessageType mtype = cmake::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
+ // configure-file/string which always does no escapes.
+ this->IssueMessage(cmake::INTERNAL_ERROR,
+ "ExpandVariablesInString @ONLY called "
+ "on something with escapes.");
return source.c_str();
}
- // Special-case the @ONLY mode.
- if(atOnly)
+ // Variables used in the WARN case.
+ std::string newResult;
+ std::string newErrorstr;
+ cmake::MessageType newError = cmake::LOG;
+
+ switch(this->GetPolicyStatus(cmPolicies::CMP0053))
+ {
+ case cmPolicies::WARN:
+ {
+ // Save the original string for the warning.
+ original = source;
+ newResult = source;
+ compareResults = true;
+ newError =
+ ExpandVariablesInStringNew(newErrorstr, newResult, escapeQuotes,
+ noEscapes, atOnly, filename, line,
+ removeEmpty, replaceAt);
+ }
+ case cmPolicies::OLD:
+ mtype = ExpandVariablesInStringOld(errorstr, source, escapeQuotes,
+ noEscapes, atOnly, filename,
+ line, removeEmpty, true);
+ break;
+ case cmPolicies::REQUIRED_IF_USED:
+ case cmPolicies::REQUIRED_ALWAYS:
+ // Messaging here would be *very* verbose.
+ case cmPolicies::NEW:
+ mtype = ExpandVariablesInStringNew(errorstr, source, escapeQuotes,
+ noEscapes, atOnly, filename,
+ line, removeEmpty, replaceAt);
+ break;
+ }
+
+ // If it's an error in either case, just report the error...
+ if(mtype != cmake::LOG)
+ {
+ if(mtype == cmake::FATAL_ERROR)
+ {
+ cmSystemTools::SetFatalErrorOccured();
+ }
+ this->IssueMessage(mtype, errorstr);
+ }
+ // ...otherwise, see if there's a difference that needs to be warned about.
+ else if(compareResults && (newResult != source || newError != mtype))
{
- if(!noEscapes || !removeEmpty || !replaceAt)
+ std::string message =
+ this->GetPolicies()->GetPolicyWarning(cmPolicies::CMP0053);
+ message += "\n Input: \'" + original + "\'";
+ if(newError != mtype)
+ {
+ message += "\n Old behavior is accepted and "
+ "the new behavior causes an error: "
+ "\'" + newErrorstr + "\'";
+ }
+ else
{
- // This case should never be called. At-only is for
- // configure-file/string which always does no escapes.
- this->IssueMessage(cmake::INTERNAL_ERROR,
- "ExpandVariablesInString @ONLY called "
- "on something with escapes.");
+ message += "\n Old expansion: \'" + source + "\'";
+ message += "\n New expansion: \'" + newResult + "\'";
}
+ this->IssueMessage(cmake::AUTHOR_WARNING, message);
+ }
+
+ return source.c_str();
+}
+
+cmake::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("$@\\") == source.npos)
+ {
+ return cmake::LOG;
+ }
+ // Special-case the @ONLY mode.
+ if(atOnly)
+ {
// Store an original copy of the input.
std::string input = source;
@@ -2645,7 +2730,7 @@ const char *cmMakefile::ExpandVariablesInString(std::string& source,
// Append the rest of the unchanged part of the string.
source.append(in);
- return source.c_str();
+ return cmake::LOG;
}
// This method replaces ${VAR} and @VAR@ where VAR is looked up
@@ -2662,6 +2747,7 @@ const char *cmMakefile::ExpandVariablesInString(std::string& source,
parser.SetRemoveEmpty(removeEmpty);
int res = parser.ParseString(source.c_str(), 0);
const char* emsg = parser.GetError();
+ cmake::MessageType mtype = cmake::LOG;
if ( res && !emsg[0] )
{
source = parser.GetResult();
@@ -2688,7 +2774,7 @@ const char *cmMakefile::ExpandVariablesInString(std::string& source,
// parser reported an error message without failing because the
// helper implementation is unhappy, which has always reported an
// error.
- cmake::MessageType mtype = cmake::FATAL_ERROR;
+ mtype = cmake::FATAL_ERROR;
if(!res)
{
// This is a real argument parsing error. Use policy CMP0010 to
@@ -2710,13 +2796,320 @@ const char *cmMakefile::ExpandVariablesInString(std::string& source,
->GetRequiredPolicyError(cmPolicies::CMP0010));
case cmPolicies::NEW:
// NEW behavior is to report the error.
- cmSystemTools::SetFatalErrorOccured();
break;
}
}
- this->IssueMessage(mtype, error.str());
+ errorstr = error.str();
}
- return source.c_str();
+ return mtype;
+}
+
+cmake::MessageType cmMakefile::ExpandVariablesInStringNew(
+ std::string& errorstr,
+ std::string& source,
+ bool escapeQuotes,
+ bool noEscapes,
+ bool atOnly,
+ const char* filename,
+ long line,
+ bool removeEmpty,
+ bool replaceAt) const
+{
+ // 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.
+
+ const char* in = source.c_str();
+ const char* last = in;
+ bool error = false;
+ bool done = false;
+ this->EVISOpenStack.push_front(VariableLookup());
+ cmake::MessageType mtype = cmake::LOG;
+
+ do
+ {
+ char inc = *in;
+ switch(inc)
+ {
+ case '}':
+ if(this->EVISOpenStack.size() > 1)
+ {
+ VariableLookup var = this->EVISOpenStack.front();
+ this->EVISOpenStack.pop_front();
+ std::string& lookup = var.LookupStart;
+ lookup.append(last, in - last);
+ const char* value = NULL;
+ static const std::string lineVar = "CMAKE_CURRENT_LIST_LINE";
+ switch(var.Domain)
+ {
+ case NORMAL:
+ if(filename && lookup == lineVar)
+ {
+ cmOStringStream ostr;
+ ostr << line;
+ this->EVISOpenStack.front().LookupStart.append(ostr.str());
+ }
+ else
+ {
+ value = this->GetDefinition(lookup);
+ }
+ break;
+ case ENVIRONMENT:
+ value = cmSystemTools::GetEnv(lookup.c_str());
+ break;
+ case CACHE:
+ value = this->GetCacheManager()->GetCacheValue(lookup);
+ break;
+ }
+ // Get the string we're meant to append to.
+ std::string result;
+ if(value)
+ {
+ if(escapeQuotes)
+ {
+ result = cmSystemTools::EscapeQuotes(value);
+ }
+ else
+ {
+ result = value;
+ }
+ }
+ else if(!removeEmpty)
+ {
+ // check to see if we need to print a warning
+ // if strict mode is on and the variable has
+ // not been "cleared"/initialized with a set(foo ) call
+ if(this->GetCMakeInstance()->GetWarnUninitialized() &&
+ !this->VariableInitialized(lookup))
+ {
+ if (this->CheckSystemVars ||
+ cmSystemTools::IsSubDirectory(filename,
+ this->GetHomeDirectory()) ||
+ cmSystemTools::IsSubDirectory(filename,
+ this->GetHomeOutputDirectory()))
+ {
+ cmOStringStream msg;
+ cmListFileBacktrace bt;
+ cmListFileContext lfc;
+ lfc.FilePath = filename;
+ lfc.Line = line;
+ bt.push_back(lfc);
+ msg << "uninitialized variable \'" << lookup << "\'";
+ this->GetCMakeInstance()->IssueMessage(cmake::AUTHOR_WARNING,
+ msg.str().c_str(), bt);
+ }
+ }
+ }
+ this->EVISOpenStack.front().LookupStart.append(result);
+ // Start looking from here on out.
+ last = in + 1;
+ }
+ break;
+ case '$':
+ if(!atOnly)
+ {
+ VariableLookup lookup;
+ const char* next = in + 1;
+ const char* start = NULL;
+ char nextc = *next;
+ if(nextc == '{')
+ {
+ // Looking for a variable.
+ start = in + 2;
+ lookup.Domain = NORMAL;
+ }
+ else if(nextc == '<')
+ {
+ }
+ else if(!nextc)
+ {
+ this->EVISOpenStack.front().LookupStart.append(last, next - last);
+ last = next;
+ }
+ else if(cmHasLiteralPrefix(next, "ENV{"))
+ {
+ // Looking for an environment variable.
+ start = in + 5;
+ lookup.Domain = ENVIRONMENT;
+ }
+ else if(cmHasLiteralPrefix(next, "CACHE{"))
+ {
+ // Looking for a cache variable.
+ start = in + 7;
+ lookup.Domain = CACHE;
+ }
+ else
+ {
+ if(this->cmNamedCurly.find(next))
+ {
+ errorstr = "Syntax $"
+ + std::string(next, this->cmNamedCurly.end())
+ + "{} is not supported. Only ${}, $ENV{}, "
+ "and $CACHE{} are allowed.";
+ mtype = cmake::FATAL_ERROR;
+ error = true;
+ }
+ }
+ if(start)
+ {
+ this->EVISOpenStack.front().LookupStart.append(last, in - last);
+ last = start;
+ in = start - 1;
+ this->EVISOpenStack.push_front(lookup);
+ }
+ break;
+ }
+ case '\\':
+ if(!noEscapes)
+ {
+ const char* next = in + 1;
+ char nextc = *next;
+ if(nextc == 't')
+ {
+ this->EVISOpenStack.front().LookupStart.append(last, in - last);
+ this->EVISOpenStack.front().LookupStart.append("\t");
+ last = next + 1;
+ }
+ else if(nextc == 'n')
+ {
+ this->EVISOpenStack.front().LookupStart.append(last, in - last);
+ this->EVISOpenStack.front().LookupStart.append("\n");
+ last = next + 1;
+ }
+ else if(nextc == 'r')
+ {
+ this->EVISOpenStack.front().LookupStart.append(last, in - last);
+ this->EVISOpenStack.front().LookupStart.append("\r");
+ last = next + 1;
+ }
+ else if(nextc == ';' && this->EVISOpenStack.size() == 1)
+ {
+ // Handled in ExpandListArgument; pass the backslash literally.
+ }
+ else if (isalnum(nextc) || nextc == '\0')
+ {
+ errorstr += "Invalid character escape '\\";
+ if (nextc)
+ {
+ errorstr += nextc;
+ errorstr += "'.";
+ }
+ else
+ {
+ errorstr += "' (at end of input).";
+ }
+ error = true;
+ }
+ else
+ {
+ // Take what we've found so far, skipping the escape character.
+ this->EVISOpenStack.front().LookupStart.append(last, in - last);
+ // Start tracking from the next character.
+ last = in + 1;
+ }
+ // Skip the next character since it was escaped, but don't read past
+ // the end of the string.
+ if(*last)
+ {
+ ++in;
+ }
+ }
+ break;
+ case '\n':
+ // Onto the next line.
+ ++line;
+ break;
+ case '\0':
+ done = true;
+ break;
+ case '@':
+ if(replaceAt)
+ {
+ const char* nextAt = strchr(in + 1, '@');
+ if(nextAt && nextAt != in + 1 &&
+ nextAt == in + 1 + strspn(in + 1,
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ "abcdefghijklmnopqrstuvwxyz"
+ "0123456789/_.+-"))
+ {
+ std::string variable(in + 1, nextAt - in - 1);
+ std::string result = this->GetSafeDefinition(variable.c_str());
+ if(escapeQuotes)
+ {
+ result = cmSystemTools::EscapeQuotes(result.c_str());
+ }
+ // Skip over the variable.
+ this->EVISOpenStack.front().LookupStart.append(last, in - last);
+ this->EVISOpenStack.front().LookupStart.append(result);
+ in = nextAt;
+ last = in + 1;
+ break;
+ }
+ }
+ // Failed to find a valid @ expansion; treat it as literal.
+ /* FALLTHROUGH */
+ default:
+ {
+ if(this->EVISOpenStack.size() > 1 &&
+ !(isalnum(inc) || inc == '_' ||
+ inc == '/' || inc == '.' ||
+ inc == '+' || inc == '-' ||
+ (this->EVISOpenStack.front().Domain == ENVIRONMENT && (
+ inc == '(' || inc == ')'))))
+ {
+ errorstr += "Invalid character (\'";
+ errorstr += inc;
+ errorstr += "\') in a variable name: " +
+ this->EVISOpenStack.front().LookupStart;
+ mtype = cmake::FATAL_ERROR;
+ error = true;
+ }
+ break;
+ }
+ }
+ // Look at the next character.
+ } while(!error && !done && *++in);
+
+ // Check for open variable references yet.
+ if(!error && this->EVISOpenStack.size() != 1)
+ {
+ // There's an open variable reference waiting. Policy CMP0010 flags
+ // whether this is an error or not. The new parser now enforces
+ // CMP0010 as well.
+ errorstr += "There is an unterminated variable reference.";
+ error = true;
+ }
+
+ if(error)
+ {
+ cmOStringStream emsg;
+ emsg << "Syntax error in cmake code ";
+ if(filename)
+ {
+ // This filename and line number may be more specific than the
+ // command context because one command invocation can have
+ // arguments on multiple lines.
+ emsg << "at\n"
+ << " " << filename << ":" << line << "\n";
+ }
+ emsg << "when parsing string\n"
+ << " " << source << "\n";
+ emsg << errorstr;
+ mtype = cmake::FATAL_ERROR;
+ errorstr = emsg.str();
+ }
+ else
+ {
+ // Append the rest of the unchanged part of the string.
+ this->EVISOpenStack.front().LookupStart.append(last);
+
+ source = this->EVISOpenStack.front().LookupStart;
+ }
+
+ this->EVISOpenStack.clear();
+
+ return mtype;
}
void cmMakefile::RemoveVariablesInString(std::string& source,
@@ -2939,7 +3332,7 @@ bool cmMakefile::ExpandArguments(
value = i->Value;
this->ExpandVariablesInString(value, false, false, false,
i->FilePath, i->Line,
- false, true);
+ false, false);
// If the argument is quoted, it should be one argument.
// Otherwise, it may be a list of arguments.
@@ -3500,7 +3893,7 @@ void cmMakefile::ConfigureString(const std::string& input,
// Perform variable replacements.
this->ExpandVariablesInString(output, escapeQuotes, true,
- atOnly, 0, -1, true);
+ atOnly, 0, -1, true, true);
}
int cmMakefile::ConfigureFile(const char* infile, const char* outfile,
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 3bccb63..d08019a 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -33,6 +33,8 @@
# include <cmsys/hash_map.hxx>
#endif
+#include <deque>
+
class cmFunctionBlocker;
class cmCommand;
class cmInstallGenerator;
@@ -679,7 +681,7 @@ public:
const char* filename = 0,
long line = -1,
bool removeEmpty = false,
- bool replaceAt = true) const;
+ bool replaceAt = false) const;
/**
* Remove any remaining variables in the string. Anything with ${var} or
@@ -986,6 +988,7 @@ private:
mutable cmsys::RegularExpression cmDefineRegex;
mutable cmsys::RegularExpression cmDefine01Regex;
mutable cmsys::RegularExpression cmAtVarRegex;
+ mutable cmsys::RegularExpression cmNamedCurly;
cmPropertyMap Properties;
@@ -1042,6 +1045,42 @@ private:
// Enforce rules about CMakeLists.txt files.
void EnforceDirectoryLevelRules() const;
+ // CMP0053 == old
+ cmake::MessageType ExpandVariablesInStringOld(
+ std::string& errorstr,
+ std::string& source,
+ bool escapeQuotes,
+ bool noEscapes,
+ bool atOnly,
+ const char* filename,
+ long line,
+ bool removeEmpty,
+ bool replaceAt) const;
+ typedef enum
+ {
+ NORMAL,
+ ENVIRONMENT,
+ CACHE
+ } VariableDomain;
+ struct VariableLookup
+ {
+ VariableDomain Domain;
+ std::string LookupStart;
+ };
+ typedef std::deque<VariableLookup> VariableStack;
+ mutable VariableStack EVISOpenStack;
+
+ // CMP0053 == new
+ cmake::MessageType ExpandVariablesInStringNew(
+ std::string& errorstr,
+ std::string& source,
+ bool escapeQuotes,
+ bool noEscapes,
+ bool atOnly,
+ const char* filename,
+ long line,
+ bool removeEmpty,
+ bool replaceAt) const;
bool GeneratingBuildSystem;
/**
* Old version of GetSourceFileWithOutput(const std::string&) kept for
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a89fc6bfb0807dc6730ee04e05cea2fe5be45fd4
commit a89fc6bfb0807dc6730ee04e05cea2fe5be45fd4
Author: Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Tue Feb 18 14:47:56 2014 -0500
Commit: Ben Boeckel <ben.boeckel at kitware.com>
CommitDate: Wed Apr 30 16:25:39 2014 -0400
tests: Add tests for syntax corner cases and CMP0053
diff --git a/Tests/RunCMake/Syntax/CMP0053-At-NEW-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-At-NEW-stderr.txt
new file mode 100644
index 0000000..e3e5332
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-At-NEW-stderr.txt
@@ -0,0 +1 @@
+^-->\${right}<--$
diff --git a/Tests/RunCMake/Syntax/CMP0053-At-NEW.cmake b/Tests/RunCMake/Syntax/CMP0053-At-NEW.cmake
new file mode 100644
index 0000000..40dbe46
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-At-NEW.cmake
@@ -0,0 +1,9 @@
+cmake_policy(SET CMP0053 NEW)
+
+set(right "wrong")
+set(var "\${right}")
+# Not expanded here with the new policy.
+set(ref "@var@")
+
+string(CONFIGURE "${ref}" output)
+message("-->${output}<--")
diff --git a/Tests/RunCMake/Syntax/CMP0053-At-OLD-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-At-OLD-stderr.txt
new file mode 100644
index 0000000..acfa30a
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-At-OLD-stderr.txt
@@ -0,0 +1 @@
+^-->wrong<--$
diff --git a/Tests/RunCMake/Syntax/CMP0053-At-OLD.cmake b/Tests/RunCMake/Syntax/CMP0053-At-OLD.cmake
new file mode 100644
index 0000000..666f107
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-At-OLD.cmake
@@ -0,0 +1,9 @@
+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}<--")
diff --git a/Tests/RunCMake/Syntax/CMP0053-At-WARN-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-At-WARN-stderr.txt
new file mode 100644
index 0000000..718af8b
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-At-WARN-stderr.txt
@@ -0,0 +1,11 @@
+^CMake Warning \(dev\) at CMP0053-At-WARN.cmake:4 \(set\):
+ Policy CMP0053 is not set: Use the new variable expansion rules. Run
+ "cmake --help-policy CMP0053" for policy details. Use the cmake_policy
+ command to set the policy and suppress this warning.
+
+ Input: '@var@'
+ Old expansion: '\${right}'
+ New expansion: '@var@'
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.$
diff --git a/Tests/RunCMake/Syntax/CMP0053-At-WARN.cmake b/Tests/RunCMake/Syntax/CMP0053-At-WARN.cmake
new file mode 100644
index 0000000..19c7f53
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-At-WARN.cmake
@@ -0,0 +1,4 @@
+set(right "wrong")
+set(var "\${right}")
+# Expanded here with the old policy.
+set(ref "@var@")
diff --git a/Tests/RunCMake/Syntax/CMP0053-WARN-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-WARN-stderr.txt
new file mode 100644
index 0000000..8a4bf46
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-WARN-stderr.txt
@@ -0,0 +1,20 @@
+^CMake Warning \(dev\) at CMP0053-WARN.cmake:2 \(message\):
+ Policy CMP0053 is not set: Use the new variable expansion rules. Run
+ "cmake --help-policy CMP0053" for policy details. Use the cmake_policy
+ command to set the policy and suppress this warning.
+
+ Input: '\\'
+ Old behavior is accepted and the new behavior causes 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\).'
+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.
+
+\\$
diff --git a/Tests/RunCMake/Syntax/CMP0053-WARN.cmake b/Tests/RunCMake/Syntax/CMP0053-WARN.cmake
new file mode 100644
index 0000000..6e8b07b
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-WARN.cmake
@@ -0,0 +1,5 @@
+macro (escape str)
+ message("${str}")
+endmacro ()
+
+escape("\\")
diff --git a/Tests/RunCMake/Syntax/CMakeLists.txt b/Tests/RunCMake/Syntax/CMakeLists.txt
index 618473a..4b3de84 100644
--- a/Tests/RunCMake/Syntax/CMakeLists.txt
+++ b/Tests/RunCMake/Syntax/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.9)
+cmake_minimum_required(VERSION 2.8.12)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/Syntax/Escape2-result.txt b/Tests/RunCMake/Syntax/Escape2-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/Escape2-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/Escape2-stderr.txt b/Tests/RunCMake/Syntax/Escape2-stderr.txt
new file mode 100644
index 0000000..cc3bdf0
--- /dev/null
+++ b/Tests/RunCMake/Syntax/Escape2-stderr.txt
@@ -0,0 +1,13 @@
+CMake Error at Escape2.cmake:4 \(message\):
+ Syntax error in cmake code at
+
+ .*/Tests/RunCMake/Syntax/Escape2.cmake:4
+
+ when parsing string
+
+ \\
+
+ Invalid character escape '\\' \(at end of input\).
+Call Stack \(most recent call first\):
+ Escape2.cmake:7 \(escape\)
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Syntax/Escape2.cmake b/Tests/RunCMake/Syntax/Escape2.cmake
new file mode 100644
index 0000000..078a822
--- /dev/null
+++ b/Tests/RunCMake/Syntax/Escape2.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0053 NEW)
+
+macro (escape str)
+ message("${str}")
+endmacro ()
+
+escape("\\")
diff --git a/Tests/RunCMake/Syntax/EscapeChar-char-result.txt b/Tests/RunCMake/Syntax/EscapeChar-char-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/EscapeChar-char-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/EscapeChar-char-stderr.txt.in b/Tests/RunCMake/Syntax/EscapeChar-char-stderr.txt.in
new file mode 100644
index 0000000..d1d908c
--- /dev/null
+++ b/Tests/RunCMake/Syntax/EscapeChar-char-stderr.txt.in
@@ -0,0 +1,12 @@
+CMake Error at EscapeChar- at char@- at testnum@.cmake:3 \(message\):
+ Syntax error in cmake code at
+
+ .*/Tests/RunCMake/Syntax/EscapeChar- at char@- at testnum@.cmake:3
+
+ when parsing string
+
+ -->\\@char@<--
+
+ Invalid character escape '\\@char@'.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Syntax/EscapeChar-char.cmake.in b/Tests/RunCMake/Syntax/EscapeChar-char.cmake.in
new file mode 100644
index 0000000..6f265e5
--- /dev/null
+++ b/Tests/RunCMake/Syntax/EscapeChar-char.cmake.in
@@ -0,0 +1,3 @@
+cmake_policy(SET CMP0053 NEW)
+
+message("-->\@char@<--")
diff --git a/Tests/RunCMake/Syntax/EscapeCharsAllowed-stderr.txt b/Tests/RunCMake/Syntax/EscapeCharsAllowed-stderr.txt
new file mode 100644
index 0000000..d0c3832
--- /dev/null
+++ b/Tests/RunCMake/Syntax/EscapeCharsAllowed-stderr.txt
@@ -0,0 +1,8 @@
+^-->semicolon<--
+-->dollar<--
+-->brace<--
+-->bracket<--
+-->newline<--
+-->octothorpe<--
+-->top-levelsemicolon<--
+-->top-level;escaped;semicolon<--$
diff --git a/Tests/RunCMake/Syntax/EscapeCharsAllowed.cmake b/Tests/RunCMake/Syntax/EscapeCharsAllowed.cmake
new file mode 100644
index 0000000..771436a
--- /dev/null
+++ b/Tests/RunCMake/Syntax/EscapeCharsAllowed.cmake
@@ -0,0 +1,18 @@
+cmake_policy(SET CMP0053 NEW)
+
+set("semicolon;in;name" semicolon)
+set("dollar$in$name" dollar)
+set("brace{in}name" brace)
+set("bracket[in]name" bracket)
+set("newline\nin\nname" newline)
+set("octothorpe\#in\#name" octothorpe)
+
+message("-->${semicolon\;in\;name}<--")
+message("-->${dollar\$in\$name}<--")
+message("-->${brace\{in\}name}<--")
+message("-->${bracket\[in\]name}<--")
+message("-->${newline\nin\nname}<--")
+message("-->${octothorpe\#in\#name}<--")
+
+message(-->top-level;semicolon<--)
+message(-->top-level\;escaped\;semicolon<--)
diff --git a/Tests/RunCMake/Syntax/EscapeCharsDisallowed.cmake b/Tests/RunCMake/Syntax/EscapeCharsDisallowed.cmake
new file mode 100644
index 0000000..eef01a0
--- /dev/null
+++ b/Tests/RunCMake/Syntax/EscapeCharsDisallowed.cmake
@@ -0,0 +1,42 @@
+set(disallowed_chars
+ a b c d e f g h i j l m o p q s u v w x y z
+ A B C D E F G H I J L M N O P Q R S T U V W X Y Z
+ 0 1 2 3 4 5 6 6 7 8 9)
+set(testnum 0)
+
+configure_file(
+ "${RunCMake_SOURCE_DIR}/CMakeLists.txt"
+ "${RunCMake_BINARY_DIR}/CMakeLists.txt"
+ COPYONLY)
+
+foreach (char IN LISTS disallowed_chars)
+ configure_file(
+ "${RunCMake_SOURCE_DIR}/EscapeChar-char.cmake.in"
+ "${RunCMake_BINARY_DIR}/EscapeChar-${char}-${testnum}.cmake"
+ @ONLY)
+ configure_file(
+ "${RunCMake_SOURCE_DIR}/EscapeChar-char-stderr.txt.in"
+ "${RunCMake_BINARY_DIR}/EscapeChar-${char}-${testnum}-stderr.txt"
+ @ONLY)
+ configure_file(
+ "${RunCMake_SOURCE_DIR}/EscapeChar-char-result.txt"
+ "${RunCMake_BINARY_DIR}/EscapeChar-${char}-${testnum}-result.txt"
+ COPYONLY)
+
+ math(EXPR testnum "${testnum} + 1")
+endforeach ()
+
+function (run_tests)
+ set(GENERATED_RUNCMAKE_TESTS TRUE)
+ # Find the tests in the binary directory.
+ set(RunCMake_SOURCE_DIR "${RunCMake_BINARY_DIR}")
+
+ set(testnum 0)
+ foreach (char IN LISTS disallowed_chars)
+ run_cmake("EscapeChar-${char}-${testnum}")
+
+ math(EXPR testnum "${testnum} + 1")
+ endforeach ()
+endfunction ()
+
+run_tests()
diff --git a/Tests/RunCMake/Syntax/ParenInVarName0-result.txt b/Tests/RunCMake/Syntax/ParenInVarName0-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/ParenInVarName0-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/ParenInVarName0-stderr.txt b/Tests/RunCMake/Syntax/ParenInVarName0-stderr.txt
new file mode 100644
index 0000000..2f117cd
--- /dev/null
+++ b/Tests/RunCMake/Syntax/ParenInVarName0-stderr.txt
@@ -0,0 +1,12 @@
+CMake Error at ParenInVarName0.cmake:4 \(message\):
+ Syntax error in cmake code at
+
+ .*/Tests/RunCMake/Syntax/ParenInVarName0.cmake:4
+
+ when parsing string
+
+ -->\${e\(x\)}<--
+
+ Invalid character \('\('\) in a variable name:
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Syntax/ParenInVarName0.cmake b/Tests/RunCMake/Syntax/ParenInVarName0.cmake
new file mode 100644
index 0000000..f863d20
--- /dev/null
+++ b/Tests/RunCMake/Syntax/ParenInVarName0.cmake
@@ -0,0 +1,4 @@
+cmake_policy(SET CMP0053 NEW)
+
+set("e(x)" value)
+message("-->${e(x)}<--")
diff --git a/Tests/RunCMake/Syntax/ParenInVarName1-result.txt b/Tests/RunCMake/Syntax/ParenInVarName1-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/ParenInVarName1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/ParenInVarName1-stderr.txt b/Tests/RunCMake/Syntax/ParenInVarName1-stderr.txt
new file mode 100644
index 0000000..81b1717
--- /dev/null
+++ b/Tests/RunCMake/Syntax/ParenInVarName1-stderr.txt
@@ -0,0 +1,12 @@
+CMake Error at ParenInVarName1.cmake:4 \(message\):
+ Syntax error in cmake code at
+
+ .*/Tests/RunCMake/Syntax/ParenInVarName1.cmake:4
+
+ when parsing string
+
+ -->\${e\(x\)}<--
+
+ syntax error, unexpected cal_SYMBOL, expecting } \(10\)
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Syntax/ParenInVarName1.cmake b/Tests/RunCMake/Syntax/ParenInVarName1.cmake
new file mode 100644
index 0000000..9fdc87b
--- /dev/null
+++ b/Tests/RunCMake/Syntax/ParenInVarName1.cmake
@@ -0,0 +1,4 @@
+cmake_policy(SET CMP0053 OLD)
+
+set("{e(x)}" value)
+message("-->${e(x)}<--")
diff --git a/Tests/RunCMake/Syntax/RunCMakeTest.cmake b/Tests/RunCMake/Syntax/RunCMakeTest.cmake
index dcabd8a..fe12a0f 100644
--- a/Tests/RunCMake/Syntax/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Syntax/RunCMakeTest.cmake
@@ -5,6 +5,10 @@ run_cmake(BOM-UTF-16-LE)
run_cmake(BOM-UTF-16-BE)
run_cmake(BOM-UTF-32-LE)
run_cmake(BOM-UTF-32-BE)
+run_cmake(CMP0053-At-OLD)
+run_cmake(CMP0053-At-NEW)
+run_cmake(CMP0053-At-WARN)
+run_cmake(CMP0053-WARN)
run_cmake(CommandSpaces)
run_cmake(CommandTabs)
run_cmake(CommandNewlines)
@@ -25,6 +29,7 @@ run_cmake(StringNoSpace)
run_cmake(OneLetter)
run_cmake(Unquoted0)
run_cmake(Unquoted1)
+run_cmake(Unquoted2)
run_cmake(Bracket0)
run_cmake(Bracket1)
run_cmake(Bracket2)
@@ -43,12 +48,20 @@ run_cmake(BracketNoSpace3)
run_cmake(BracketNoSpace4)
run_cmake(BracketNoSpace5)
run_cmake(Escape1)
+run_cmake(Escape2)
+run_cmake(EscapeCharsAllowed)
+include("${RunCMake_SOURCE_DIR}/EscapeCharsDisallowed.cmake")
run_cmake(ParenNoSpace0)
run_cmake(ParenNoSpace1)
run_cmake(ParenNoSpace2)
+run_cmake(ParenInVarName0)
+run_cmake(ParenInVarName1)
run_cmake(UnterminatedCall1)
run_cmake(UnterminatedCall2)
run_cmake(UnterminatedString)
+run_cmake(UnterminatedBrace0)
+run_cmake(UnterminatedBrace1)
+run_cmake(UnterminatedBrace2)
run_cmake(UnterminatedBracket0)
run_cmake(UnterminatedBracket1)
run_cmake(UnterminatedBracketComment)
diff --git a/Tests/RunCMake/Syntax/Unquoted2-stderr.txt b/Tests/RunCMake/Syntax/Unquoted2-stderr.txt
new file mode 100644
index 0000000..eb8883e
--- /dev/null
+++ b/Tests/RunCMake/Syntax/Unquoted2-stderr.txt
@@ -0,0 +1 @@
+^\[\[UnquotedBracketArgument1\]\]$
diff --git a/Tests/RunCMake/Syntax/Unquoted2.cmake b/Tests/RunCMake/Syntax/Unquoted2.cmake
new file mode 100644
index 0000000..d94057d
--- /dev/null
+++ b/Tests/RunCMake/Syntax/Unquoted2.cmake
@@ -0,0 +1,3 @@
+cmake_policy(SET CMP0053 NEW)
+
+message(\[[Unquoted Bracket Argument 1]])
diff --git a/Tests/RunCMake/Syntax/UnterminatedBrace0-result.txt b/Tests/RunCMake/Syntax/UnterminatedBrace0-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/UnterminatedBrace0-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/UnterminatedBrace0-stderr.txt b/Tests/RunCMake/Syntax/UnterminatedBrace0-stderr.txt
new file mode 100644
index 0000000..1e0ce49
--- /dev/null
+++ b/Tests/RunCMake/Syntax/UnterminatedBrace0-stderr.txt
@@ -0,0 +1,12 @@
+CMake Error at UnterminatedBrace0.cmake:2 \(set\):
+ Syntax error in cmake code at
+
+ .*/Tests/RunCMake/Syntax/UnterminatedBrace0.cmake:2
+
+ when parsing string
+
+ \${
+
+ syntax error, unexpected \$end, expecting } \(2\)
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Syntax/UnterminatedBrace0.cmake b/Tests/RunCMake/Syntax/UnterminatedBrace0.cmake
new file mode 100644
index 0000000..0da1290
--- /dev/null
+++ b/Tests/RunCMake/Syntax/UnterminatedBrace0.cmake
@@ -0,0 +1,2 @@
+cmake_minimum_required(VERSION 3.0)
+set(var "${")
diff --git a/Tests/RunCMake/Syntax/UnterminatedBrace1-stderr.txt b/Tests/RunCMake/Syntax/UnterminatedBrace1-stderr.txt
new file mode 100644
index 0000000..4e3c2b5
--- /dev/null
+++ b/Tests/RunCMake/Syntax/UnterminatedBrace1-stderr.txt
@@ -0,0 +1,13 @@
+CMake Warning \(dev\) at UnterminatedBrace1.cmake:3 \(set\):
+ Syntax error in cmake code at
+
+ .*/Tests/RunCMake/Syntax/UnterminatedBrace1.cmake:3
+
+ when parsing string
+
+ \${
+
+ syntax error, unexpected \$end, expecting } \(2\)
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/Syntax/UnterminatedBrace1.cmake b/Tests/RunCMake/Syntax/UnterminatedBrace1.cmake
new file mode 100644
index 0000000..93fba34
--- /dev/null
+++ b/Tests/RunCMake/Syntax/UnterminatedBrace1.cmake
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.0)
+cmake_policy(SET CMP0010 OLD)
+set(var "${")
diff --git a/Tests/RunCMake/Syntax/UnterminatedBrace2-result.txt b/Tests/RunCMake/Syntax/UnterminatedBrace2-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/UnterminatedBrace2-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/UnterminatedBrace2-stderr.txt b/Tests/RunCMake/Syntax/UnterminatedBrace2-stderr.txt
new file mode 100644
index 0000000..b332d34
--- /dev/null
+++ b/Tests/RunCMake/Syntax/UnterminatedBrace2-stderr.txt
@@ -0,0 +1,12 @@
+CMake Error at UnterminatedBrace2.cmake:4 \(set\):
+ Syntax error in cmake code at
+
+ .*/Tests/RunCMake/Syntax/UnterminatedBrace2.cmake:4
+
+ when parsing string
+
+ \${
+
+ There is an unterminated variable reference.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Syntax/UnterminatedBrace2.cmake b/Tests/RunCMake/Syntax/UnterminatedBrace2.cmake
new file mode 100644
index 0000000..a650e5b
--- /dev/null
+++ b/Tests/RunCMake/Syntax/UnterminatedBrace2.cmake
@@ -0,0 +1,4 @@
+cmake_minimum_required(VERSION 3.0)
+cmake_policy(SET CMP0010 OLD)
+cmake_policy(SET CMP0053 NEW)
+set(var "${")
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=21333e007bdde9a786da377b7ae5784eb7a48692
commit 21333e007bdde9a786da377b7ae5784eb7a48692
Author: Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Mon Apr 28 14:59:11 2014 -0400
Commit: Ben Boeckel <ben.boeckel at kitware.com>
CommitDate: Mon Apr 28 15:04:44 2014 -0400
policy: Add policy CMP0053
This policy switches between the old EVIS parser and the new, faster
parser.
diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index 4b895fe..136cf5c 100644
--- a/Help/manual/cmake-policies.7.rst
+++ b/Help/manual/cmake-policies.7.rst
@@ -104,3 +104,4 @@ All Policies
/policy/CMP0050
/policy/CMP0051
/policy/CMP0052
+ /policy/CMP0053
diff --git a/Help/policy/CMP0010.rst b/Help/policy/CMP0010.rst
index 01699e1..4f0c8e5 100644
--- a/Help/policy/CMP0010.rst
+++ b/Help/policy/CMP0010.rst
@@ -10,6 +10,9 @@ variable reference is an error. The OLD behavior for this policy is
to warn about the error, leave the string untouched, and continue.
The NEW behavior for this policy is to report an error.
+If :policy:`CMP0053` is used, this policy has no effect and is treated as
+always being NEW.
+
This policy was introduced in CMake version 2.6.3. CMake version
|release| warns when the policy is not set and uses OLD behavior. Use
the cmake_policy command to set it to OLD or NEW explicitly.
diff --git a/Help/policy/CMP0053.rst b/Help/policy/CMP0053.rst
new file mode 100644
index 0000000..820eb9e
--- /dev/null
+++ b/Help/policy/CMP0053.rst
@@ -0,0 +1,26 @@
+CMP0053
+-------
+
+Use new variable expansion rules.
+
+CMake 3.0 and lower used an older, slower implementation of variable expansion
+which offered some behavior no longer allowed by the new parser. Specifically,
+'@' expansion is no longer performed in files not configured using
+:command:`configure_file` or the CONFIGURE signature of :command:`string` and
+literal variable names are restricted to alphanumerics and the characters
+"./-+" and in environment variables "()" are also allowed. If variables with
+other characters are required, use
+
+.. code-block:: cmake
+
+ set(varname "disallowschars&")
+ message("${${varname}}")
+
+This policy also enforces :policy:`CMP0010` unconditionally.
+
+The OLD behavior for this policy is to use the old variable expansion parser.
+The NEW behavior is to use the new variable expansion rules.
+
+This policy was introduced in CMake version 3.1. CMake version |release| warns
+when the policy is not set and uses OLD behavior. Use the cmake_policy
+command to set it to OLD or NEW explicitly.
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index 309f280..94c783c 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -354,6 +354,11 @@ cmPolicies::cmPolicies()
"Reject source and build dirs in installed "
"INTERFACE_INCLUDE_DIRECTORIES.",
3,1,0, cmPolicies::WARN);
+
+ this->DefinePolicy(
+ CMP0053, "CMP0053",
+ "Use the new variable expansion rules.",
+ 3,1,0, cmPolicies::WARN);
}
cmPolicies::~cmPolicies()
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index 60f35c2..e5c82f8 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -108,6 +108,8 @@ public:
CMP0052, ///< Reject source and build dirs in installed
/// INTERFACE_INCLUDE_DIRECTORIES
+ CMP0053, ///< Use the new EVIS parser and rules
+
/** \brief Always the last entry.
*
* Useful mostly to avoid adding a comma the last policy when adding a new
-----------------------------------------------------------------------
Summary of changes:
Help/manual/cmake-policies.7.rst | 1 +
Help/policy/CMP0010.rst | 3 +
Help/policy/CMP0053.rst | 26 ++
Source/cmMakefile.cxx | 425 +++++++++++++++++++-
Source/cmMakefile.h | 41 +-
Source/cmPolicies.cxx | 5 +
Source/cmPolicies.h | 2 +
Tests/RunCMake/Syntax/CMP0053-At-NEW-stderr.txt | 1 +
Tests/RunCMake/Syntax/CMP0053-At-NEW.cmake | 9 +
Tests/RunCMake/Syntax/CMP0053-At-OLD-stderr.txt | 1 +
Tests/RunCMake/Syntax/CMP0053-At-OLD.cmake | 9 +
Tests/RunCMake/Syntax/CMP0053-At-WARN-stderr.txt | 11 +
Tests/RunCMake/Syntax/CMP0053-At-WARN.cmake | 4 +
Tests/RunCMake/Syntax/CMP0053-WARN-stderr.txt | 20 +
Tests/RunCMake/Syntax/CMP0053-WARN.cmake | 5 +
Tests/RunCMake/Syntax/CMakeLists.txt | 2 +-
.../Escape2-result.txt} | 0
Tests/RunCMake/Syntax/Escape2-stderr.txt | 13 +
Tests/RunCMake/Syntax/Escape2.cmake | 7 +
.../EscapeChar-char-result.txt} | 0
.../RunCMake/Syntax/EscapeChar-char-stderr.txt.in | 12 +
Tests/RunCMake/Syntax/EscapeChar-char.cmake.in | 3 +
.../RunCMake/Syntax/EscapeCharsAllowed-stderr.txt | 8 +
Tests/RunCMake/Syntax/EscapeCharsAllowed.cmake | 18 +
Tests/RunCMake/Syntax/EscapeCharsDisallowed.cmake | 42 ++
.../ParenInVarName0-result.txt} | 0
Tests/RunCMake/Syntax/ParenInVarName0-stderr.txt | 12 +
Tests/RunCMake/Syntax/ParenInVarName0.cmake | 4 +
.../ParenInVarName1-result.txt} | 0
Tests/RunCMake/Syntax/ParenInVarName1-stderr.txt | 12 +
Tests/RunCMake/Syntax/ParenInVarName1.cmake | 4 +
Tests/RunCMake/Syntax/RunCMakeTest.cmake | 13 +
Tests/RunCMake/Syntax/Unquoted2-stderr.txt | 1 +
Tests/RunCMake/Syntax/Unquoted2.cmake | 3 +
.../UnterminatedBrace0-result.txt} | 0
.../RunCMake/Syntax/UnterminatedBrace0-stderr.txt | 12 +
Tests/RunCMake/Syntax/UnterminatedBrace0.cmake | 2 +
.../RunCMake/Syntax/UnterminatedBrace1-stderr.txt | 13 +
Tests/RunCMake/Syntax/UnterminatedBrace1.cmake | 3 +
.../UnterminatedBrace2-result.txt} | 0
.../RunCMake/Syntax/UnterminatedBrace2-stderr.txt | 12 +
Tests/RunCMake/Syntax/UnterminatedBrace2.cmake | 4 +
Utilities/Release/Cygwin/CMakeLists.txt | 4 +-
43 files changed, 747 insertions(+), 20 deletions(-)
create mode 100644 Help/policy/CMP0053.rst
create mode 100644 Tests/RunCMake/Syntax/CMP0053-At-NEW-stderr.txt
create mode 100644 Tests/RunCMake/Syntax/CMP0053-At-NEW.cmake
create mode 100644 Tests/RunCMake/Syntax/CMP0053-At-OLD-stderr.txt
create mode 100644 Tests/RunCMake/Syntax/CMP0053-At-OLD.cmake
create mode 100644 Tests/RunCMake/Syntax/CMP0053-At-WARN-stderr.txt
create mode 100644 Tests/RunCMake/Syntax/CMP0053-At-WARN.cmake
create mode 100644 Tests/RunCMake/Syntax/CMP0053-WARN-stderr.txt
create mode 100644 Tests/RunCMake/Syntax/CMP0053-WARN.cmake
copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => Syntax/Escape2-result.txt} (100%)
create mode 100644 Tests/RunCMake/Syntax/Escape2-stderr.txt
create mode 100644 Tests/RunCMake/Syntax/Escape2.cmake
copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => Syntax/EscapeChar-char-result.txt} (100%)
create mode 100644 Tests/RunCMake/Syntax/EscapeChar-char-stderr.txt.in
create mode 100644 Tests/RunCMake/Syntax/EscapeChar-char.cmake.in
create mode 100644 Tests/RunCMake/Syntax/EscapeCharsAllowed-stderr.txt
create mode 100644 Tests/RunCMake/Syntax/EscapeCharsAllowed.cmake
create mode 100644 Tests/RunCMake/Syntax/EscapeCharsDisallowed.cmake
copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => Syntax/ParenInVarName0-result.txt} (100%)
create mode 100644 Tests/RunCMake/Syntax/ParenInVarName0-stderr.txt
create mode 100644 Tests/RunCMake/Syntax/ParenInVarName0.cmake
copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => Syntax/ParenInVarName1-result.txt} (100%)
create mode 100644 Tests/RunCMake/Syntax/ParenInVarName1-stderr.txt
create mode 100644 Tests/RunCMake/Syntax/ParenInVarName1.cmake
create mode 100644 Tests/RunCMake/Syntax/Unquoted2-stderr.txt
create mode 100644 Tests/RunCMake/Syntax/Unquoted2.cmake
copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => Syntax/UnterminatedBrace0-result.txt} (100%)
create mode 100644 Tests/RunCMake/Syntax/UnterminatedBrace0-stderr.txt
create mode 100644 Tests/RunCMake/Syntax/UnterminatedBrace0.cmake
create mode 100644 Tests/RunCMake/Syntax/UnterminatedBrace1-stderr.txt
create mode 100644 Tests/RunCMake/Syntax/UnterminatedBrace1.cmake
copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => Syntax/UnterminatedBrace2-result.txt} (100%)
create mode 100644 Tests/RunCMake/Syntax/UnterminatedBrace2-stderr.txt
create mode 100644 Tests/RunCMake/Syntax/UnterminatedBrace2.cmake
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list