summaryrefslogtreecommitdiffstats
path: root/Source/cmAddCustomTargetCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-10-04 22:10:30 (GMT)
committerBrad King <brad.king@kitware.com>2006-10-04 22:10:30 (GMT)
commit5a6b0792cd5b3dd16b8a94091db15e02e9b4a00b (patch)
tree0555eb82a57d07bddefdfb3cf3760f1042fa763d /Source/cmAddCustomTargetCommand.cxx
parent168591e72dd3d67ae2ced24582e6b117a9a2ac4f (diff)
downloadCMake-5a6b0792cd5b3dd16b8a94091db15e02e9b4a00b.zip
CMake-5a6b0792cd5b3dd16b8a94091db15e02e9b4a00b.tar.gz
CMake-5a6b0792cd5b3dd16b8a94091db15e02e9b4a00b.tar.bz2
ENH: Added COMMENT option to ADD_CUSTOM_TARGET. This addresses bug#3461.
Diffstat (limited to 'Source/cmAddCustomTargetCommand.cxx')
-rw-r--r--Source/cmAddCustomTargetCommand.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/Source/cmAddCustomTargetCommand.cxx b/Source/cmAddCustomTargetCommand.cxx
index 9d73cd0..4141509 100644
--- a/Source/cmAddCustomTargetCommand.cxx
+++ b/Source/cmAddCustomTargetCommand.cxx
@@ -59,12 +59,15 @@ bool cmAddCustomTargetCommand::InitialPass(
std::vector<std::string> depends;
std::string working_directory;
bool verbatim = false;
+ std::string comment_buffer;
+ const char* comment = 0;
// Keep track of parser state.
enum tdoing {
doing_command,
doing_depends,
doing_working_directory,
+ doing_comment,
doing_verbatim
};
tdoing doing = doing_command;
@@ -99,6 +102,10 @@ bool cmAddCustomTargetCommand::InitialPass(
doing = doing_verbatim;
verbatim = true;
}
+ else if (copy == "COMMENT")
+ {
+ doing = doing_comment;
+ }
else if(copy == "COMMAND")
{
doing = doing_command;
@@ -123,6 +130,10 @@ bool cmAddCustomTargetCommand::InitialPass(
case doing_depends:
depends.push_back(copy);
break;
+ case doing_comment:
+ comment_buffer = copy;
+ comment = comment_buffer.c_str();
+ break;
default:
this->SetError("Wrong syntax. Unknown type of argument.");
return false;
@@ -151,7 +162,7 @@ bool cmAddCustomTargetCommand::InitialPass(
bool escapeOldStyle = !verbatim;
this->Makefile->AddUtilityCommand(args[0].c_str(), all,
working_directory.c_str(), depends,
- commandLines, escapeOldStyle);
+ commandLines, escapeOldStyle, comment);
return true;
}