summaryrefslogtreecommitdiffstats
path: root/Source/cmAddCustomCommandCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-09-28 15:30:49 (GMT)
committerBrad King <brad.king@kitware.com>2006-09-28 15:30:49 (GMT)
commitd01b6f12819c4d8aec189ae3eebfd1779565bbf2 (patch)
tree90a04b304477a20c1adbc46b5ee2d892e4aae64b /Source/cmAddCustomCommandCommand.cxx
parent16f8da8b1443b7ebb315f40aa1ae199d87f211de (diff)
downloadCMake-d01b6f12819c4d8aec189ae3eebfd1779565bbf2.zip
CMake-d01b6f12819c4d8aec189ae3eebfd1779565bbf2.tar.gz
CMake-d01b6f12819c4d8aec189ae3eebfd1779565bbf2.tar.bz2
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/cmAddCustomCommandCommand.cxx')
-rw-r--r--Source/cmAddCustomCommandCommand.cxx22
1 files changed, 15 insertions, 7 deletions
diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx
index 4f6df9e..3c37d4b 100644
--- a/Source/cmAddCustomCommandCommand.cxx
+++ b/Source/cmAddCustomCommandCommand.cxx
@@ -35,6 +35,7 @@ bool cmAddCustomCommandCommand::InitialPass(
std::string source, target, comment, main_dependency,
working;
std::vector<std::string> depends, outputs, output;
+ bool verbatim = false;
// Accumulate one command line at a time.
cmCustomCommandLine currentLine;
@@ -90,6 +91,10 @@ bool cmAddCustomCommandCommand::InitialPass(
{
cctype = cmTarget::POST_BUILD;
}
+ else if(copy == "VERBATIM")
+ {
+ verbatim = true;
+ }
else if(copy == "TARGET")
{
doing = doing_target;
@@ -211,28 +216,31 @@ bool cmAddCustomCommandCommand::InitialPass(
}
// Choose which mode of the command to use.
+ bool escapeOldStyle = !verbatim;
if(source.empty() && output.empty())
{
// Source is empty, use the target.
std::vector<std::string> no_depends;
this->Makefile->AddCustomCommandToTarget(target.c_str(), no_depends,
- commandLines, cctype,
- comment.c_str(), working.c_str());
+ commandLines, cctype,
+ comment.c_str(), working.c_str(),
+ escapeOldStyle);
}
else if(target.empty())
{
// Target is empty, use the output.
this->Makefile->AddCustomCommandToOutput(output, depends,
- main_dependency.c_str(),
- commandLines, comment.c_str(),
- working.c_str());
+ main_dependency.c_str(),
+ commandLines, comment.c_str(),
+ working.c_str(), false,
+ escapeOldStyle);
}
else
{
// Use the old-style mode for backward compatibility.
this->Makefile->AddCustomCommandOldStyle(target.c_str(), outputs, depends,
- source.c_str(), commandLines,
- comment.c_str());
+ source.c_str(), commandLines,
+ comment.c_str());
}
return true;
}