diff options
author | David Cole <david.cole@kitware.com> | 2012-03-02 16:50:54 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2012-03-02 16:50:54 (GMT) |
commit | 5012787c3c63523115f2f5254644d320ad27beba (patch) | |
tree | 0ed0cb15f13a4107fa7d0dbe498d6064c2764bf9 /Source | |
parent | 8c1f041239a07e9ca395b64f36c3c90b0ca5f75d (diff) | |
parent | 944b90be60ab7888a76d76acbb0200f511db3d60 (diff) | |
download | CMake-5012787c3c63523115f2f5254644d320ad27beba.zip CMake-5012787c3c63523115f2f5254644d320ad27beba.tar.gz CMake-5012787c3c63523115f2f5254644d320ad27beba.tar.bz2 |
Merge topic 'while-testing'
944b90b add testcases for while()/endwhile() errors
f605b92 improve error message on a stray "endwhile()"
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmEndWhileCommand.cxx | 17 | ||||
-rw-r--r-- | Source/cmEndWhileCommand.h | 2 |
2 files changed, 14 insertions, 5 deletions
diff --git a/Source/cmEndWhileCommand.cxx b/Source/cmEndWhileCommand.cxx index bb4d40a..abb9e5e 100644 --- a/Source/cmEndWhileCommand.cxx +++ b/Source/cmEndWhileCommand.cxx @@ -12,12 +12,21 @@ #include "cmEndWhileCommand.h" bool cmEndWhileCommand -::InvokeInitialPass(std::vector<cmListFileArgument> const&, +::InvokeInitialPass(std::vector<cmListFileArgument> const& args, cmExecutionStatus &) { - this->SetError("An ENDWHILE command was found outside of a proper " - "WHILE ENDWHILE structure. Or its arguments did not " - "match the opening WHILE command."); + if (args.empty()) + { + this->SetError("An ENDWHILE command was found outside of a proper " + "WHILE ENDWHILE structure."); + } + else + { + this->SetError("An ENDWHILE command was found outside of a proper " + "WHILE ENDWHILE structure. Or its arguments did not " + "match the opening WHILE command."); + } + return false; } diff --git a/Source/cmEndWhileCommand.h b/Source/cmEndWhileCommand.h index 98072d5..635ad5a 100644 --- a/Source/cmEndWhileCommand.h +++ b/Source/cmEndWhileCommand.h @@ -34,7 +34,7 @@ public: * Override cmCommand::InvokeInitialPass to get arguments before * expansion. */ - virtual bool InvokeInitialPass(std::vector<cmListFileArgument> const&, + virtual bool InvokeInitialPass(std::vector<cmListFileArgument> const& args, cmExecutionStatus &status); /** |