diff options
author | Brad King <brad.king@kitware.com> | 2008-09-24 12:51:19 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-09-24 12:51:19 (GMT) |
commit | d524f3675e455335eceb94eb7dce7fdb014abf58 (patch) | |
tree | 6ad0c5fcfd12df536f6d1f4bcafcc2fd641dac94 /Source/cmPolicies.cxx | |
parent | 4a1317de364979ff8850ce02360aa54c54064214 (diff) | |
download | CMake-d524f3675e455335eceb94eb7dce7fdb014abf58.zip CMake-d524f3675e455335eceb94eb7dce7fdb014abf58.tar.gz CMake-d524f3675e455335eceb94eb7dce7fdb014abf58.tar.bz2 |
ENH: Improve argument parsing error messages
Previously error messages produced by parsing of command argument
variable references, such as bad $KEY{VAR} syntax or a bad escape
sequence, did not provide good context information. Errors parsing
arguments inside macro invocations gave no context at all. Furthermore,
some errors such as a missing close curly "${VAR" would be reported but
build files would still be generated.
These changes teach CMake to report errors with good context information
for all command argument parsing problems. Policy CMP0010 is introduced
so that existing projects that built despite such errors will continue
to work.
Diffstat (limited to 'Source/cmPolicies.cxx')
-rw-r--r-- | Source/cmPolicies.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index 5d8c71f..be546f8 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -323,6 +323,18 @@ cmPolicies::cmPolicies() "by default, but only if FOLLOW_SYMLINKS is given as an additional " "argument to the FILE command.", 2,6,2, cmPolicies::WARN); + + this->DefinePolicy( + CMP0010, "CMP0010", + "Bad variable reference syntax is an error.", + "In CMake 2.6.2 and below, incorrect variable reference syntax such as " + "a missing close-brace (\"${FOO\") was reported but did not stop " + "processing of CMake code. " + "This policy determines whether a bad 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.", + 2,6,3, cmPolicies::WARN); } cmPolicies::~cmPolicies() |