[Cmake-commits] CMake branch, next, updated. v2.8.7-3363-g355921c

Brad King brad.king at kitware.com
Wed Mar 28 14:48:11 EDT 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  355921cca96e4fa958dbbc4a8101233fcc4a69de (commit)
       via  01e979acef392776bd1ea1fb38126957746954e7 (commit)
      from  e01f05f54f9fe927c22f8d880c31571b523bc02e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=355921cca96e4fa958dbbc4a8101233fcc4a69de
commit 355921cca96e4fa958dbbc4a8101233fcc4a69de
Merge: e01f05f 01e979a
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Mar 28 14:48:09 2012 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Mar 28 14:48:09 2012 -0400

    Merge topic 'fix-source-classification' into next
    
    01e979a VS: Add CMakeLists.txt re-run rules at start of generation


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=01e979acef392776bd1ea1fb38126957746954e7
commit 01e979acef392776bd1ea1fb38126957746954e7
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Mar 28 13:49:01 2012 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Mar 28 14:07:51 2012 -0400

    VS: Add CMakeLists.txt re-run rules at start of generation
    
    Since commit 328c0f65 (Simplify cmVisualStudio10TargetGenerator source
    classification, 2012-03-19) the VS 10 generator uses the
    cmGeneratorTarget source classification instead of directly getting the
    list of source files from the target.  This accidentally dropped the
    CMakeLists.txt files from generated projects because they are added too
    late for cmGeneratorTarget.
    
    All generator-specific source files must be added to targets prior to
    cmGeneratorTarget construction.  Refactor addition of the CMakeLists.txt
    files with CMake re-run custom commands to take place before normal
    generation begins, and therefore early enough to be included in the
    cmGeneratorTarget classification.

diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index 7da4f86..2a918c9 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -95,6 +95,16 @@ void cmGlobalVisualStudioGenerator::Generate()
   // of Visual Studio.
   this->ConfigureCMakeVisualStudioMacros();
 
+  // Add CMakeLists.txt with custom command to rerun CMake.
+  for(std::vector<cmLocalGenerator*>::const_iterator
+        lgi = this->LocalGenerators.begin();
+      lgi != this->LocalGenerators.end(); ++lgi)
+    {
+    cmLocalVisualStudioGenerator* lg =
+      static_cast<cmLocalVisualStudioGenerator*>(*lgi);
+    lg->AddCMakeListsRules();
+    }
+
   // Run all the local generators.
   this->cmGlobalGenerator::Generate();
 }
diff --git a/Source/cmLocalVisualStudio10Generator.cxx b/Source/cmLocalVisualStudio10Generator.cxx
index 8b22705..bf0e997 100644
--- a/Source/cmLocalVisualStudio10Generator.cxx
+++ b/Source/cmLocalVisualStudio10Generator.cxx
@@ -74,24 +74,6 @@ void cmLocalVisualStudio10Generator::Generate()
 {
   
   cmTargets &tgts = this->Makefile->GetTargets();
-  // Create the regeneration custom rule.
-  if(!this->Makefile->IsOn("CMAKE_SUPPRESS_REGENERATION"))
-    {
-    // Create a rule to regenerate the build system when the target
-    // specification source changes.
-    if(cmSourceFile* sf = this->CreateVCProjBuildRule())
-      {
-      // Add the rule to targets that need it.
-      for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); ++l)
-        {
-        if(l->first != CMAKE_CHECK_BUILD_SYSTEM_TARGET)
-          {
-          l->second.AddSourceFile(sf);
-          }
-        }
-      }
-    }
-
   for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); ++l)
     {
     if(static_cast<cmGlobalVisualStudioGenerator*>(this->GlobalGenerator)
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index 5b99dfd..99a4c95 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -85,6 +85,23 @@ void cmLocalVisualStudio6Generator::AddHelperCommands()
   this->CreateCustomTargetsAndCommands(lang);
 }
 
+void cmLocalVisualStudio6Generator::AddCMakeListsRules()
+{
+  cmTargets &tgts = this->Makefile->GetTargets();
+  for(cmTargets::iterator l = tgts.begin();
+      l != tgts.end(); l++)
+    {
+    // Add a rule to regenerate the build system when the target
+    // specification source changes.
+    const char* suppRegenRule =
+      this->Makefile->GetDefinition("CMAKE_SUPPRESS_REGENERATION");
+    if (!cmSystemTools::IsOn(suppRegenRule))
+      {
+      this->AddDSPBuildRule(l->second);
+      }
+    }
+}
+
 void cmLocalVisualStudio6Generator::Generate()
 {
   this->OutputDSPFile();
@@ -107,18 +124,6 @@ void cmLocalVisualStudio6Generator::OutputDSPFile()
   // Create the DSP or set of DSP's for libraries and executables
 
   cmTargets &tgts = this->Makefile->GetTargets();
-  for(cmTargets::iterator l = tgts.begin(); 
-      l != tgts.end(); l++)
-    {
-    // Add a rule to regenerate the build system when the target
-    // specification source changes.
-    const char* suppRegenRule =
-      this->Makefile->GetDefinition("CMAKE_SUPPRESS_REGENERATION");
-    if (!cmSystemTools::IsOn(suppRegenRule))
-      {
-      this->AddDSPBuildRule(l->second);
-      }
-    }
 
   // build any targets
   for(cmTargets::iterator l = tgts.begin(); 
diff --git a/Source/cmLocalVisualStudio6Generator.h b/Source/cmLocalVisualStudio6Generator.h
index a680633..1decc35 100644
--- a/Source/cmLocalVisualStudio6Generator.h
+++ b/Source/cmLocalVisualStudio6Generator.h
@@ -34,6 +34,7 @@ public:
   virtual ~cmLocalVisualStudio6Generator();
 
   virtual void AddHelperCommands();
+  virtual void AddCMakeListsRules();
 
   /**
    * Generate the makefile for this directory. 
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 363d370..9faf46d 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -100,6 +100,28 @@ void cmLocalVisualStudio7Generator::Generate()
   this->WriteStampFiles();
 }
 
+void cmLocalVisualStudio7Generator::AddCMakeListsRules()
+{
+  cmTargets &tgts = this->Makefile->GetTargets();
+  // Create the regeneration custom rule.
+  if(!this->Makefile->IsOn("CMAKE_SUPPRESS_REGENERATION"))
+    {
+    // Create a rule to regenerate the build system when the target
+    // specification source changes.
+    if(cmSourceFile* sf = this->CreateVCProjBuildRule())
+      {
+      // Add the rule to targets that need it.
+      for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); ++l)
+        {
+        if(l->first != CMAKE_CHECK_BUILD_SYSTEM_TARGET)
+          {
+          l->second.AddSourceFile(sf);
+          }
+        }
+      }
+    }
+}
+
 void cmLocalVisualStudio7Generator::FixGlobalTargets()
 {
   // Visual Studio .NET 2003 Service Pack 1 will not run post-build
@@ -156,24 +178,6 @@ void cmLocalVisualStudio7Generator::WriteProjectFiles()
   // Get the set of targets in this directory.
   cmTargets &tgts = this->Makefile->GetTargets();
 
-  // Create the regeneration custom rule.
-  if(!this->Makefile->IsOn("CMAKE_SUPPRESS_REGENERATION"))
-    {
-    // Create a rule to regenerate the build system when the target
-    // specification source changes.
-    if(cmSourceFile* sf = this->CreateVCProjBuildRule())
-      {
-      // Add the rule to targets that need it.
-      for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); ++l)
-        {
-        if(l->first != CMAKE_CHECK_BUILD_SYSTEM_TARGET)
-          {
-          l->second.AddSourceFile(sf);
-          }
-        }
-      }
-    }
-
   // Create the project file for each target.
   for(cmTargets::iterator l = tgts.begin();
       l != tgts.end(); l++)
diff --git a/Source/cmLocalVisualStudio7Generator.h b/Source/cmLocalVisualStudio7Generator.h
index 9d3a9f2..9aa408e 100644
--- a/Source/cmLocalVisualStudio7Generator.h
+++ b/Source/cmLocalVisualStudio7Generator.h
@@ -64,6 +64,7 @@ public:
 
   virtual void ReadAndStoreExternalGUID(const char* name,
                                         const char* path);
+  virtual void AddCMakeListsRules();
 protected:
   void CreateSingleVCProj(const char *lname, cmTarget &tgt);
 private:
diff --git a/Source/cmLocalVisualStudioGenerator.h b/Source/cmLocalVisualStudioGenerator.h
index 410cc9a..9968592 100644
--- a/Source/cmLocalVisualStudioGenerator.h
+++ b/Source/cmLocalVisualStudioGenerator.h
@@ -58,6 +58,8 @@ public:
 
   virtual std::string ComputeLongestObjectDirectory(cmTarget&) const = 0;
 
+  virtual void AddCMakeListsRules() = 0;
+
 protected:
   virtual const char* ReportErrorLabel() const;
   virtual bool CustomCommandUseLocal() const { return false; }

-----------------------------------------------------------------------

Summary of changes:
 Source/cmGlobalVisualStudioGenerator.cxx  |   10 +++++++
 Source/cmLocalVisualStudio10Generator.cxx |   18 -------------
 Source/cmLocalVisualStudio6Generator.cxx  |   29 ++++++++++++--------
 Source/cmLocalVisualStudio6Generator.h    |    1 +
 Source/cmLocalVisualStudio7Generator.cxx  |   40 ++++++++++++++++-------------
 Source/cmLocalVisualStudio7Generator.h    |    1 +
 Source/cmLocalVisualStudioGenerator.h     |    2 +
 7 files changed, 53 insertions(+), 48 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list