[cmake-commits] king committed cmGlobalXCodeGenerator.cxx 1.170 1.171 cmLocalUnixMakefileGenerator3.cxx 1.219 1.220 cmLocalUnixMakefileGenerator3.h 1.75 1.76 cmLocalVisualStudio7Generator.cxx 1.208 1.209

cmake-commits at cmake.org cmake-commits at cmake.org
Tue Dec 18 09:50:10 EST 2007


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv4697/Source

Modified Files:
	cmGlobalXCodeGenerator.cxx cmLocalUnixMakefileGenerator3.cxx 
	cmLocalUnixMakefileGenerator3.h 
	cmLocalVisualStudio7Generator.cxx 
Log Message:
ENH: Implemented generation of display for pre-build, pre-link, and post-build custom command comments during the build.  This addresses issue #5353.


Index: cmLocalUnixMakefileGenerator3.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalUnixMakefileGenerator3.h,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -d -r1.75 -r1.76
--- cmLocalUnixMakefileGenerator3.h	7 Aug 2007 17:57:13 -0000	1.75
+++ cmLocalUnixMakefileGenerator3.h	18 Dec 2007 14:50:08 -0000	1.76
@@ -313,7 +313,8 @@
   void AppendCustomCommands(std::vector<std::string>& commands,
                             const std::vector<cmCustomCommand>& ccs);
   void AppendCustomCommand(std::vector<std::string>& commands,
-                           const cmCustomCommand& cc);
+                           const cmCustomCommand& cc,
+                           bool echo_comment=false);
   void AppendCleanCommand(std::vector<std::string>& commands,
                           const std::vector<std::string>& files,
                           cmTarget& target, const char* filename =0);

Index: cmLocalVisualStudio7Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudio7Generator.cxx,v
retrieving revision 1.208
retrieving revision 1.209
diff -u -d -r1.208 -r1.209
--- cmLocalVisualStudio7Generator.cxx	13 Dec 2007 20:42:49 -0000	1.208
+++ cmLocalVisualStudio7Generator.cxx	18 Dec 2007 14:50:08 -0000	1.209
@@ -1355,6 +1355,12 @@
     {
     if(!init)
       {
+      const char* comment = cr->GetComment();
+      if(comment && *comment)
+        {
+        fout << "\nDescription=\""
+             << this->EscapeForXML(comment) << "\"";
+        }
       fout << "\nCommandLine=\"";
       init = true;
       }
@@ -1385,6 +1391,12 @@
     {
     if(!init)
       {
+      const char* comment = cr->GetComment();
+      if(comment && *comment)
+        {
+        fout << "\nDescription=\""
+             << this->EscapeForXML(comment) << "\"";
+        }
       fout << "\nCommandLine=\"";
       init = true;
       }
@@ -1415,6 +1427,12 @@
     {
     if(!init)
       {
+      const char* comment = cr->GetComment();
+      if(comment && *comment)
+        {
+        fout << "\nDescription=\""
+             << this->EscapeForXML(comment) << "\"";
+        }
       fout << "\nCommandLine=\"";
       init = true;
       }

Index: cmLocalUnixMakefileGenerator3.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalUnixMakefileGenerator3.cxx,v
retrieving revision 1.219
retrieving revision 1.220
diff -u -d -r1.219 -r1.220
--- cmLocalUnixMakefileGenerator3.cxx	17 Dec 2007 22:54:43 -0000	1.219
+++ cmLocalUnixMakefileGenerator3.cxx	18 Dec 2007 14:50:08 -0000	1.220
@@ -902,7 +902,7 @@
   for(std::vector<cmCustomCommand>::const_iterator i = ccs.begin();
       i != ccs.end(); ++i)
     {
-    this->AppendCustomCommand(commands, *i);
+    this->AppendCustomCommand(commands, *i, true);
     }
 }
 
@@ -910,8 +910,22 @@
 void
 cmLocalUnixMakefileGenerator3
 ::AppendCustomCommand(std::vector<std::string>& commands,
-                      const cmCustomCommand& cc)
+                      const cmCustomCommand& cc, bool echo_comment)
 {
+  // Optionally create a command to display the custom command's
+  // comment text.  This is used for pre-build, pre-link, and
+  // post-build command comments.  Custom build step commands have
+  // their comments generated elsewhere.
+  if(echo_comment)
+    {
+    const char* comment = cc.GetComment();
+    if(comment && *comment)
+      {
+      this->AppendEcho(commands, comment,
+                       cmLocalUnixMakefileGenerator3::EchoGenerate);
+      }
+    }
+
   // if the command specified a working directory use it.
   const char* dir  = this->Makefile->GetStartOutputDirectory();
   const char* workingDir = cc.GetWorkingDirectory();

Index: cmGlobalXCodeGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalXCodeGenerator.cxx,v
retrieving revision 1.170
retrieving revision 1.171
diff -u -d -r1.170 -r1.171
--- cmGlobalXCodeGenerator.cxx	18 Dec 2007 00:48:13 -0000	1.170
+++ cmGlobalXCodeGenerator.cxx	18 Dec 2007 14:50:08 -0000	1.171
@@ -1144,11 +1144,6 @@
       {
       bool escapeOldStyle = cc.GetEscapeOldStyle();
       bool escapeAllowMakeVars = cc.GetEscapeAllowMakeVars();
-      makefileStream << "\n#" << "Custom command rule: ";
-      if(cc.GetComment())
-        {
-        makefileStream << cc.GetComment();
-        }
       makefileStream << "\n";
       const std::vector<std::string>& outputs = cc.GetOutputs();
       if(!outputs.empty())
@@ -1175,6 +1170,14 @@
         }
       makefileStream << "\n";
 
+      if(const char* comment = cc.GetComment())
+        {
+        std::string echo_cmd = "echo ";
+        echo_cmd += (this->CurrentLocalGenerator->
+                     EscapeForShell(comment, escapeAllowMakeVars));
+        makefileStream << "\t" << echo_cmd.c_str() << "\n";
+        }
+
       // Add each command line to the set of commands.
       for(cmCustomCommandLines::const_iterator cl = 
           cc.GetCommandLines().begin();



More information about the Cmake-commits mailing list