diff options
author | Ken Martin <ken.martin@kitware.com> | 2009-06-12 14:07:05 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2009-06-12 14:07:05 (GMT) |
commit | a73071ca175c70db95271688ef9c7711e700f9a7 (patch) | |
tree | 7845929f87622edbe30e9009e80aa3c6016fe5c1 /Source/cmWhileCommand.cxx | |
parent | 7e03edf1df6875b80f53b66dce5ac4f42a49394d (diff) | |
download | CMake-a73071ca175c70db95271688ef9c7711e700f9a7.zip CMake-a73071ca175c70db95271688ef9c7711e700f9a7.tar.gz CMake-a73071ca175c70db95271688ef9c7711e700f9a7.tar.bz2 |
ENH: modified the if command to address bug 9123 some
Diffstat (limited to 'Source/cmWhileCommand.cxx')
-rw-r--r-- | Source/cmWhileCommand.cxx | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/Source/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx index e51f253..c071b66 100644 --- a/Source/cmWhileCommand.cxx +++ b/Source/cmWhileCommand.cxx @@ -41,11 +41,35 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf, std::vector<std::string> expandedArguments; mf.ExpandArguments(this->Args, expandedArguments); + cmake::MessageType messageType; bool isTrue = - cmIfCommand::IsTrue(expandedArguments,errorString,&mf); + cmIfCommand::IsTrue(expandedArguments,errorString, + &mf, messageType); while (isTrue) { + if (errorString.size()) + { + std::string err = "had incorrect arguments: "; + unsigned int i; + for(i =0; i < this->Args.size(); ++i) + { + err += (this->Args[i].Quoted?"\"":""); + err += this->Args[i].Value; + err += (this->Args[i].Quoted?"\"":""); + err += " "; + } + err += "("; + err += errorString; + err += ")."; + mf.IssueMessage(messageType, err); + if (messageType == cmake::FATAL_ERROR) + { + cmSystemTools::SetFatalErrorOccured(); + return true; + } + } + // Invoke all the functions that were collected in the block. for(unsigned int c = 0; c < this->Functions.size(); ++c) { @@ -68,7 +92,8 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf, expandedArguments.clear(); mf.ExpandArguments(this->Args, expandedArguments); isTrue = - cmIfCommand::IsTrue(expandedArguments,errorString,&mf); + cmIfCommand::IsTrue(expandedArguments,errorString, + &mf, messageType); } return true; } |