[cmake-commits] king committed cmAddCustomCommandCommand.cxx 1.32 1.33 cmCustomCommand.cxx 1.20 1.21 cmCustomCommand.h 1.18 1.19 cmGlobalVisualStudio71Generator.cxx 1.32 1.33 cmGlobalVisualStudio71Generator.h 1.14 1.15 cmGlobalVisualStudio7Generator.cxx 1.75 1.76 cmGlobalVisualStudio7Generator.h 1.37 1.38 cmGlobalVisualStudio8Generator.cxx 1.14 1.15 cmGlobalVisualStudio8Generator.h 1.6 1.7 cmLocalGenerator.cxx 1.154 1.155 cmLocalVisualStudio7Generator.cxx 1.147 1.148 cmLocalVisualStudio7Generator.h 1.25 1.26 cmMakefile.cxx 1.354 1.355 cmMakefileExecutableTargetGenerator.cxx 1.20 1.21 cmMakefileExecutableTargetGenerator.h 1.2 1.3 cmMakefileLibraryTargetGenerator.cxx 1.24 1.25 cmMakefileLibraryTargetGenerator.h 1.2 1.3 cmMakefileTargetGenerator.cxx 1.44 1.45 cmMakefileTargetGenerator.h 1.10 1.11

cmake-commits at cmake.org cmake-commits at cmake.org
Thu Sep 28 16:40:37 EDT 2006


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

Modified Files:
	cmAddCustomCommandCommand.cxx cmCustomCommand.cxx 
	cmCustomCommand.h cmGlobalVisualStudio71Generator.cxx 
	cmGlobalVisualStudio71Generator.h 
	cmGlobalVisualStudio7Generator.cxx 
	cmGlobalVisualStudio7Generator.h 
	cmGlobalVisualStudio8Generator.cxx 
	cmGlobalVisualStudio8Generator.h cmLocalGenerator.cxx 
	cmLocalVisualStudio7Generator.cxx 
	cmLocalVisualStudio7Generator.h cmMakefile.cxx 
	cmMakefileExecutableTargetGenerator.cxx 
	cmMakefileExecutableTargetGenerator.h 
	cmMakefileLibraryTargetGenerator.cxx 
	cmMakefileLibraryTargetGenerator.h 
	cmMakefileTargetGenerator.cxx cmMakefileTargetGenerator.h 
Log Message:
BUG: Fix/cleanup custom commands and custom targets.  Make empty comment strings work.  Fix ZERO_CHECK target always out of date for debugging.  Fix Makefile driving of custom commands in a custom target.  Fix dependencies on custom targets not in ALL in VS generators.


Index: cmLocalVisualStudio7Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudio7Generator.cxx,v
retrieving revision 1.147
retrieving revision 1.148
diff -u -d -r1.147 -r1.148
--- cmLocalVisualStudio7Generator.cxx	27 Sep 2006 17:43:45 -0000	1.147
+++ cmLocalVisualStudio7Generator.cxx	28 Sep 2006 20:40:35 -0000	1.148
@@ -44,11 +44,11 @@
   lang.insert("IDL");
   lang.insert("DEF");
   this->CreateCustomTargetsAndCommands(lang);
-  this->FixTargets();
+  this->FixGlobalTargets();
   this->OutputVCProjFile();
 }
 
-void cmLocalVisualStudio7Generator::FixTargets()
+void cmLocalVisualStudio7Generator::FixGlobalTargets()
 {
   // Visual Studio .NET 2003 Service Pack 1 will not run post-build
   // commands for targets in which no sources are built.  Add dummy
@@ -58,8 +58,7 @@
       l != tgts.end(); l++)
     {
     cmTarget& tgt = l->second;
-    if(tgt.GetType() == cmTarget::GLOBAL_TARGET ||
-       tgt.GetType() == cmTarget::UTILITY)
+    if(tgt.GetType() == cmTarget::GLOBAL_TARGET)
       {
       std::vector<std::string> no_depends;
       cmCustomCommandLine force_command;

Index: cmLocalVisualStudio7Generator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudio7Generator.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- cmLocalVisualStudio7Generator.h	26 Aug 2006 02:56:41 -0000	1.25
+++ cmLocalVisualStudio7Generator.h	28 Sep 2006 20:40:35 -0000	1.26
@@ -71,7 +71,7 @@
                                    std::string& flags);
   std::string GetBuildTypeLinkerFlags(std::string rootLinkerFlags,
                                       const char* configName);
-  void FixTargets();
+  void FixGlobalTargets();
   void OutputVCProjFile();
   void WriteVCProjHeader(std::ostream& fout, const char *libName,
                          cmTarget &tgt, std::vector<cmSourceGroup> &sgs);

Index: cmMakefileExecutableTargetGenerator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileExecutableTargetGenerator.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- cmMakefileExecutableTargetGenerator.h	16 Feb 2006 20:19:00 -0000	1.2
+++ cmMakefileExecutableTargetGenerator.h	28 Sep 2006 20:40:35 -0000	1.3
@@ -22,6 +22,8 @@
 class cmMakefileExecutableTargetGenerator: public cmMakefileTargetGenerator
 {
 public:
+  cmMakefileExecutableTargetGenerator();
+
   /* the main entry point for this class. Writes the Makefiles associated
      with this target */
   virtual void WriteRuleFiles();

Index: cmGlobalVisualStudio8Generator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio8Generator.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- cmGlobalVisualStudio8Generator.h	11 May 2006 15:47:03 -0000	1.6
+++ cmGlobalVisualStudio8Generator.h	28 Sep 2006 20:40:35 -0000	1.7
@@ -56,7 +56,8 @@
   virtual void WriteSLNHeader(std::ostream& fout);
   virtual void WriteSolutionConfigurations(std::ostream& fout);
   virtual void WriteProjectConfigurations(std::ostream& fout,
-                                          const char* name, bool in_all);
+                                          const char* name,
+                                          int targetType);
   std::string PlatformName; // Win32 or x64 
 };
 #endif

Index: cmLocalGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalGenerator.cxx,v
retrieving revision 1.154
retrieving revision 1.155
diff -u -d -r1.154 -r1.155
--- cmLocalGenerator.cxx	28 Sep 2006 14:37:18 -0000	1.154
+++ cmLocalGenerator.cxx	28 Sep 2006 20:40:35 -0000	1.155
@@ -1910,7 +1910,7 @@
                                    const char* default_comment)
 {
   // Check for a comment provided with the command.
-  if(cc.GetComment() && *cc.GetComment())
+  if(cc.GetComment())
     {
     return cc.GetComment();
     }

Index: cmGlobalVisualStudio8Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio8Generator.cxx,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- cmGlobalVisualStudio8Generator.cxx	28 Sep 2006 17:55:25 -0000	1.14
+++ cmGlobalVisualStudio8Generator.cxx	28 Sep 2006 20:40:35 -0000	1.15
@@ -227,20 +227,20 @@
 //----------------------------------------------------------------------------
 void
 cmGlobalVisualStudio8Generator
-::WriteProjectConfigurations(std::ostream& fout,
-                             const char* name, bool in_all_build)
+::WriteProjectConfigurations(std::ostream& fout, const char* name,
+                             int targetType)
 {
   std::string guid = this->GetGUID(name);
   for(std::vector<std::string>::iterator i = this->Configurations.begin();
       i != this->Configurations.end(); ++i)
     {
-    fout << "\t\t{" << guid << "}." << *i 
-         << "|" << this->PlatformName << ".ActiveCfg = " 
+    fout << "\t\t{" << guid << "}." << *i
+         << "|" << this->PlatformName << ".ActiveCfg = "
          << *i << "|" << this->PlatformName << "\n";
-    if (in_all_build)
+    if(targetType != cmTarget::GLOBAL_TARGET)
       {
-      fout << "\t\t{" << guid << "}." << *i 
-           << "|" << this->PlatformName << ".Build.0 = " 
+      fout << "\t\t{" << guid << "}." << *i
+           << "|" << this->PlatformName << ".Build.0 = "
            << *i << "|" << this->PlatformName << "\n";
       }
     }

Index: cmGlobalVisualStudio71Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio71Generator.cxx,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- cmGlobalVisualStudio71Generator.cxx	11 May 2006 15:47:02 -0000	1.32
+++ cmGlobalVisualStudio71Generator.cxx	28 Sep 2006 20:40:35 -0000	1.33
@@ -253,14 +253,14 @@
         cmCustomCommand cc = l->second.GetPostBuildCommands()[0];
         const cmCustomCommandLines& cmds = cc.GetCommandLines();
         std::string project = cmds[0][0];
-        this->WriteProjectConfigurations(fout, project.c_str(), 
-                                         l->second.IsInAll());
+        this->WriteProjectConfigurations(fout, project.c_str(),
+                                         l->second.GetType());
         }
       else if ((l->second.GetType() != cmTarget::INSTALL_FILES)
                && (l->second.GetType() != cmTarget::INSTALL_PROGRAMS))
         {
-        this->WriteProjectConfigurations(fout, si->c_str(), 
-                                         l->second.IsInAll());
+        this->WriteProjectConfigurations(fout, si->c_str(),
+                                         l->second.GetType());
         ++si;
         }
       }
@@ -415,19 +415,18 @@
 // Write a dsp file into the SLN file, Note, that dependencies from
 // executables to the libraries it uses are also done here
 void cmGlobalVisualStudio71Generator
-::WriteProjectConfigurations(std::ostream& fout, 
-                             const char* name, 
-                             bool in_all_build)
+::WriteProjectConfigurations(std::ostream& fout, const char* name,
+                             int targetType)
 {
   std::string guid = this->GetGUID(name);
   for(std::vector<std::string>::iterator i = this->Configurations.begin();
       i != this->Configurations.end(); ++i)
     {
-    fout << "\t\t{" << guid << "}." << *i 
+    fout << "\t\t{" << guid << "}." << *i
          << ".ActiveCfg = " << *i << "|Win32\n";
-    if (in_all_build)
+    if(targetType != cmTarget::GLOBAL_TARGET)
       {
-      fout << "\t\t{" << guid << "}." << *i 
+      fout << "\t\t{" << guid << "}." << *i
            << ".Build.0 = " << *i << "|Win32\n";
       }
     }

Index: cmCustomCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCustomCommand.cxx,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- cmCustomCommand.cxx	27 Sep 2006 20:20:47 -0000	1.20
+++ cmCustomCommand.cxx	28 Sep 2006 20:40:35 -0000	1.21
@@ -19,6 +19,7 @@
 //----------------------------------------------------------------------------
 cmCustomCommand::cmCustomCommand()
 {
+  this->HaveComment = false;
   this->EscapeOldStyle = true;
   this->EscapeAllowMakeVars = false;
   this->Used = false;
@@ -29,6 +30,7 @@
   Outputs(r.Outputs),
   Depends(r.Depends),
   CommandLines(r.CommandLines),
+  HaveComment(r.HaveComment),
   Comment(r.Comment),
   WorkingDirectory(r.WorkingDirectory),
   EscapeAllowMakeVars(r.EscapeAllowMakeVars),
@@ -41,13 +43,16 @@
 cmCustomCommand::cmCustomCommand(const std::vector<std::string>& outputs,
                                  const std::vector<std::string>& depends,
                                  const cmCustomCommandLines& commandLines,
-                                 const char* comment, 
+                                 const char* comment,
                                  const char* workingDirectory):
   Outputs(outputs),
   Depends(depends),
   CommandLines(commandLines),
+  HaveComment(comment?true:false),
   Comment(comment?comment:""),
-  WorkingDirectory(workingDirectory?workingDirectory:"")
+  WorkingDirectory(workingDirectory?workingDirectory:""),
+  EscapeAllowMakeVars(false),
+  EscapeOldStyle(true)
 {
   this->EscapeOldStyle = true;
   this->EscapeAllowMakeVars = false;
@@ -85,7 +90,8 @@
 //----------------------------------------------------------------------------
 const char* cmCustomCommand::GetComment() const
 {
-  return this->Comment.c_str();
+  const char* no_comment = 0;
+  return this->HaveComment? this->Comment.c_str() : no_comment;
 }
 
 //----------------------------------------------------------------------------

Index: cmGlobalVisualStudio71Generator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio71Generator.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- cmGlobalVisualStudio71Generator.h	11 May 2006 15:47:02 -0000	1.14
+++ cmGlobalVisualStudio71Generator.h	28 Sep 2006 20:40:35 -0000	1.15
@@ -53,9 +53,9 @@
                             const char* name, const char* path, cmTarget &t);
   virtual void WriteProjectDepends(std::ostream& fout, 
                            const char* name, const char* path, cmTarget &t);
-  virtual void WriteProjectConfigurations(std::ostream& fout, 
+  virtual void WriteProjectConfigurations(std::ostream& fout,
                                           const char* name,
-                                          bool in_all);
+                                          int targetType);
   virtual void WriteExternalProject(std::ostream& fout, const char* name,
                                     const char* path,
                                     const std::vector<std::string>& depends);

Index: cmMakefileLibraryTargetGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileLibraryTargetGenerator.cxx,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- cmMakefileLibraryTargetGenerator.cxx	15 Aug 2006 19:28:29 -0000	1.24
+++ cmMakefileLibraryTargetGenerator.cxx	28 Sep 2006 20:40:35 -0000	1.25
@@ -27,6 +27,12 @@
 #include <memory> // auto_ptr
 
 //----------------------------------------------------------------------------
+cmMakefileLibraryTargetGenerator::cmMakefileLibraryTargetGenerator()
+{
+  this->DriveCustomCommandsOnDepends = true;
+}
+
+//----------------------------------------------------------------------------
 void cmMakefileLibraryTargetGenerator::WriteRuleFiles()
 {
   // create the build.make file and directory, put in the common blocks

Index: cmMakefileTargetGenerator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileTargetGenerator.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- cmMakefileTargetGenerator.h	12 Jul 2006 18:15:06 -0000	1.10
+++ cmMakefileTargetGenerator.h	28 Sep 2006 20:40:35 -0000	1.11
@@ -107,6 +107,8 @@
   // write the driver rule to build target outputs
   void WriteTargetDriverRule(const char* main_output, bool relink);
 
+  void DriveCustomCommands(std::vector<std::string>& depends);
+
   // Return the a string with -F flags on apple
   std::string GetFrameworkFlags();
 
@@ -122,6 +124,8 @@
   cmGlobalGenerator *GlobalGenerator;
   cmMakefile *Makefile;
 
+  bool DriveCustomCommandsOnDepends;
+
   // the full path to the build file
   std::string BuildFileName;
   std::string BuildFileNameFull;

Index: cmMakefileExecutableTargetGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileExecutableTargetGenerator.cxx,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- cmMakefileExecutableTargetGenerator.cxx	15 Aug 2006 19:28:29 -0000	1.20
+++ cmMakefileExecutableTargetGenerator.cxx	28 Sep 2006 20:40:35 -0000	1.21
@@ -25,6 +25,12 @@
 #include "cmake.h"
 
 //----------------------------------------------------------------------------
+cmMakefileExecutableTargetGenerator::cmMakefileExecutableTargetGenerator()
+{
+  this->DriveCustomCommandsOnDepends = true;
+}
+
+//----------------------------------------------------------------------------
 void cmMakefileExecutableTargetGenerator::WriteRuleFiles()
 {
   // create the build.make file and directory, put in the common blocks

Index: cmMakefileTargetGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileTargetGenerator.cxx,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- cmMakefileTargetGenerator.cxx	12 Sep 2006 14:21:47 -0000	1.44
+++ cmMakefileTargetGenerator.cxx	28 Sep 2006 20:40:35 -0000	1.45
@@ -35,6 +35,7 @@
   this->BuildFileStream = 0;
   this->InfoFileStream = 0;
   this->FlagFileStream = 0;
+  this->DriveCustomCommandsOnDepends = false;
 }
 
 cmMakefileTargetGenerator *
@@ -775,6 +776,23 @@
   commands.push_back(depCmd.str());
 
   // Make sure all custom command outputs in this target are built.
+  if(this->DriveCustomCommandsOnDepends)
+    {
+    this->DriveCustomCommands(depends);
+    }
+
+  // Write the rule.
+  this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
+                                      depMark.c_str(),
+                                      depends, commands, false);
+}
+
+//----------------------------------------------------------------------------
+void
+cmMakefileTargetGenerator
+::DriveCustomCommands(std::vector<std::string>& depends)
+{
+  // Depend on all custom command outputs.
   const std::vector<cmSourceFile*>& sources =
     this->Target->GetSourceFiles();
   for(std::vector<cmSourceFile*>::const_iterator source = sources.begin();
@@ -790,11 +808,6 @@
         }
       }
     }
-
-  // Write the rule.
-  this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
-                                      depMark.c_str(),
-                                      depends, commands, false);
 }
 
 //----------------------------------------------------------------------------
@@ -1040,6 +1053,12 @@
     {
     // Setup the comment for the main build driver.
     comment = "Rule to build all files generated by this target.";
+
+    // Make sure all custom command outputs in this target are built.
+    if(!this->DriveCustomCommandsOnDepends)
+      {
+      this->DriveCustomCommands(depends);
+      }
     }
 
   // Write the driver rule.

Index: cmGlobalVisualStudio7Generator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio7Generator.h,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- cmGlobalVisualStudio7Generator.h	1 Jun 2006 19:51:24 -0000	1.37
+++ cmGlobalVisualStudio7Generator.h	28 Sep 2006 20:40:35 -0000	1.38
@@ -105,9 +105,9 @@
                             const char* name, const char* path, cmTarget &t);
   virtual void WriteProjectDepends(std::ostream& fout, 
                            const char* name, const char* path, cmTarget &t);
-  virtual void WriteProjectConfigurations(std::ostream& fout, 
+  virtual void WriteProjectConfigurations(std::ostream& fout,
                                           const char* name,
-                                          bool in_all);
+                                          int targetType);
   virtual void WriteSLNFooter(std::ostream& fout);
   virtual void WriteSLNHeader(std::ostream& fout);
   virtual void AddPlatformDefinitions(cmMakefile* mf);

Index: cmCustomCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCustomCommand.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- cmCustomCommand.h	27 Sep 2006 17:43:45 -0000	1.18
+++ cmCustomCommand.h	28 Sep 2006 20:40:35 -0000	1.19
@@ -70,6 +70,7 @@
   std::vector<std::string> Outputs;
   std::vector<std::string> Depends;
   cmCustomCommandLines CommandLines;
+  bool HaveComment;
   std::string Comment;
   std::string WorkingDirectory;
   bool EscapeAllowMakeVars;

Index: cmAddCustomCommandCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmAddCustomCommandCommand.cxx,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- cmAddCustomCommandCommand.cxx	28 Sep 2006 15:30:46 -0000	1.32
+++ cmAddCustomCommandCommand.cxx	28 Sep 2006 20:40:34 -0000	1.33
@@ -32,8 +32,9 @@
       return false;
     }
 
-  std::string source, target, comment, main_dependency,
-    working;
+  std::string source, target, main_dependency, working;
+  std::string comment_buffer;
+  const char* comment = 0;
   std::vector<std::string> depends, outputs, output;
   bool verbatim = false;
 
@@ -178,7 +179,8 @@
            outputs.push_back(filename);
            break;
          case doing_comment:
-           comment = copy;
+           comment_buffer = copy;
+           comment = comment_buffer.c_str();
            break;
          default:
            this->SetError("Wrong syntax. Unknown type of argument.");
@@ -223,7 +225,7 @@
     std::vector<std::string> no_depends;
     this->Makefile->AddCustomCommandToTarget(target.c_str(), no_depends,
                                              commandLines, cctype,
-                                             comment.c_str(), working.c_str(),
+                                             comment, working.c_str(),
                                              escapeOldStyle);
     }
   else if(target.empty())
@@ -231,7 +233,7 @@
     // Target is empty, use the output.
     this->Makefile->AddCustomCommandToOutput(output, depends,
                                              main_dependency.c_str(),
-                                             commandLines, comment.c_str(),
+                                             commandLines, comment,
                                              working.c_str(), false,
                                              escapeOldStyle);
     }
@@ -240,7 +242,7 @@
     // Use the old-style mode for backward compatibility.
     this->Makefile->AddCustomCommandOldStyle(target.c_str(), outputs, depends,
                                              source.c_str(), commandLines,
-                                             comment.c_str());
+                                             comment);
     }
   return true;
 }

Index: cmMakefileLibraryTargetGenerator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileLibraryTargetGenerator.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- cmMakefileLibraryTargetGenerator.h	16 Feb 2006 20:19:00 -0000	1.2
+++ cmMakefileLibraryTargetGenerator.h	28 Sep 2006 20:40:35 -0000	1.3
@@ -23,6 +23,8 @@
   public cmMakefileTargetGenerator
 {
 public:
+  cmMakefileLibraryTargetGenerator();
+
   /* the main entry point for this class. Writes the Makefiles associated
      with this target */
   virtual void WriteRuleFiles();  

Index: cmGlobalVisualStudio7Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio7Generator.cxx,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -d -r1.75 -r1.76
--- cmGlobalVisualStudio7Generator.cxx	28 Sep 2006 17:55:25 -0000	1.75
+++ cmGlobalVisualStudio7Generator.cxx	28 Sep 2006 20:40:35 -0000	1.76
@@ -536,14 +536,14 @@
         cmCustomCommand cc = l->second.GetPostBuildCommands()[0];
         const cmCustomCommandLines& cmds = cc.GetCommandLines();
         std::string name = cmds[0][0];
-        this->WriteProjectConfigurations(fout, name.c_str(), 
-                                         l->second.IsInAll());
+        this->WriteProjectConfigurations(fout, name.c_str(),
+                                         l->second.GetType());
         }
       else if ((l->second.GetType() != cmTarget::INSTALL_FILES)
           && (l->second.GetType() != cmTarget::INSTALL_PROGRAMS))
         {
-        this->WriteProjectConfigurations(fout, si->c_str(), 
-                                         l->second.IsInAll());
+        this->WriteProjectConfigurations(fout, si->c_str(),
+                                         l->second.GetType());
         ++si;
         }
       }
@@ -651,19 +651,18 @@
 // Write a dsp file into the SLN file, Note, that dependencies from
 // executables to the libraries it uses are also done here
 void cmGlobalVisualStudio7Generator
-::WriteProjectConfigurations(std::ostream& fout, 
-                             const char* name, 
-                             bool in_all_build)
+::WriteProjectConfigurations(std::ostream& fout, const char* name,
+                             int targetType)
 {
   std::string guid = this->GetGUID(name);
   for(std::vector<std::string>::iterator i = this->Configurations.begin();
       i != this->Configurations.end(); ++i)
     {
-    fout << "\t\t{" << guid << "}." << *i 
+    fout << "\t\t{" << guid << "}." << *i
          << ".ActiveCfg = " << *i << "|Win32\n";
-    if (in_all_build)
+    if(targetType != cmTarget::GLOBAL_TARGET)
       {
-      fout << "\t\t{" << guid << "}." << *i 
+      fout << "\t\t{" << guid << "}." << *i
            << ".Build.0 = " << *i << "|Win32\n";
       }
     }

Index: cmMakefile.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefile.cxx,v
retrieving revision 1.354
retrieving revision 1.355
diff -u -d -r1.354 -r1.355
--- cmMakefile.cxx	28 Sep 2006 17:55:25 -0000	1.354
+++ cmMakefile.cxx	28 Sep 2006 20:40:35 -0000	1.355
@@ -830,11 +830,21 @@
   target.SetType(cmTarget::UTILITY, utilityName);
   target.SetInAll(all);
   target.SetMakefile(this);
+
   // Store the custom command in the target.
-  std::vector<std::string> outputs;
-  cmCustomCommand cc(outputs, depends, commandLines, 0, workingDirectory);
-  cc.SetEscapeOldStyle(escapeOldStyle);
-  target.GetPostBuildCommands().push_back(cc);
+  std::string force = this->GetStartOutputDirectory();
+  force += cmake::GetCMakeFilesDirectory();
+  force += "/";
+  force += utilityName;
+  const char* no_main_dependency = 0;
+  const char* empty_comment = "";
+  bool no_replace = false;
+  this->AddCustomCommandToOutput(force.c_str(), depends,
+                                 no_main_dependency,
+                                 commandLines, empty_comment,
+                                 workingDirectory, no_replace,
+                                 escapeOldStyle);
+  target.GetSourceLists().push_back(force);
 
   // Add the target to the set of targets.
   cmTargets::iterator it = 



More information about the Cmake-commits mailing list