diff options
author | Sebastien Barre <sebastien.barre@kitware.com> | 2002-03-29 15:56:07 (GMT) |
---|---|---|
committer | Sebastien Barre <sebastien.barre@kitware.com> | 2002-03-29 15:56:07 (GMT) |
commit | b6ebd7b7faae86140fb711dac1f96e2dd047ecd9 (patch) | |
tree | 5ba53639c85100d81ebabe7879ed2ecdf62d9116 /Source/cmMessageCommand.cxx | |
parent | 61697fab50336f095bcd1729be7fabd223466ab7 (diff) | |
download | CMake-b6ebd7b7faae86140fb711dac1f96e2dd047ecd9.zip CMake-b6ebd7b7faae86140fb711dac1f96e2dd047ecd9.tar.gz CMake-b6ebd7b7faae86140fb711dac1f96e2dd047ecd9.tar.bz2 |
ENH: Add SEND_ERROR flag to MESSAGE so that an error can be raised within a CMakeList file
Diffstat (limited to 'Source/cmMessageCommand.cxx')
-rw-r--r-- | Source/cmMessageCommand.cxx | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/Source/cmMessageCommand.cxx b/Source/cmMessageCommand.cxx index f1ade11..0cb2661 100644 --- a/Source/cmMessageCommand.cxx +++ b/Source/cmMessageCommand.cxx @@ -25,13 +25,31 @@ bool cmMessageCommand::InitialPass(std::vector<std::string> const& args) this->SetError("called with incorrect number of arguments"); return false; } + std::string message; std::vector<std::string>::const_iterator i = args.begin(); + + bool send_error = false; + if (*i == "SEND_ERROR") + { + send_error = true; + ++i; + } + for(;i != args.end(); ++i) { message += *i; } - cmSystemTools::Message(message.c_str()); + + if (send_error) + { + cmSystemTools::Error(message.c_str()); + } + else + { + cmSystemTools::Message(message.c_str()); + } + return true; } |