summaryrefslogtreecommitdiffstats
path: root/Source/cmAddCustomTargetCommand.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/cmAddCustomTargetCommand.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/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 ccdc8a9..d9879cf 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;
}