summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2002-12-10 22:43:34 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2002-12-10 22:43:34 (GMT)
commitb0656a2605fc9556736459b51a2ad94b65765578 (patch)
treedb50325845e1809ad15ff8dc682b1730f72b062c /Source
parent3893ee72d2d5a04889cc1056b56029c9d60393c0 (diff)
downloadCMake-b0656a2605fc9556736459b51a2ad94b65765578.zip
CMake-b0656a2605fc9556736459b51a2ad94b65765578.tar.gz
CMake-b0656a2605fc9556736459b51a2ad94b65765578.tar.bz2
Add support for comments on custom commands in visual studio 7
Diffstat (limited to 'Source')
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx20
-rw-r--r--Source/cmLocalVisualStudio7Generator.h1
2 files changed, 17 insertions, 4 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index f049b4a..b9aad0e 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -680,8 +680,10 @@ void cmLocalVisualStudio7Generator::WriteVCProjFile(std::ostream& fout,
std::string totalCommandStr;
totalCommandStr = this->CombineCommands(commands, totalCommand,
source.c_str());
+ const char* comment = totalCommand.m_Comment.c_str();
this->WriteCustomRule(fout, source.c_str(), totalCommandStr.c_str(),
- totalCommand.m_Depends,
+ (*comment?comment:"Custom Rule"),
+ totalCommand.m_Depends,
totalCommand.m_Outputs, compileFlags);
}
else if(compileFlags)
@@ -718,6 +720,7 @@ void cmLocalVisualStudio7Generator::WriteVCProjFile(std::ostream& fout,
void cmLocalVisualStudio7Generator::WriteCustomRule(std::ostream& fout,
const char* source,
const char* command,
+ const char* comment,
const std::set<std::string>& depends,
const std::set<std::string>& outputs,
const char* compileFlags)
@@ -740,6 +743,13 @@ void cmLocalVisualStudio7Generator::WriteCustomRule(std::ostream& fout,
}
fout << "\t\t\t\t\t<Tool\n"
<< "\t\t\t\t\tName=\"VCCustomBuildTool\"\n"
+ << "\t\t\t\t\tDescription=\"Building " << comment;
+ std::set<std::string>::const_iterator it;
+ for ( it = outputs.begin(); it != outputs.end(); it ++ )
+ {
+ fout << " " << *it;
+ }
+ fout << "\"\n"
<< "\t\t\t\t\tCommandLine=\"" << cmd << "\n\"\n"
<< "\t\t\t\t\tAdditionalDependencies=\"";
// Write out the dependencies for the rule.
@@ -798,9 +808,10 @@ void cmLocalVisualStudio7Generator::WriteVCProjEndGroup(std::ostream& fout)
std::string
-cmLocalVisualStudio7Generator::CombineCommands(const cmSourceGroup::Commands &commands,
- cmSourceGroup::CommandFiles &totalCommand,
- const char *source)
+cmLocalVisualStudio7Generator::CombineCommands(
+ const cmSourceGroup::Commands &commands,
+ cmSourceGroup::CommandFiles &totalCommand,
+ const char *source)
{
// Loop through every custom command generating code from the
@@ -818,6 +829,7 @@ cmLocalVisualStudio7Generator::CombineCommands(const cmSourceGroup::Commands &co
totalCommandStr += c->second.m_Arguments;
totalCommandStr += "\n";
totalCommand.Merge(c->second);
+ totalCommand.m_Comment = c->second.m_Comment.c_str();
}
// Create a dummy file with the name of the source if it does
// not exist
diff --git a/Source/cmLocalVisualStudio7Generator.h b/Source/cmLocalVisualStudio7Generator.h
index 8ab18b2..8a74dce 100644
--- a/Source/cmLocalVisualStudio7Generator.h
+++ b/Source/cmLocalVisualStudio7Generator.h
@@ -111,6 +111,7 @@ private:
void WriteCustomRule(std::ostream& fout,
const char* source,
const char* command,
+ const char* comment,
const std::set<std::string>& depends,
const std::set<std::string>& outputs,
const char* extraFlags);