summaryrefslogtreecommitdiff
path: root/Source/cmAddCustomTargetCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-09-28 11:30:49 -0400
committerBrad King <brad.king@kitware.com>2006-09-28 11:30:49 -0400
commitd01b6f12819c4d8aec189ae3eebfd1779565bbf2 (patch)
tree90a04b304477a20c1adbc46b5ee2d892e4aae64b /Source/cmAddCustomTargetCommand.cxx
parent16f8da8b1443b7ebb315f40aa1ae199d87f211de (diff)
downloadcmake-d01b6f12819c4d8aec189ae3eebfd1779565bbf2.tar.gz
ENH: Added VERBATIM option to ADD_CUSTOM_COMMAND and ADD_CUSTOM_TARGET commands. This option enables full escaping of custom command arguments on all platforms. See bug#3786.
Diffstat (limited to 'Source/cmAddCustomTargetCommand.cxx')
-rw-r--r--Source/cmAddCustomTargetCommand.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/Source/cmAddCustomTargetCommand.cxx b/Source/cmAddCustomTargetCommand.cxx
index ccdc8a95a5..d9879cf988 100644
--- a/Source/cmAddCustomTargetCommand.cxx
+++ b/Source/cmAddCustomTargetCommand.cxx
@@ -58,12 +58,14 @@ bool cmAddCustomTargetCommand::InitialPass(
// Accumulate dependencies.
std::vector<std::string> depends;
std::string working_directory;
+ bool verbatim = false;
// Keep track of parser state.
enum tdoing {
doing_command,
doing_depends,
- doing_working_directory
+ doing_working_directory,
+ doing_verbatim
};
tdoing doing = doing_command;
@@ -92,6 +94,11 @@ bool cmAddCustomTargetCommand::InitialPass(
{
doing = doing_working_directory;
}
+ else if(copy == "VERBATIM")
+ {
+ doing = doing_verbatim;
+ verbatim = true;
+ }
else if(copy == "COMMAND")
{
doing = doing_command;
@@ -141,10 +148,11 @@ bool cmAddCustomTargetCommand::InitialPass(
}
// Add the utility target to the makefile.
+ bool escapeOldStyle = !verbatim;
const char* no_output = 0;
this->Makefile->AddUtilityCommand(args[0].c_str(), all, no_output,
working_directory.c_str(), depends,
- commandLines);
+ commandLines, escapeOldStyle);
return true;
}