summaryrefslogtreecommitdiffstats
path: root/Source/cmSourceGroup.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2001-09-04 20:07:54 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2001-09-04 20:07:54 (GMT)
commitcc5c1fa6f739648d2dfc61355908752c5e073621 (patch)
tree086941624518402b3e67d4d4413af64ea6c42839 /Source/cmSourceGroup.cxx
parentecff0d36ac396c6fd905bd639a2f2a604d1aad43 (diff)
downloadCMake-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/cmSourceGroup.cxx')
-rw-r--r--Source/cmSourceGroup.cxx30
1 files changed, 20 insertions, 10 deletions
diff --git a/Source/cmSourceGroup.cxx b/Source/cmSourceGroup.cxx
index 1ae771c..9f14bb4 100644
--- a/Source/cmSourceGroup.cxx
+++ b/Source/cmSourceGroup.cxx
@@ -94,32 +94,40 @@ void cmSourceGroup::AddSource(const char* name)
*/
void cmSourceGroup::AddCustomCommand(const cmCustomCommand &cmd)
{
+ std::string commandAndArgs = cmd.GetCommandAndArguments();
BuildRules::iterator s = m_BuildRules.find(cmd.GetSourceName());
if(s == m_BuildRules.end())
{
// The source was not found. Add it with this command.
- m_BuildRules[cmd.GetSourceName()][cmd.GetCommand()].
- m_Depends.insert(cmd.GetDepends().begin(),cmd.GetDepends().end());
- m_BuildRules[cmd.GetSourceName()][cmd.GetCommand()].
- m_Outputs.insert(cmd.GetOutputs().begin(),cmd.GetOutputs().end());
+ CommandFiles& cmdFiles = m_BuildRules[cmd.GetSourceName()][commandAndArgs];
+ cmdFiles.m_Command = cmd.GetCommand();
+ cmdFiles.m_Arguments = cmd.GetArguments();
+ cmdFiles.m_Depends.insert(cmd.GetDepends().begin(),cmd.GetDepends().end());
+ cmdFiles.m_Outputs.insert(cmd.GetOutputs().begin(),cmd.GetOutputs().end());
return;
}
// The source already exists. See if the command exists.
Commands& commands = s->second;
- Commands::iterator c = commands.find(cmd.GetCommand());
+ Commands::iterator c = commands.find(commandAndArgs);
if(c == commands.end())
{
// The command did not exist. Add it.
- commands[cmd.GetCommand()].m_Depends.insert(cmd.GetDepends().begin(), cmd.GetDepends().end());
- commands[cmd.GetCommand()].m_Outputs.insert(cmd.GetOutputs().begin(), cmd.GetOutputs().end());
+ commands[commandAndArgs].m_Command = cmd.GetCommand();
+ commands[commandAndArgs].m_Arguments = cmd.GetArguments();
+ commands[commandAndArgs].m_Depends.insert(cmd.GetDepends().begin(),
+ cmd.GetDepends().end());
+ commands[commandAndArgs].m_Outputs.insert(cmd.GetOutputs().begin(),
+ cmd.GetOutputs().end());
return;
}
// The command already exists for this source. Merge the sets.
CommandFiles& commandFiles = c->second;
- commandFiles.m_Depends.insert(cmd.GetDepends().begin(), cmd.GetDepends().end());
- commandFiles.m_Outputs.insert(cmd.GetOutputs().begin(), cmd.GetOutputs().end());
+ commandFiles.m_Depends.insert(cmd.GetDepends().begin(),
+ cmd.GetDepends().end());
+ commandFiles.m_Outputs.insert(cmd.GetOutputs().begin(),
+ cmd.GetOutputs().end());
}
void cmSourceGroup::Print() const
@@ -132,7 +140,9 @@ void cmSourceGroup::Print() const
for(Commands::const_iterator j = i->second.begin();
j != i->second.end(); ++j)
{
- std::cout << "Command: " << j->first.c_str() << "\n";
+ std::cout << "FullCommand: " << j->first.c_str() << "\n";
+ std::cout << "Command: " << j->second.m_Command.c_str() << "\n";
+ std::cout << "Arguments: " << j->second.m_Arguments.c_str() << "\n";
std::cout << "Command Outputs " << j->second.m_Outputs.size() << "\n";
std::cout << "Command Depends " << j->second.m_Depends.size() << "\n";
}