diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2001-09-04 20:07:54 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2001-09-04 20:07:54 (GMT) |
commit | cc5c1fa6f739648d2dfc61355908752c5e073621 (patch) | |
tree | 086941624518402b3e67d4d4413af64ea6c42839 /Source/cmAddCustomTargetCommand.cxx | |
parent | ecff0d36ac396c6fd905bd639a2f2a604d1aad43 (diff) | |
download | CMake-cc5c1fa6f739648d2dfc61355908752c5e073621.zip CMake-cc5c1fa6f739648d2dfc61355908752c5e073621.tar.gz CMake-cc5c1fa6f739648d2dfc61355908752c5e073621.tar.bz2 |
ENH: separate command from its arguments in the custom command. This allows the generator on windows to change the slashes for just the command
Diffstat (limited to 'Source/cmAddCustomTargetCommand.cxx')
-rw-r--r-- | Source/cmAddCustomTargetCommand.cxx | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/Source/cmAddCustomTargetCommand.cxx b/Source/cmAddCustomTargetCommand.cxx index 6320ba6..070c1af 100644 --- a/Source/cmAddCustomTargetCommand.cxx +++ b/Source/cmAddCustomTargetCommand.cxx @@ -53,25 +53,32 @@ bool cmAddCustomTargetCommand::InitialPass(std::vector<std::string>& args) m_Makefile->ExpandVariablesInString(args[0]); // all target option - std::string result; + std::string arguments; std::vector<std::string>::iterator s = args.begin(); - ++s; + ++s; // move past args[0] as it is already to be used if (args.size() >= 3) { if (args[1] == "ALL") { all = true; - ++s; + ++s; // skip all } } + std::string command; + if(s != args.end()) + { + command = m_Makefile->ExpandVariablesInString(*s); + ++s; + } for (;s != args.end(); ++s) { m_Makefile->ExpandVariablesInString(*s); - result += cmSystemTools::EscapeSpaces(s->c_str()); - result += " "; + arguments += cmSystemTools::EscapeSpaces(s->c_str()); + arguments += " "; } m_Makefile->AddUtilityCommand(args[0].c_str(), - result.c_str(), all); + command.c_str(), + arguments.c_str(), all); return true; } |