diff options
author | Brad King <brad.king@kitware.com> | 2006-09-28 11:30:49 -0400 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2006-09-28 11:30:49 -0400 |
commit | d01b6f12819c4d8aec189ae3eebfd1779565bbf2 (patch) | |
tree | 90a04b304477a20c1adbc46b5ee2d892e4aae64b /Source/cmAddCustomTargetCommand.cxx | |
parent | 16f8da8b1443b7ebb315f40aa1ae199d87f211de (diff) | |
download | cmake-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.cxx | 12 |
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; } |