ENH: Enabled new WORKING_DIRECTORY option to ADD_CUSTOM_COMMAND and ADD_CUSTOM_TARGET on VS 6 generator.

This commit is contained in:
Brad King 2006-02-08 12:01:21 -05:00
parent 7a3ed4644b
commit c6741363de
2 changed files with 7 additions and 9 deletions

View File

@ -303,15 +303,13 @@ void cmLocalVisualStudio6Generator::WriteDSPFile(std::ostream& fout,
target.GetPreBuildCommands().begin(); target.GetPreBuildCommands().begin();
cr != target.GetPreBuildCommands().end(); ++cr) cr != target.GetPreBuildCommands().end(); ++cr)
{ {
this->AddUtilityCommandHack(target, count++, depends, this->AddUtilityCommandHack(target, count++, depends, *cr);
cr->GetCommandLines());
} }
for (std::vector<cmCustomCommand>::const_iterator cr = for (std::vector<cmCustomCommand>::const_iterator cr =
target.GetPostBuildCommands().begin(); target.GetPostBuildCommands().begin();
cr != target.GetPostBuildCommands().end(); ++cr) cr != target.GetPostBuildCommands().end(); ++cr)
{ {
this->AddUtilityCommandHack(target, count++, depends, this->AddUtilityCommandHack(target, count++, depends, *cr);
cr->GetCommandLines());
} }
} }
@ -503,7 +501,7 @@ void
cmLocalVisualStudio6Generator cmLocalVisualStudio6Generator
::AddUtilityCommandHack(cmTarget& target, int count, ::AddUtilityCommandHack(cmTarget& target, int count,
std::vector<std::string>& depends, std::vector<std::string>& depends,
const cmCustomCommandLines& commandLines) const cmCustomCommand& origCommand)
{ {
// Create a fake output that forces the rule to run. // Create a fake output that forces the rule to run.
char* output = new char[(strlen(m_Makefile->GetStartOutputDirectory()) + char* output = new char[(strlen(m_Makefile->GetStartOutputDirectory()) +
@ -518,9 +516,9 @@ cmLocalVisualStudio6Generator
m_Makefile->AddCustomCommandToOutput(output, m_Makefile->AddCustomCommandToOutput(output,
depends, depends,
no_main_dependency, no_main_dependency,
commandLines, origCommand.GetCommandLines(),
no_comment, origCommand.GetComment(),
no_working_directory); origCommand.GetWorkingDirectory());
// Replace the dependencies with the output of this rule so that the // Replace the dependencies with the output of this rule so that the
// next rule added will run after this one. // next rule added will run after this one.

View File

@ -89,7 +89,7 @@ private:
const char* flags); const char* flags);
void AddUtilityCommandHack(cmTarget& target, int count, void AddUtilityCommandHack(cmTarget& target, int count,
std::vector<std::string>& depends, std::vector<std::string>& depends,
const cmCustomCommandLines& commandLines); const cmCustomCommand& origCommand);
void WriteGroup(const cmSourceGroup *sg, cmTarget target, void WriteGroup(const cmSourceGroup *sg, cmTarget target,
std::ostream &fout, const char *libName); std::ostream &fout, const char *libName);
std::string CreateTargetRules(cmTarget &target, std::string CreateTargetRules(cmTarget &target,