[cmake-commits] king committed cmGlobalVisualStudio6Generator.cxx 1.66 1.67 cmGlobalVisualStudio7Generator.cxx 1.84 1.85 cmGlobalVisualStudioGenerator.cxx 1.2 1.3 cmGlobalVisualStudioGenerator.h 1.2 1.3

cmake-commits at cmake.org cmake-commits at cmake.org
Tue Apr 10 13:09:05 EDT 2007


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

Modified Files:
	cmGlobalVisualStudio6Generator.cxx 
	cmGlobalVisualStudio7Generator.cxx 
	cmGlobalVisualStudioGenerator.cxx 
	cmGlobalVisualStudioGenerator.h 
Log Message:
BUG: The ALL_BUILD target should not have any command lines so that it is not always considered out of date.  Moved the 'Build all projects' message into the description field instead of an echo in the command field.  Moved common implementation of Generate for VS6 and VS7 into the superclass to avoid duplicate code for the ALL_BUILD target.  This addresses bug#4556.


Index: cmGlobalVisualStudio6Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio6Generator.cxx,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- cmGlobalVisualStudio6Generator.cxx	4 Apr 2007 18:49:35 -0000	1.66
+++ cmGlobalVisualStudio6Generator.cxx	10 Apr 2007 17:09:03 -0000	1.67
@@ -160,30 +160,9 @@
 
 void cmGlobalVisualStudio6Generator::Generate()
 {
-  // add a special target that depends on ALL projects for easy build
-  // of one configuration only.
-  std::vector<std::string> no_depends;
-  const char* no_working_dir = 0;
-  std::map<cmStdString, std::vector<cmLocalGenerator*> >::iterator it;
-  for(it = this->ProjectMap.begin(); it!= this->ProjectMap.end(); ++it)
-    {
-    std::vector<cmLocalGenerator*>& gen = it->second;
-    // add the ALL_BUILD to the first local generator of each project
-    if(gen.size())
-      {
-      gen[0]->GetMakefile()->AddUtilityCommand("ALL_BUILD", true, 
-                                               no_depends, 
-                                               no_working_dir,
-                                               "echo", "Build all projects");
-      }
-    }
-
-  // Fix utility dependencies to avoid linking to libraries.
-  this->FixUtilityDepends();
-
   // first do the superclass method
-  this->cmGlobalGenerator::Generate();
-  
+  this->cmGlobalVisualStudioGenerator::Generate();
+
   // Now write out the DSW
   this->OutputDSWFile();
 }

Index: cmGlobalVisualStudioGenerator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudioGenerator.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- cmGlobalVisualStudioGenerator.h	4 Apr 2007 18:49:35 -0000	1.2
+++ cmGlobalVisualStudioGenerator.h	10 Apr 2007 17:09:03 -0000	1.3
@@ -31,6 +31,11 @@
   cmGlobalVisualStudioGenerator();
   virtual ~cmGlobalVisualStudioGenerator();
 
+  /**
+   * Basic generate implementation for all VS generators.
+   */
+  virtual void Generate();
+
 protected:
   virtual void CreateGUID(const char*) {}
   virtual void FixUtilityDepends();

Index: cmGlobalVisualStudio7Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio7Generator.cxx,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -d -r1.84 -r1.85
--- cmGlobalVisualStudio7Generator.cxx	10 Apr 2007 13:54:01 -0000	1.84
+++ cmGlobalVisualStudio7Generator.cxx	10 Apr 2007 17:09:03 -0000	1.85
@@ -214,33 +214,9 @@
 
 void cmGlobalVisualStudio7Generator::Generate()
 {
-  // add a special target that depends on ALL projects for easy build
-  // of one configuration only.
-  const char* no_working_dir = 0;
-  std::vector<std::string> no_depends;
-  std::map<cmStdString, std::vector<cmLocalGenerator*> >::iterator it;
-  for(it = this->ProjectMap.begin(); it!= this->ProjectMap.end(); ++it)
-    {
-    std::vector<cmLocalGenerator*>& gen = it->second;
-    // add the ALL_BUILD to the first local generator of each project
-    if(gen.size())
-      {
-      gen[0]->GetMakefile()->
-        AddUtilityCommand("ALL_BUILD", true, no_depends,
-                          no_working_dir,
-                          "echo", "Build all projects");
-      std::string cmake_command = 
-        this->LocalGenerators[0]->GetMakefile()->
-        GetRequiredDefinition("CMAKE_COMMAND");
-      }
-    }
-
-  // Fix utility dependencies to avoid linking to libraries.
-  this->FixUtilityDepends();
-
   // first do the superclass method
-  this->cmGlobalGenerator::Generate();
-  
+  this->cmGlobalVisualStudioGenerator::Generate();
+
   // Now write out the DSW
   this->OutputSLNFile();
 }

Index: cmGlobalVisualStudioGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudioGenerator.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- cmGlobalVisualStudioGenerator.cxx	4 Apr 2007 18:49:35 -0000	1.2
+++ cmGlobalVisualStudioGenerator.cxx	10 Apr 2007 17:09:03 -0000	1.3
@@ -31,6 +31,37 @@
 }
 
 //----------------------------------------------------------------------------
+void cmGlobalVisualStudioGenerator::Generate()
+{
+  // Add a special target that depends on ALL projects for easy build
+  // of one configuration only.
+  const char* no_working_dir = 0;
+  std::vector<std::string> no_depends;
+  cmCustomCommandLines no_commands;
+  std::map<cmStdString, std::vector<cmLocalGenerator*> >::iterator it;
+  for(it = this->ProjectMap.begin(); it!= this->ProjectMap.end(); ++it)
+    {
+    std::vector<cmLocalGenerator*>& gen = it->second;
+    // add the ALL_BUILD to the first local generator of each project
+    if(gen.size())
+      {
+      // Use no actual command lines so that the target itself is not
+      // considered always out of date.
+      gen[0]->GetMakefile()->
+        AddUtilityCommand("ALL_BUILD", true, no_working_dir,
+                          no_depends, no_commands, false,
+                          "Build all projects");
+      }
+    }
+
+  // Fix utility dependencies to avoid linking to libraries.
+  this->FixUtilityDepends();
+
+  // Run all the local generators.
+  this->cmGlobalGenerator::Generate();
+}
+
+//----------------------------------------------------------------------------
 void cmGlobalVisualStudioGenerator::FixUtilityDepends()
 {
   // For VS versions before 8:



More information about the Cmake-commits mailing list