[Cmake-commits] CMake branch, next, updated. v3.0.0-rc1-954-g672709e

Stephen Kelly steveire at gmail.com
Thu Mar 13 07:53:54 EDT 2014


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  672709e6052f051cd677f7c5c527b41d5bdb618d (commit)
       via  2cdd3056471daba9ca39caebeae167f644ba9e2c (commit)
       via  ea62e7fbb9b3e4c78cedf7b73021ab48e832bd96 (commit)
       via  bd4a5b135c80b4f3759fb21b162c458f4318f34c (commit)
      from  9df32c36872af6daeb361c2975dc6a520da04be2 (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=672709e6052f051cd677f7c5c527b41d5bdb618d
commit 672709e6052f051cd677f7c5c527b41d5bdb618d
Merge: 9df32c3 2cdd305
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Mar 13 07:53:52 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Mar 13 07:53:52 2014 -0400

    Merge topic 'target-objects-refactor' into next
    
    2cdd3056 cmGeneratorTarget: Compute target objects on demand
    ea62e7fb cmLocalGenerator: Add ComputeObjectFilenames method.
    bd4a5b13 cmGeneratorTarget: Constify cmSourceFile* in containers.

diff --cc Source/cmLocalUnixMakefileGenerator3.h
index 14543fb,8d1acb0..465e94d
--- a/Source/cmLocalUnixMakefileGenerator3.h
+++ b/Source/cmLocalUnixMakefileGenerator3.h
@@@ -310,13 -309,13 +310,17 @@@ protected
  
  private:
    std::string ConvertShellCommand(std::string const& cmd, RelativeRoot root);
 -  std::string MakeLauncher(const cmCustomCommand& cc, cmTarget* target,
 -                           RelativeRoot relative);
 +  std::string MakeLauncher(cmCustomCommandGenerator const& ccg,
 +                           cmTarget* target, RelativeRoot relative);
 +
 +  virtual void ComputeObjectFilenames(
 +                        std::map<cmSourceFile const*, std::string>& mapping,
 +                        cmGeneratorTarget const* gt = 0);
  
+   virtual void ComputeObjectFilenames(
+                         std::map<cmSourceFile const*, std::string>& mapping,
+                         cmGeneratorTarget const* gt = 0);
+ 
    friend class cmMakefileTargetGenerator;
    friend class cmMakefileExecutableTargetGenerator;
    friend class cmMakefileLibraryTargetGenerator;

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2cdd3056471daba9ca39caebeae167f644ba9e2c
commit 2cdd3056471daba9ca39caebeae167f644ba9e2c
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Mar 11 20:39:01 2014 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Mar 13 12:52:56 2014 +0100

    cmGeneratorTarget: Compute target objects on demand
    
    Add a ComputeTargetObjects method to compute the object
    names.  It takes a non-const reference to a mapping so
    that it can be extended in the future with parameters
    relevant to generator expression evaluation.
    
    Remove the old method from the generators which are now all
    functionally identical.
    
    Remove the supporting cmGeneratorTarget::AddObject method. It is
    no longer needed as the container member is populated directly.
    
    In a follow-up, the UseObjectLibraries usage may be replaced by a
    true generator expression evaluator for TARGET_OBJECTS. That
    will require generators to use cmGeneratorTarget::GetExternalObjects
    which is not currently the case for Xcode and VS generators.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 8efd7bb..63e479b 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -310,24 +310,15 @@ cmGeneratorTarget
 ::GetObjectSources(std::vector<cmSourceFile const*> &data) const
 {
   IMPLEMENT_VISIT(ObjectSources);
-  if (this->Target->GetType() == cmTarget::OBJECT_LIBRARY)
-    {
-    this->ObjectSources = data;
-    }
 }
 
 //----------------------------------------------------------------------------
 const std::string& cmGeneratorTarget::GetObjectName(cmSourceFile const* file)
 {
+  this->ComputeTargetObjects(this->Objects);
   return this->Objects[file];
 }
 
-void cmGeneratorTarget::AddObject(cmSourceFile const* sf,
-                                  std::string const&name)
-{
-    this->Objects[sf] = name;
-}
-
 //----------------------------------------------------------------------------
 void cmGeneratorTarget::AddExplicitObjectName(cmSourceFile const* sf)
 {
@@ -577,18 +568,45 @@ cmGeneratorTarget::UseObjectLibraries(std::vector<std::string>& objs) const
     cmTarget* objLib = *ti;
     cmGeneratorTarget* ogt =
       this->GlobalGenerator->GetGeneratorTarget(objLib);
-    for(std::vector<cmSourceFile const*>::const_iterator
-          si = ogt->ObjectSources.begin();
-        si != ogt->ObjectSources.end(); ++si)
+
+    ogt->ComputeTargetObjects(ogt->Objects);
+
+    for(std::map<cmSourceFile const*, std::string>::const_iterator
+        objIt = ogt->Objects.begin();
+        objIt != ogt->Objects.end(); ++objIt)
       {
+      assert(!objIt->second.empty());
       std::string obj = ogt->ObjectDirectory;
-      obj += ogt->Objects[*si];
+      obj += objIt->second;
       objs.push_back(obj);
       }
     }
 }
 
 //----------------------------------------------------------------------------
+void cmGeneratorTarget::ComputeTargetObjects(
+                    std::map<cmSourceFile const*, std::string>& objects) const
+{
+  if(!objects.empty())
+    {
+    return;
+    }
+  this->LocalGenerator->GetGlobalGenerator()
+      ->ComputeTargetObjectDirectory(const_cast<cmGeneratorTarget*>(this));
+  std::vector<cmSourceFile const*> objectSources;
+  this->GetObjectSources(objectSources);
+
+  for(std::vector<cmSourceFile const*>::const_iterator it
+      = objectSources.begin(); it != objectSources.end(); ++it)
+    {
+    objects[*it];
+    }
+
+  this->LocalGenerator->ComputeObjectFilenames(objects, this);
+  assert(objects.size() == objectSources.size());
+}
+
+//----------------------------------------------------------------------------
 class cmTargetTraceDependencies
 {
 public:
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 139e736..3eca156 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -125,9 +125,8 @@ private:
   typedef std::map<cmSourceFile const*, SourceEntry> SourceEntriesType;
   SourceEntriesType SourceEntries;
 
-  std::map<cmSourceFile const*, std::string> Objects;
+  mutable std::map<cmSourceFile const*, std::string> Objects;
   std::set<cmSourceFile const*> ExplicitObjectName;
-  mutable std::vector<cmSourceFile const*> ObjectSources;
   std::vector<cmTarget*> ObjectLibraries;
   mutable std::map<std::string, std::vector<std::string> > SystemIncludesCache;
 
@@ -135,6 +134,9 @@ private:
   mutable bool SourceFileFlagsConstructed;
   mutable std::map<cmSourceFile const*, SourceFileFlags> SourceFlagsMap;
 
+  void ComputeTargetObjects(
+                  std::map<cmSourceFile const*, std::string>& objects) const;
+
   cmGeneratorTarget(cmGeneratorTarget const&);
   void operator=(cmGeneratorTarget const&);
 };
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index c9ae799..4945e89 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1449,9 +1449,7 @@ void cmGlobalGenerator::ComputeGeneratorTargetObjects()
         continue;
         }
       cmGeneratorTarget* gt = ti->second;
-      this->ComputeTargetObjectDirectory(gt);
       gt->LookupObjectLibraries();
-      this->ComputeTargetObjects(gt);
       }
     }
 }
@@ -1516,12 +1514,6 @@ cmGlobalGenerator::GetGeneratorTarget(cmTarget const* t) const
 }
 
 //----------------------------------------------------------------------------
-void cmGlobalGenerator::ComputeTargetObjects(cmGeneratorTarget*) const
-{
-  // Implemented in generator subclasses that need this.
-}
-
-//----------------------------------------------------------------------------
 void cmGlobalGenerator::ComputeTargetObjectDirectory(cmGeneratorTarget*) const
 {
 }
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index ed07b10..5366733 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -443,7 +443,6 @@ private:
   void CreateGeneratorTargets(cmMakefile* mf);
   void CreateGeneratorTargets();
   void ComputeGeneratorTargetObjects();
-  virtual void ComputeTargetObjects(cmGeneratorTarget* gt) const;
 
   void ClearGeneratorMembers();
 
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 08507eb..49ce1b5 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -632,29 +632,6 @@ std::string cmGlobalNinjaGenerator::GetEditCacheCommand() const
   return cmSystemTools::GetCMakeGUICommand();
 }
 
-// TODO: Refactor to combine with cmGlobalUnixMakefileGenerator3 impl.
-void cmGlobalNinjaGenerator::ComputeTargetObjects(cmGeneratorTarget* gt) const
-{
-  std::vector<cmSourceFile const*> objectSources;
-  gt->GetObjectSources(objectSources);
-
-  std::map<cmSourceFile const*, std::string> mapping;
-  for(std::vector<cmSourceFile const*>::const_iterator it
-      = objectSources.begin(); it != objectSources.end(); ++it)
-    {
-    mapping[*it];
-    }
-
-  gt->LocalGenerator->ComputeObjectFilenames(mapping, gt);
-
-  for(std::map<cmSourceFile const*, std::string>::const_iterator it
-      = mapping.begin(); it != mapping.end(); ++it)
-    {
-    assert(!it->second.empty());
-    gt->AddObject(it->first, it->second);
-    }
-}
-
 //----------------------------------------------------------------------------
 void cmGlobalNinjaGenerator
 ::ComputeTargetObjectDirectory(cmGeneratorTarget* gt) const
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index e3a22e5..f2643af 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -310,8 +310,6 @@ protected:
 private:
   virtual std::string GetEditCacheCommand() const;
 
-  /// @see cmGlobalGenerator::ComputeTargetObjects
-  virtual void ComputeTargetObjects(cmGeneratorTarget* gt) const;
 
   void OpenBuildFileStream();
   void CloseBuildFileStream();
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 91258ed0..4632071 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -106,30 +106,6 @@ std::string cmGlobalUnixMakefileGenerator3::GetEditCacheCommand() const
 //----------------------------------------------------------------------------
 void
 cmGlobalUnixMakefileGenerator3
-::ComputeTargetObjects(cmGeneratorTarget* gt) const
-{
-  std::vector<cmSourceFile const*> objectSources;
-  gt->GetObjectSources(objectSources);
-
-  std::map<cmSourceFile const*, std::string> mapping;
-  for(std::vector<cmSourceFile const*>::const_iterator it
-      = objectSources.begin(); it != objectSources.end(); ++it)
-    {
-    mapping[*it];
-    }
-
-  gt->LocalGenerator->ComputeObjectFilenames(mapping, gt);
-
-  for(std::map<cmSourceFile const*, std::string>::const_iterator it
-      = mapping.begin(); it != mapping.end(); ++it)
-    {
-    gt->AddObject(it->first, it->second);
-    }
-}
-
-//----------------------------------------------------------------------------
-void
-cmGlobalUnixMakefileGenerator3
 ::ComputeTargetObjectDirectory(cmGeneratorTarget* gt) const
 {
   cmTarget* target = gt->Target;
diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h
index 42453f2..d003789 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.h
+++ b/Source/cmGlobalUnixMakefileGenerator3.h
@@ -199,7 +199,6 @@ protected:
 private:
   virtual const char* GetBuildIgnoreErrorsFlag() const { return "-i"; }
   virtual std::string GetEditCacheCommand() const;
-  virtual void ComputeTargetObjects(cmGeneratorTarget* gt) const;
 };
 
 #endif
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index a5ce33f..749517c 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -118,30 +118,6 @@ void cmGlobalVisualStudioGenerator::Generate()
 }
 
 //----------------------------------------------------------------------------
-void
-cmGlobalVisualStudioGenerator
-::ComputeTargetObjects(cmGeneratorTarget* gt) const
-{
-  std::vector<cmSourceFile*> objectSources;
-  gt->GetObjectSources(objectSources);
-
-  std::map<cmSourceFile const*, std::string> mapping;
-  for(std::vector<cmSourceFile const*>::const_iterator it
-      = objectSources.begin(); it != objectSources.end(); ++it)
-    {
-    mapping[*it];
-    }
-
-  gt->LocalGenerator->ComputeObjectFilenames(mapping, gt);
-
-  for(std::map<cmSourceFile const*, std::string>::const_iterator it
-      = mapping.begin(); it != mapping.end(); ++it)
-    {
-    gt->AddObject(it->first, it->second);
-    }
-}
-
-//----------------------------------------------------------------------------
 void cmGlobalVisualStudioGenerator
 ::ComputeTargetObjectDirectory(cmGeneratorTarget* gt) const
 {
diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h
index f957056..1ab8990 100644
--- a/Source/cmGlobalVisualStudioGenerator.h
+++ b/Source/cmGlobalVisualStudioGenerator.h
@@ -117,7 +117,6 @@ private:
   virtual std::string GetVSMakeProgram() = 0;
   void PrintCompilerAdvice(std::ostream&, std::string const&,
                            const char*) const {}
-  void ComputeTargetObjects(cmGeneratorTarget* gt) const;
 
   void FollowLinkDepends(cmTarget const* target,
                          std::set<cmTarget const*>& linked);
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 3ab804c..75e9083 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -3947,30 +3947,6 @@ bool cmGlobalXCodeGenerator::IsMultiConfig()
   return true;
 }
 
- //----------------------------------------------------------------------------
-void
-cmGlobalXCodeGenerator
-::ComputeTargetObjects(cmGeneratorTarget* gt) const
-{
-  std::vector<cmSourceFile*> objectSources;
-  gt->GetObjectSources(objectSources);
-
-  std::map<cmSourceFile const*, std::string> mapping;
-  for(std::vector<cmSourceFile const*>::const_iterator it
-      = objectSources.begin(); it != objectSources.end(); ++it)
-    {
-    mapping[*it];
-    }
-
-  gt->LocalGenerator->ComputeObjectFilenames(mapping, gt);
-
-  for(std::map<cmSourceFile const*, std::string>::const_iterator it
-      = mapping.begin(); it != mapping.end(); ++it)
-    {
-    gt->AddObject(it->first, it->second);
-    }
-}
-
 //----------------------------------------------------------------------------
 void cmGlobalXCodeGenerator
 ::ComputeTargetObjectDirectory(cmGeneratorTarget* gt) const
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index 64f40b3..3d2cf8c 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -219,7 +219,6 @@ protected:
 private:
   void PrintCompilerAdvice(std::ostream&, std::string const&,
                            const char*) const {}
-  void ComputeTargetObjects(cmGeneratorTarget* gt) const;
 
   std::string GetObjectsNormalDirectory(
     const std::string &projName,

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ea62e7fbb9b3e4c78cedf7b73021ab48e832bd96
commit ea62e7fbb9b3e4c78cedf7b73021ab48e832bd96
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Mar 11 17:37:26 2014 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Mar 13 12:52:38 2014 +0100

    cmLocalGenerator: Add ComputeObjectFilenames method.

diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index e9c31e9..08507eb 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -19,6 +19,7 @@
 #include "cmVersion.h"
 
 #include <algorithm>
+#include <assert.h>
 
 const char* cmGlobalNinjaGenerator::NINJA_BUILD_FILE = "build.ninja";
 const char* cmGlobalNinjaGenerator::NINJA_RULES_FILE = "rules.ninja";
@@ -636,15 +637,21 @@ void cmGlobalNinjaGenerator::ComputeTargetObjects(cmGeneratorTarget* gt) const
 {
   std::vector<cmSourceFile const*> objectSources;
   gt->GetObjectSources(objectSources);
-  // Compute the name of each object file.
-  for(std::vector<cmSourceFile const*>::iterator
-        si = objectSources.begin();
-      si != objectSources.end(); ++si)
+
+  std::map<cmSourceFile const*, std::string> mapping;
+  for(std::vector<cmSourceFile const*>::const_iterator it
+      = objectSources.begin(); it != objectSources.end(); ++it)
+    {
+    mapping[*it];
+    }
+
+  gt->LocalGenerator->ComputeObjectFilenames(mapping, gt);
+
+  for(std::map<cmSourceFile const*, std::string>::const_iterator it
+      = mapping.begin(); it != mapping.end(); ++it)
     {
-    cmSourceFile const* sf = *si;
-    std::string objectName = gt->LocalGenerator
-      ->GetObjectFileNameWithoutTarget(*sf, gt->ObjectDirectory);
-    gt->AddObject(sf, objectName);
+    assert(!it->second.empty());
+    gt->AddObject(it->first, it->second);
     }
 }
 
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 6ce8678..91258ed0 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -110,15 +110,20 @@ cmGlobalUnixMakefileGenerator3
 {
   std::vector<cmSourceFile const*> objectSources;
   gt->GetObjectSources(objectSources);
-  // Compute the name of each object file.
-  for(std::vector<cmSourceFile const*>::iterator
-        si = objectSources.begin();
-      si != objectSources.end(); ++si)
+
+  std::map<cmSourceFile const*, std::string> mapping;
+  for(std::vector<cmSourceFile const*>::const_iterator it
+      = objectSources.begin(); it != objectSources.end(); ++it)
+    {
+    mapping[*it];
+    }
+
+  gt->LocalGenerator->ComputeObjectFilenames(mapping, gt);
+
+  for(std::map<cmSourceFile const*, std::string>::const_iterator it
+      = mapping.begin(); it != mapping.end(); ++it)
     {
-    cmSourceFile const* sf = *si;
-    std::string objectName = gt->LocalGenerator
-      ->GetObjectFileNameWithoutTarget(*sf, gt->ObjectDirectory);
-    gt->AddObject(sf, objectName);
+    gt->AddObject(it->first, it->second);
     }
 }
 
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index bd57d0c..a5ce33f 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -122,42 +122,22 @@ void
 cmGlobalVisualStudioGenerator
 ::ComputeTargetObjects(cmGeneratorTarget* gt) const
 {
-  cmLocalVisualStudioGenerator* lg =
-    static_cast<cmLocalVisualStudioGenerator*>(gt->LocalGenerator);
-  std::string dir_max = lg->ComputeLongestObjectDirectory(*gt->Target);
-
-  // Count the number of object files with each name.  Note that
-  // windows file names are not case sensitive.
-  std::map<std::string, int> counts;
-  std::vector<cmSourceFile const*> objectSources;
+  std::vector<cmSourceFile*> objectSources;
   gt->GetObjectSources(objectSources);
-  for(std::vector<cmSourceFile const*>::const_iterator
-        si = objectSources.begin();
-      si != objectSources.end(); ++si)
-    {
-    cmSourceFile const* sf = *si;
-    std::string objectNameLower = cmSystemTools::LowerCase(
-      cmSystemTools::GetFilenameWithoutLastExtension(sf->GetFullPath()));
-    objectNameLower += ".obj";
-    counts[objectNameLower] += 1;
-    }
-
-  // For all source files producing duplicate names we need unique
-  // object name computation.
-  for(std::vector<cmSourceFile const*>::const_iterator
-        si = objectSources.begin();
-      si != objectSources.end(); ++si)
-    {
-    cmSourceFile const* sf = *si;
-    std::string objectName =
-      cmSystemTools::GetFilenameWithoutLastExtension(sf->GetFullPath());
-    objectName += ".obj";
-    if(counts[cmSystemTools::LowerCase(objectName)] > 1)
-      {
-      gt->AddExplicitObjectName(sf);
-      objectName = lg->GetObjectFileNameWithoutTarget(*sf, dir_max);
-      }
-    gt->AddObject(sf, objectName);
+
+  std::map<cmSourceFile const*, std::string> mapping;
+  for(std::vector<cmSourceFile const*>::const_iterator it
+      = objectSources.begin(); it != objectSources.end(); ++it)
+    {
+    mapping[*it];
+    }
+
+  gt->LocalGenerator->ComputeObjectFilenames(mapping, gt);
+
+  for(std::map<cmSourceFile const*, std::string>::const_iterator it
+      = mapping.begin(); it != mapping.end(); ++it)
+    {
+    gt->AddObject(it->first, it->second);
     }
 }
 
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index bd5ed58..3ab804c 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -3952,30 +3952,22 @@ void
 cmGlobalXCodeGenerator
 ::ComputeTargetObjects(cmGeneratorTarget* gt) const
 {
-  // Count the number of object files with each name. Warn about duplicate
-  // names since Xcode names them uniquely automatically with a numeric suffix
-  // to avoid exact duplicate file names. Note that Mac file names are not
-  // typically case sensitive, hence the LowerCase.
-  std::map<std::string, int> counts;
   std::vector<cmSourceFile*> objectSources;
   gt->GetObjectSources(objectSources);
-  for(std::vector<cmSourceFile*>::const_iterator
-      si = objectSources.begin();
-      si != objectSources.end(); ++si)
+
+  std::map<cmSourceFile const*, std::string> mapping;
+  for(std::vector<cmSourceFile const*>::const_iterator it
+      = objectSources.begin(); it != objectSources.end(); ++it)
     {
-    cmSourceFile* sf = *si;
-    std::string objectName =
-      cmSystemTools::GetFilenameWithoutLastExtension(sf->GetFullPath());
-    objectName += ".o";
+    mapping[*it];
+    }
 
-    std::string objectNameLower = cmSystemTools::LowerCase(objectName);
-    counts[objectNameLower] += 1;
-    if (2 == counts[objectNameLower])
-      {
-      // TODO: emit warning about duplicate name?
-      }
+  gt->LocalGenerator->ComputeObjectFilenames(mapping, gt);
 
-    gt->AddObject(sf, objectName);
+  for(std::map<cmSourceFile const*, std::string>::const_iterator it
+      = mapping.begin(); it != mapping.end(); ++it)
+    {
+    gt->AddObject(it->first, it->second);
     }
 }
 
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index de8dd51..8c610de 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -3080,6 +3080,14 @@ cmLocalGenerator
 }
 
 //----------------------------------------------------------------------------
+void cmLocalGenerator::ComputeObjectFilenames(
+                            std::map<cmSourceFile const*, std::string>&,
+                            cmGeneratorTarget const*)
+{
+
+}
+
+//----------------------------------------------------------------------------
 std::string
 cmLocalGenerator
 ::GetObjectFileNameWithoutTarget(const cmSourceFile& source,
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 4d62833..8865288 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -371,6 +371,10 @@ public:
                       std::string& linkPath,
                       cmGeneratorTarget* target);
 
+  virtual void ComputeObjectFilenames(
+                        std::map<cmSourceFile const*, std::string>& mapping,
+                        cmGeneratorTarget const* gt = 0);
+
 protected:
   ///! put all the libraries for a target on into the given stream
   virtual void OutputLinkLibraries(std::string& linkLibraries,
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index acaacdd..adeea3c 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -267,6 +267,20 @@ void cmLocalNinjaGenerator::SetConfigName()
     }
 }
 
+//----------------------------------------------------------------------------
+void cmLocalNinjaGenerator::ComputeObjectFilenames(
+                        std::map<cmSourceFile const*, std::string>& mapping,
+                        cmGeneratorTarget const* gt)
+{
+  for(std::map<cmSourceFile const*, std::string>::iterator
+      si = mapping.begin(); si != mapping.end(); ++si)
+    {
+    cmSourceFile const* sf = si->first;
+    si->second = this->GetObjectFileNameWithoutTarget(*sf,
+                                                      gt->ObjectDirectory);
+    }
+}
+
 void cmLocalNinjaGenerator::WriteProcessedMakefile(std::ostream& os)
 {
   cmGlobalNinjaGenerator::WriteDivider(os);
diff --git a/Source/cmLocalNinjaGenerator.h b/Source/cmLocalNinjaGenerator.h
index 2d870fb..fe1cdd6 100644
--- a/Source/cmLocalNinjaGenerator.h
+++ b/Source/cmLocalNinjaGenerator.h
@@ -100,6 +100,10 @@ public:
   virtual std::string ConvertToLinkReference(std::string const& lib,
                                              OutputFormat format = SHELL);
 
+  virtual void ComputeObjectFilenames(
+                        std::map<cmSourceFile const*, std::string>& mapping,
+                        cmGeneratorTarget const* gt = 0);
+
 
 protected:
   virtual std::string ConvertToIncludeReference(std::string const& path,
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 76263f9..1d3878e 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -172,6 +172,20 @@ void cmLocalUnixMakefileGenerator3::Generate()
 }
 
 //----------------------------------------------------------------------------
+void cmLocalUnixMakefileGenerator3::ComputeObjectFilenames(
+                        std::map<cmSourceFile const*, std::string>& mapping,
+                        cmGeneratorTarget const* gt)
+{
+  for(std::map<cmSourceFile const*, std::string>::iterator
+      si = mapping.begin(); si != mapping.end(); ++si)
+    {
+    cmSourceFile const* sf = si->first;
+    si->second = this->GetObjectFileNameWithoutTarget(*sf,
+                                                      gt->ObjectDirectory);
+    }
+}
+
+//----------------------------------------------------------------------------
 void cmLocalUnixMakefileGenerator3::
 GetLocalObjectFiles(std::map<std::string, LocalObjectInfo> &localObjectFiles)
 {
diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h
index 73b425e..8d1acb0 100644
--- a/Source/cmLocalUnixMakefileGenerator3.h
+++ b/Source/cmLocalUnixMakefileGenerator3.h
@@ -312,6 +312,10 @@ private:
   std::string MakeLauncher(const cmCustomCommand& cc, cmTarget* target,
                            RelativeRoot relative);
 
+  virtual void ComputeObjectFilenames(
+                        std::map<cmSourceFile const*, std::string>& mapping,
+                        cmGeneratorTarget const* gt = 0);
+
   friend class cmMakefileTargetGenerator;
   friend class cmMakefileExecutableTargetGenerator;
   friend class cmMakefileLibraryTargetGenerator;
diff --git a/Source/cmLocalVisualStudioGenerator.cxx b/Source/cmLocalVisualStudioGenerator.cxx
index 6e93d22..bfd9223 100644
--- a/Source/cmLocalVisualStudioGenerator.cxx
+++ b/Source/cmLocalVisualStudioGenerator.cxx
@@ -31,6 +31,46 @@ cmLocalVisualStudioGenerator::~cmLocalVisualStudioGenerator()
 }
 
 //----------------------------------------------------------------------------
+void cmLocalVisualStudioGenerator::ComputeObjectFilenames(
+                        std::map<cmSourceFile const*, std::string>& mapping,
+                        cmGeneratorTarget const* gt)
+{
+  std::string dir_max = this->ComputeLongestObjectDirectory(*gt->Target);
+
+  // Count the number of object files with each name.  Note that
+  // windows file names are not case sensitive.
+  std::map<std::string, int> counts;
+
+  for(std::map<cmSourceFile const*, std::string>::iterator
+      si = mapping.begin(); si != mapping.end(); ++si)
+    {
+    cmSourceFile const* sf = si->first;
+    std::string objectNameLower = cmSystemTools::LowerCase(
+      cmSystemTools::GetFilenameWithoutLastExtension(sf->GetFullPath()));
+    objectNameLower += ".obj";
+    counts[objectNameLower] += 1;
+    }
+
+  // For all source files producing duplicate names we need unique
+  // object name computation.
+
+  for(std::map<cmSourceFile const*, std::string>::iterator
+      si = mapping.begin(); si != mapping.end(); ++si)
+    {
+    cmSourceFile const* sf = si->first;
+    std::string objectName =
+      cmSystemTools::GetFilenameWithoutLastExtension(sf->GetFullPath());
+    objectName += ".obj";
+    if(counts[cmSystemTools::LowerCase(objectName)] > 1)
+      {
+      const_cast<cmGeneratorTarget*>(gt)->AddExplicitObjectName(sf);
+      objectName = this->GetObjectFileNameWithoutTarget(*sf, dir_max);
+      }
+    si->second = objectName;
+    }
+}
+
+//----------------------------------------------------------------------------
 cmsys::auto_ptr<cmCustomCommand>
 cmLocalVisualStudioGenerator::MaybeCreateImplibDir(cmTarget& target,
                                                    const std::string& config,
diff --git a/Source/cmLocalVisualStudioGenerator.h b/Source/cmLocalVisualStudioGenerator.h
index 94a6293..1f9dfae 100644
--- a/Source/cmLocalVisualStudioGenerator.h
+++ b/Source/cmLocalVisualStudioGenerator.h
@@ -61,6 +61,10 @@ public:
 
   virtual void AddCMakeListsRules() = 0;
 
+  virtual void ComputeObjectFilenames(
+                        std::map<cmSourceFile const*, std::string>& mapping,
+                        cmGeneratorTarget const* = 0);
+
 protected:
   virtual const char* ReportErrorLabel() const;
   virtual bool CustomCommandUseLocal() const { return false; }
diff --git a/Source/cmLocalXCodeGenerator.cxx b/Source/cmLocalXCodeGenerator.cxx
index 5857aef..8ff6c87 100644
--- a/Source/cmLocalXCodeGenerator.cxx
+++ b/Source/cmLocalXCodeGenerator.cxx
@@ -71,3 +71,31 @@ void cmLocalXCodeGenerator::GenerateInstallRules()
     t->HasMacOSXRpathInstallNameDir("");
     }
 }
+
+//----------------------------------------------------------------------------
+void cmLocalXCodeGenerator::ComputeObjectFilenames(
+                        std::map<cmSourceFile const*, std::string>& mapping,
+                        cmGeneratorTarget const*)
+{
+  // Count the number of object files with each name. Warn about duplicate
+  // names since Xcode names them uniquely automatically with a numeric suffix
+  // to avoid exact duplicate file names. Note that Mac file names are not
+  // typically case sensitive, hence the LowerCase.
+  std::map<std::string, int> counts;
+  for(std::map<cmSourceFile const*, std::string>::iterator
+      si = mapping.begin(); si != mapping.end(); ++si)
+    {
+    cmSourceFile const* sf = si->first;
+    std::string objectName =
+      cmSystemTools::GetFilenameWithoutLastExtension(sf->GetFullPath());
+    objectName += ".o";
+
+    std::string objectNameLower = cmSystemTools::LowerCase(objectName);
+    counts[objectNameLower] += 1;
+    if (2 == counts[objectNameLower])
+      {
+      // TODO: emit warning about duplicate name?
+      }
+    si->second = objectName;
+    }
+}
diff --git a/Source/cmLocalXCodeGenerator.h b/Source/cmLocalXCodeGenerator.h
index 3bfe3a3..f553a17 100644
--- a/Source/cmLocalXCodeGenerator.h
+++ b/Source/cmLocalXCodeGenerator.h
@@ -32,6 +32,9 @@ public:
                                 const std::string& rawFlag);
   virtual void Generate();
   virtual void GenerateInstallRules();
+  virtual void ComputeObjectFilenames(
+                        std::map<cmSourceFile const*, std::string>& mapping,
+                        cmGeneratorTarget const* gt = 0);
 private:
 
 };

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bd4a5b135c80b4f3759fb21b162c458f4318f34c
commit bd4a5b135c80b4f3759fb21b162c458f4318f34c
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Mar 12 23:06:05 2014 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Mar 13 12:51:13 2014 +0100

    cmGeneratorTarget: Constify cmSourceFile* in containers.
    
    Some of them will be used with other APIs which require value_type
    to be cmSourceFile const*.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index bde60b8..8efd7bb 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -97,7 +97,7 @@ struct DoAccept
 template<>
 struct DoAccept<true>
 {
-  static void Do(std::vector<cmSourceFile*>& files, cmSourceFile* f)
+  static void Do(std::vector<cmSourceFile const*>& files, cmSourceFile* f)
     {
     files.push_back(f);
     }
@@ -120,7 +120,7 @@ struct DoAccept<true>
 };
 
 //----------------------------------------------------------------------------
-template<typename Tag, typename DataType = std::vector<cmSourceFile*> >
+template<typename Tag, typename DataType = std::vector<cmSourceFile const*> >
 struct TagVisitor
 {
   DataType& Data;
@@ -306,7 +306,8 @@ static void handleSystemIncludesDep(cmMakefile *mf, cmTarget* depTgt,
 
 //----------------------------------------------------------------------------
 void
-cmGeneratorTarget::GetObjectSources(std::vector<cmSourceFile*> &data) const
+cmGeneratorTarget
+::GetObjectSources(std::vector<cmSourceFile const*> &data) const
 {
   IMPLEMENT_VISIT(ObjectSources);
   if (this->Target->GetType() == cmTarget::OBJECT_LIBRARY)
@@ -342,34 +343,39 @@ bool cmGeneratorTarget::HasExplicitObjectName(cmSourceFile const* file) const
 }
 
 //----------------------------------------------------------------------------
-void cmGeneratorTarget::GetIDLSources(std::vector<cmSourceFile*>& data) const
+void cmGeneratorTarget
+::GetIDLSources(std::vector<cmSourceFile const*>& data) const
 {
   IMPLEMENT_VISIT(IDLSources);
 }
 
 //----------------------------------------------------------------------------
 void
-cmGeneratorTarget::GetHeaderSources(std::vector<cmSourceFile*>& data) const
+cmGeneratorTarget
+::GetHeaderSources(std::vector<cmSourceFile const*>& data) const
 {
   IMPLEMENT_VISIT(HeaderSources);
 }
 
 //----------------------------------------------------------------------------
-void cmGeneratorTarget::GetExtraSources(std::vector<cmSourceFile*>& data) const
+void cmGeneratorTarget
+::GetExtraSources(std::vector<cmSourceFile const*>& data) const
 {
   IMPLEMENT_VISIT(ExtraSources);
 }
 
 //----------------------------------------------------------------------------
 void
-cmGeneratorTarget::GetCustomCommands(std::vector<cmSourceFile*>& data) const
+cmGeneratorTarget
+::GetCustomCommands(std::vector<cmSourceFile const*>& data) const
 {
   IMPLEMENT_VISIT(CustomCommands);
 }
 
 //----------------------------------------------------------------------------
 void
-cmGeneratorTarget::GetExternalObjects(std::vector<cmSourceFile*>& data) const
+cmGeneratorTarget
+::GetExternalObjects(std::vector<cmSourceFile const*>& data) const
 {
   IMPLEMENT_VISIT(ExternalObjects);
 }
@@ -384,7 +390,8 @@ cmGeneratorTarget::GetExpectedResxHeaders(std::set<std::string>& srcs) const
 }
 
 //----------------------------------------------------------------------------
-void cmGeneratorTarget::GetResxSources(std::vector<cmSourceFile*>& srcs) const
+void cmGeneratorTarget
+::GetResxSources(std::vector<cmSourceFile const*>& srcs) const
 {
   ResxData data;
   IMPLEMENT_VISIT_IMPL(Resx, COMMA cmGeneratorTarget::ResxData)
@@ -570,7 +577,7 @@ cmGeneratorTarget::UseObjectLibraries(std::vector<std::string>& objs) const
     cmTarget* objLib = *ti;
     cmGeneratorTarget* ogt =
       this->GlobalGenerator->GetGeneratorTarget(objLib);
-    for(std::vector<cmSourceFile*>::const_iterator
+    for(std::vector<cmSourceFile const*>::const_iterator
           si = ogt->ObjectSources.begin();
         si != ogt->ObjectSources.end(); ++si)
       {
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 1c4276c..139e736 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -32,19 +32,19 @@ public:
   bool GetPropertyAsBool(const std::string& prop) const;
   void GetSourceFiles(std::vector<cmSourceFile*>& files) const;
 
-  void GetObjectSources(std::vector<cmSourceFile*> &) const;
+  void GetObjectSources(std::vector<cmSourceFile const*> &) const;
   const std::string& GetObjectName(cmSourceFile const* file);
 
   void AddObject(cmSourceFile const* sf, std::string const&name);
   bool HasExplicitObjectName(cmSourceFile const* file) const;
   void AddExplicitObjectName(cmSourceFile const* sf);
 
-  void GetResxSources(std::vector<cmSourceFile*>&) const;
-  void GetIDLSources(std::vector<cmSourceFile*>&) const;
-  void GetExternalObjects(std::vector<cmSourceFile*>&) const;
-  void GetHeaderSources(std::vector<cmSourceFile*>&) const;
-  void GetExtraSources(std::vector<cmSourceFile*>&) const;
-  void GetCustomCommands(std::vector<cmSourceFile*>&) const;
+  void GetResxSources(std::vector<cmSourceFile const*>&) const;
+  void GetIDLSources(std::vector<cmSourceFile const*>&) const;
+  void GetExternalObjects(std::vector<cmSourceFile const*>&) const;
+  void GetHeaderSources(std::vector<cmSourceFile const*>&) const;
+  void GetExtraSources(std::vector<cmSourceFile const*>&) const;
+  void GetCustomCommands(std::vector<cmSourceFile const*>&) const;
   void GetExpectedResxHeaders(std::set<std::string>&) const;
 
   cmTarget* Target;
@@ -117,7 +117,7 @@ public:
 
   struct ResxData {
     mutable std::set<std::string> ExpectedResxHeaders;
-    mutable std::vector<cmSourceFile*> ResxSources;
+    mutable std::vector<cmSourceFile const*> ResxSources;
   };
 private:
   friend class cmTargetTraceDependencies;
@@ -127,7 +127,7 @@ private:
 
   std::map<cmSourceFile const*, std::string> Objects;
   std::set<cmSourceFile const*> ExplicitObjectName;
-  mutable std::vector<cmSourceFile*> ObjectSources;
+  mutable std::vector<cmSourceFile const*> ObjectSources;
   std::vector<cmTarget*> ObjectLibraries;
   mutable std::map<std::string, std::vector<std::string> > SystemIncludesCache;
 
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 686414d..e9c31e9 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -634,14 +634,14 @@ std::string cmGlobalNinjaGenerator::GetEditCacheCommand() const
 // TODO: Refactor to combine with cmGlobalUnixMakefileGenerator3 impl.
 void cmGlobalNinjaGenerator::ComputeTargetObjects(cmGeneratorTarget* gt) const
 {
-  std::vector<cmSourceFile*> objectSources;
+  std::vector<cmSourceFile const*> objectSources;
   gt->GetObjectSources(objectSources);
   // Compute the name of each object file.
-  for(std::vector<cmSourceFile*>::iterator
+  for(std::vector<cmSourceFile const*>::iterator
         si = objectSources.begin();
       si != objectSources.end(); ++si)
     {
-    cmSourceFile* sf = *si;
+    cmSourceFile const* sf = *si;
     std::string objectName = gt->LocalGenerator
       ->GetObjectFileNameWithoutTarget(*sf, gt->ObjectDirectory);
     gt->AddObject(sf, objectName);
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index f9ec0a9..6ce8678 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -108,14 +108,14 @@ void
 cmGlobalUnixMakefileGenerator3
 ::ComputeTargetObjects(cmGeneratorTarget* gt) const
 {
-  std::vector<cmSourceFile*> objectSources;
+  std::vector<cmSourceFile const*> objectSources;
   gt->GetObjectSources(objectSources);
   // Compute the name of each object file.
-  for(std::vector<cmSourceFile*>::iterator
+  for(std::vector<cmSourceFile const*>::iterator
         si = objectSources.begin();
       si != objectSources.end(); ++si)
     {
-    cmSourceFile* sf = *si;
+    cmSourceFile const* sf = *si;
     std::string objectName = gt->LocalGenerator
       ->GetObjectFileNameWithoutTarget(*sf, gt->ObjectDirectory);
     gt->AddObject(sf, objectName);
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index f3cba5a..bd57d0c 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -129,13 +129,13 @@ cmGlobalVisualStudioGenerator
   // Count the number of object files with each name.  Note that
   // windows file names are not case sensitive.
   std::map<std::string, int> counts;
-  std::vector<cmSourceFile*> objectSources;
+  std::vector<cmSourceFile const*> objectSources;
   gt->GetObjectSources(objectSources);
-  for(std::vector<cmSourceFile*>::const_iterator
+  for(std::vector<cmSourceFile const*>::const_iterator
         si = objectSources.begin();
       si != objectSources.end(); ++si)
     {
-    cmSourceFile* sf = *si;
+    cmSourceFile const* sf = *si;
     std::string objectNameLower = cmSystemTools::LowerCase(
       cmSystemTools::GetFilenameWithoutLastExtension(sf->GetFullPath()));
     objectNameLower += ".obj";
@@ -144,11 +144,11 @@ cmGlobalVisualStudioGenerator
 
   // For all source files producing duplicate names we need unique
   // object name computation.
-  for(std::vector<cmSourceFile*>::const_iterator
+  for(std::vector<cmSourceFile const*>::const_iterator
         si = objectSources.begin();
       si != objectSources.end(); ++si)
     {
-    cmSourceFile* sf = *si;
+    cmSourceFile const* sf = *si;
     std::string objectName =
       cmSystemTools::GetFilenameWithoutLastExtension(sf->GetFullPath());
     objectName += ".obj";
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 27db03b..76263f9 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -185,7 +185,7 @@ GetLocalObjectFiles(std::map<std::string, LocalObjectInfo> &localObjectFiles)
       {
       continue;
       }
-    std::vector<cmSourceFile*> objectSources;
+    std::vector<cmSourceFile const*> objectSources;
     gt->GetObjectSources(objectSources);
     // Compute full path to object file directory for this target.
     std::string dir_max;
@@ -194,11 +194,11 @@ GetLocalObjectFiles(std::map<std::string, LocalObjectInfo> &localObjectFiles)
     dir_max += this->GetTargetDirectory(*gt->Target);
     dir_max += "/";
     // Compute the name of each object file.
-    for(std::vector<cmSourceFile*>::iterator
+    for(std::vector<cmSourceFile const*>::iterator
           si = objectSources.begin();
         si != objectSources.end(); ++si)
       {
-      cmSourceFile* sf = *si;
+      cmSourceFile const* sf = *si;
       bool hasSourceExtension = true;
       std::string objectName = this->GetObjectFileNameWithoutTarget(*sf,
                                                                     dir_max,
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 2c32f74..d69846e 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -152,9 +152,9 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules()
 
   // First generate the object rule files.  Save a list of all object
   // files for this target.
-  std::vector<cmSourceFile*> customCommands;
+  std::vector<cmSourceFile const*> customCommands;
   this->GeneratorTarget->GetCustomCommands(customCommands);
-  for(std::vector<cmSourceFile*>::const_iterator
+  for(std::vector<cmSourceFile const*>::const_iterator
         si = customCommands.begin();
       si != customCommands.end(); ++si)
     {
@@ -173,27 +173,27 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules()
         }
       }
     }
-  std::vector<cmSourceFile*> headerSources;
+  std::vector<cmSourceFile const*> headerSources;
   this->GeneratorTarget->GetHeaderSources(headerSources);
   this->OSXBundleGenerator->GenerateMacOSXContentStatements(
     headerSources,
     this->MacOSXContentGenerator);
-  std::vector<cmSourceFile*> extraSources;
+  std::vector<cmSourceFile const*> extraSources;
   this->GeneratorTarget->GetExtraSources(extraSources);
   this->OSXBundleGenerator->GenerateMacOSXContentStatements(
     extraSources,
     this->MacOSXContentGenerator);
-  std::vector<cmSourceFile*> externalObjects;
+  std::vector<cmSourceFile const*> externalObjects;
   this->GeneratorTarget->GetExternalObjects(externalObjects);
-  for(std::vector<cmSourceFile*>::const_iterator
+  for(std::vector<cmSourceFile const*>::const_iterator
         si = externalObjects.begin();
       si != externalObjects.end(); ++si)
     {
     this->ExternalObjects.push_back((*si)->GetFullPath());
     }
-  std::vector<cmSourceFile*> objectSources;
+  std::vector<cmSourceFile const*> objectSources;
   this->GeneratorTarget->GetObjectSources(objectSources);
-  for(std::vector<cmSourceFile*>::const_iterator
+  for(std::vector<cmSourceFile const*>::const_iterator
         si = objectSources.begin(); si != objectSources.end(); ++si)
     {
     // Generate this object file's rule file.
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index a0915b8..33ffc85 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -480,36 +480,36 @@ cmNinjaTargetGenerator
     << this->GetTargetName()
     << "\n\n";
 
-  std::vector<cmSourceFile*> customCommands;
+  std::vector<cmSourceFile const*> customCommands;
   this->GeneratorTarget->GetCustomCommands(customCommands);
-  for(std::vector<cmSourceFile*>::const_iterator
+  for(std::vector<cmSourceFile const*>::const_iterator
         si = customCommands.begin();
       si != customCommands.end(); ++si)
      {
      cmCustomCommand const* cc = (*si)->GetCustomCommand();
      this->GetLocalGenerator()->AddCustomCommandTarget(cc, this->GetTarget());
      }
-  std::vector<cmSourceFile*> headerSources;
+  std::vector<cmSourceFile const*> headerSources;
   this->GeneratorTarget->GetHeaderSources(headerSources);
   this->OSXBundleGenerator->GenerateMacOSXContentStatements(
     headerSources,
     this->MacOSXContentGenerator);
-  std::vector<cmSourceFile*> extraSources;
+  std::vector<cmSourceFile const*> extraSources;
   this->GeneratorTarget->GetExtraSources(extraSources);
   this->OSXBundleGenerator->GenerateMacOSXContentStatements(
     extraSources,
     this->MacOSXContentGenerator);
-  std::vector<cmSourceFile*> externalObjects;
+  std::vector<cmSourceFile const*> externalObjects;
   this->GeneratorTarget->GetExternalObjects(externalObjects);
-  for(std::vector<cmSourceFile*>::const_iterator
+  for(std::vector<cmSourceFile const*>::const_iterator
         si = externalObjects.begin();
       si != externalObjects.end(); ++si)
     {
     this->Objects.push_back(this->GetSourceFilePath(*si));
     }
-  std::vector<cmSourceFile*> objectSources;
+  std::vector<cmSourceFile const*> objectSources;
   this->GeneratorTarget->GetObjectSources(objectSources);
-  for(std::vector<cmSourceFile*>::const_iterator
+  for(std::vector<cmSourceFile const*>::const_iterator
         si = objectSources.begin(); si != objectSources.end(); ++si)
     {
     this->WriteObjectBuildStatement(*si);
@@ -570,9 +570,9 @@ cmNinjaTargetGenerator
   }
 
   // Add order-only dependencies on custom command outputs.
-  std::vector<cmSourceFile*> customCommands;
+  std::vector<cmSourceFile const*> customCommands;
   this->GeneratorTarget->GetCustomCommands(customCommands);
-  for(std::vector<cmSourceFile*>::const_iterator
+  for(std::vector<cmSourceFile const*>::const_iterator
         si = customCommands.begin();
       si != customCommands.end(); ++si)
     {
diff --git a/Source/cmOSXBundleGenerator.cxx b/Source/cmOSXBundleGenerator.cxx
index 835f892..6f16913 100644
--- a/Source/cmOSXBundleGenerator.cxx
+++ b/Source/cmOSXBundleGenerator.cxx
@@ -190,13 +190,14 @@ void cmOSXBundleGenerator::CreateCFBundle(const std::string& targetName,
 //----------------------------------------------------------------------------
 void
 cmOSXBundleGenerator::
-GenerateMacOSXContentStatements(std::vector<cmSourceFile*> const& sources,
-                                MacOSXContentGeneratorType* generator)
+GenerateMacOSXContentStatements(
+                              std::vector<cmSourceFile const*> const& sources,
+                              MacOSXContentGeneratorType* generator)
 {
   if (this->MustSkip())
     return;
 
-  for(std::vector<cmSourceFile*>::const_iterator
+  for(std::vector<cmSourceFile const*>::const_iterator
         si = sources.begin(); si != sources.end(); ++si)
     {
     cmGeneratorTarget::SourceFileFlags tsFlags =
diff --git a/Source/cmOSXBundleGenerator.h b/Source/cmOSXBundleGenerator.h
index 5acdd9f..f945c15 100644
--- a/Source/cmOSXBundleGenerator.h
+++ b/Source/cmOSXBundleGenerator.h
@@ -49,7 +49,7 @@ public:
   };
 
   void GenerateMacOSXContentStatements(
-    std::vector<cmSourceFile*> const& sources,
+    std::vector<cmSourceFile const*> const& sources,
     MacOSXContentGeneratorType* generator);
   std::string InitMacOSXContentDirectory(const char* pkgloc);
 
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 031610f..8ceeb7d 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -376,12 +376,12 @@ void cmVisualStudio10TargetGenerator::WriteDotNetReferences()
 
 void cmVisualStudio10TargetGenerator::WriteEmbeddedResourceGroup()
 {
-  std::vector<cmSourceFile*> resxObjs;
+  std::vector<cmSourceFile const*> resxObjs;
     this->GeneratorTarget->GetResxSources(resxObjs);
   if(!resxObjs.empty())
     {
     this->WriteString("<ItemGroup>\n", 1);
-    for(std::vector<cmSourceFile*>::const_iterator oi = resxObjs.begin();
+    for(std::vector<cmSourceFile const*>::const_iterator oi = resxObjs.begin();
         oi != resxObjs.end(); ++oi)
       {
       std::string obj = (*oi)->GetFullPath();
@@ -550,9 +550,9 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues()
 void cmVisualStudio10TargetGenerator::WriteCustomCommands()
 {
   this->SourcesVisited.clear();
-  std::vector<cmSourceFile*> customCommands;
+  std::vector<cmSourceFile const*> customCommands;
   this->GeneratorTarget->GetCustomCommands(customCommands);
-  for(std::vector<cmSourceFile*>::const_iterator
+  for(std::vector<cmSourceFile const*>::const_iterator
         si = customCommands.begin();
       si != customCommands.end(); ++si)
     {
@@ -744,12 +744,12 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
     this->WriteGroupSources(ti->first.c_str(), ti->second, sourceGroups);
     }
 
-  std::vector<cmSourceFile*> resxObjs;
+  std::vector<cmSourceFile const*> resxObjs;
     this->GeneratorTarget->GetResxSources(resxObjs);
   if(!resxObjs.empty())
     {
     this->WriteString("<ItemGroup>\n", 1);
-    for(std::vector<cmSourceFile*>::const_iterator oi = resxObjs.begin();
+    for(std::vector<cmSourceFile const*>::const_iterator oi = resxObjs.begin();
         oi != resxObjs.end(); ++oi)
       {
       std::string obj = (*oi)->GetFullPath();
@@ -900,7 +900,7 @@ WriteGroupSources(const char* name,
   for(ToolSources::const_iterator s = sources.begin();
       s != sources.end(); ++s)
     {
-    cmSourceFile* sf = s->SourceFile;
+    cmSourceFile const* sf = s->SourceFile;
     std::string const& source = sf->GetFullPath();
     cmSourceGroup* sourceGroup =
       this->Makefile->FindSourceGroup(source.c_str(), sourceGroups);
@@ -983,9 +983,9 @@ void cmVisualStudio10TargetGenerator::WriteSource(
 }
 
 void cmVisualStudio10TargetGenerator::WriteSources(
-  const char* tool, std::vector<cmSourceFile*> const& sources)
+  const char* tool, std::vector<cmSourceFile const*> const& sources)
 {
-  for(std::vector<cmSourceFile*>::const_iterator
+  for(std::vector<cmSourceFile const*>::const_iterator
         si = sources.begin(); si != sources.end(); ++si)
     {
     this->WriteSource(tool, *si);
@@ -1000,16 +1000,16 @@ void cmVisualStudio10TargetGenerator::WriteAllSources()
     }
   this->WriteString("<ItemGroup>\n", 1);
 
-  std::vector<cmSourceFile*> headerSources;
+  std::vector<cmSourceFile const*> headerSources;
   this->GeneratorTarget->GetHeaderSources(headerSources);
   this->WriteSources("ClInclude", headerSources);
-  std::vector<cmSourceFile*> idlSources;
+  std::vector<cmSourceFile const*> idlSources;
   this->GeneratorTarget->GetIDLSources(idlSources);
   this->WriteSources("Midl", idlSources);
 
-  std::vector<cmSourceFile*> objectSources;
+  std::vector<cmSourceFile const*> objectSources;
   this->GeneratorTarget->GetObjectSources(objectSources);
-  for(std::vector<cmSourceFile*>::const_iterator
+  for(std::vector<cmSourceFile const*>::const_iterator
         si = objectSources.begin();
       si != objectSources.end(); ++si)
     {
@@ -1048,7 +1048,7 @@ void cmVisualStudio10TargetGenerator::WriteAllSources()
       }
     }
 
-  std::vector<cmSourceFile*> externalObjects;
+  std::vector<cmSourceFile const*> externalObjects;
   this->GeneratorTarget->GetExternalObjects(externalObjects);
   if(this->LocalGenerator->GetVersion() > cmLocalVisualStudioGenerator::VS10)
     {
@@ -1060,7 +1060,7 @@ void cmVisualStudio10TargetGenerator::WriteAllSources()
     {
     // If an object file is generated in this target, then vs10 will use
     // it in the build, and we have to list it as None instead of Object.
-    for(std::vector<cmSourceFile*>::const_iterator
+    for(std::vector<cmSourceFile const*>::const_iterator
           si = externalObjects.begin();
         si != externalObjects.end(); ++si)
       {
@@ -1070,7 +1070,7 @@ void cmVisualStudio10TargetGenerator::WriteAllSources()
       }
     }
 
-  std::vector<cmSourceFile*> extraSources;
+  std::vector<cmSourceFile const*> extraSources;
   this->GeneratorTarget->GetExtraSources(extraSources);
   this->WriteSources("None", extraSources);
 
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index 8faeb8e..d72c6fd 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -57,7 +57,8 @@ private:
   void WriteProjectConfigurationValues();
   void WriteSource(const char* tool, cmSourceFile const* sf,
                    const char* end = 0);
-  void WriteSources(const char* tool, std::vector<cmSourceFile*> const&);
+  void WriteSources(const char* tool,
+                    std::vector<cmSourceFile const*> const&);
   void WriteAllSources();
   void WriteDotNetReferences();
   void WriteEmbeddedResourceGroup();

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

Summary of changes:
 Source/cmLocalUnixMakefileGenerator3.h |    4 ++++
 1 file changed, 4 insertions(+)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list