summaryrefslogtreecommitdiffstats
path: root/Source/cmAddCustomCommandCommand.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2002-12-10 21:47:37 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2002-12-10 21:47:37 (GMT)
commit3893ee72d2d5a04889cc1056b56029c9d60393c0 (patch)
tree3d96e526b726e7c0f2965489f74f2655776d6390 /Source/cmAddCustomCommandCommand.cxx
parentab64db6ee84604c361a2d6f279398f7c9d3247f5 (diff)
downloadCMake-3893ee72d2d5a04889cc1056b56029c9d60393c0.zip
CMake-3893ee72d2d5a04889cc1056b56029c9d60393c0.tar.gz
CMake-3893ee72d2d5a04889cc1056b56029c9d60393c0.tar.bz2
Add comment support, so that you can see in build process what the custom command does
Diffstat (limited to 'Source/cmAddCustomCommandCommand.cxx')
-rw-r--r--Source/cmAddCustomCommandCommand.cxx20
1 files changed, 12 insertions, 8 deletions
diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx
index 3717dd5..6b1c09c 100644
--- a/Source/cmAddCustomCommandCommand.cxx
+++ b/Source/cmAddCustomCommandCommand.cxx
@@ -32,7 +32,7 @@ bool cmAddCustomCommandCommand::InitialPass(std::vector<std::string> const& args
std::vector<std::string> args;
cmSystemTools::ExpandListArguments(argsIn, args);
- std::string source, command, target;
+ std::string source, command, target, comment;
std::vector<std::string> command_args, depends, outputs;
enum tdoing {
@@ -42,6 +42,7 @@ bool cmAddCustomCommandCommand::InitialPass(std::vector<std::string> const& args
doing_args,
doing_depends,
doing_outputs,
+ doing_comment,
doing_nothing
};
@@ -75,6 +76,10 @@ bool cmAddCustomCommandCommand::InitialPass(std::vector<std::string> const& args
{
doing = doing_outputs;
}
+ else if (copy == "COMMENT")
+ {
+ doing = doing_comment;
+ }
else
{
switch (doing)
@@ -97,6 +102,9 @@ bool cmAddCustomCommandCommand::InitialPass(std::vector<std::string> const& args
case doing_outputs:
outputs.push_back(copy);
break;
+ case doing_comment:
+ comment = copy;
+ break;
default:
this->SetError("Wrong syntax. Unknow type of argument.");
return false;
@@ -108,12 +116,7 @@ bool cmAddCustomCommandCommand::InitialPass(std::vector<std::string> const& args
For the moment, let's say that COMMAND, TARGET are always
required.
*/
-
- if(command.empty())
- {
- this->SetError("Wrong syntax. Empty COMMAND.");
- return false;
- }
+
if(target.empty())
{
this->SetError("Wrong syntax. Empty TARGET.");
@@ -133,7 +136,8 @@ bool cmAddCustomCommandCommand::InitialPass(std::vector<std::string> const& args
command_args,
depends,
outputs,
- target.c_str());
+ target.c_str(),
+ comment.c_str());
return true;
}