[cmake-commits] king committed cmFLTKWrapUICommand.cxx 1.33 1.34 cmMakefile.cxx 1.392 1.393 cmTarget.h 1.84 1.85

cmake-commits at cmake.org cmake-commits at cmake.org
Mon May 28 09:59:10 EDT 2007


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

Modified Files:
	cmFLTKWrapUICommand.cxx cmMakefile.cxx cmTarget.h 
Log Message:
ENH: Made cmTarget::GetSourceLists return a reference to const so that all additions of sources must go through access methods in cmTarget.


Index: cmFLTKWrapUICommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmFLTKWrapUICommand.cxx,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- cmFLTKWrapUICommand.cxx	13 Dec 2006 17:19:58 -0000	1.33
+++ cmFLTKWrapUICommand.cxx	28 May 2007 13:59:08 -0000	1.34
@@ -123,7 +123,7 @@
   // people should add the srcs to the target themselves, but the old command
   // didn't support that, so check and see if they added the files in and if
   // they didn;t then print a warning and add then anyhow
-  std::vector<std::string> srcs = 
+  std::vector<std::string> const& srcs = 
     this->Makefile->GetTargets()[this->Target].GetSourceLists();
   bool found = false;
   for (unsigned int i = 0; i < srcs.size(); ++i)

Index: cmTarget.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTarget.h,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -d -r1.84 -r1.85
--- cmTarget.h	23 May 2007 17:27:00 -0000	1.84
+++ cmTarget.h	28 May 2007 13:59:08 -0000	1.85
@@ -76,7 +76,12 @@
   /**
    * Get the list of the source lists used by this target
    */
-  std::vector<std::string> &GetSourceLists() {return this->SourceLists;}
+  std::vector<std::string> const& GetSourceLists() {return this->SourceLists;}
+
+  void AddSourceListEntry(const char* src)
+    { this->SourceLists.push_back(src); }
+  void SetSourceList(std::vector<std::string> const& srcs)
+    { this->SourceLists = srcs; }
 
   ///! Return the list of frameworks being linked to this target
   std::vector<std::string> &GetFrameworks() {return this->Frameworks;}

Index: cmMakefile.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefile.cxx,v
retrieving revision 1.392
retrieving revision 1.393
diff -u -d -r1.392 -r1.393
--- cmMakefile.cxx	23 May 2007 19:40:12 -0000	1.392
+++ cmMakefile.cxx	28 May 2007 13:59:08 -0000	1.393
@@ -766,7 +766,7 @@
       {
       if (this->Targets.find(target) != this->Targets.end())
         {
-        this->Targets[target].GetSourceLists().push_back(source);
+        this->Targets[target].AddSourceListEntry(source);
         }
       else
         {
@@ -848,7 +848,7 @@
                                  commandLines, comment,
                                  workingDirectory, no_replace,
                                  escapeOldStyle);
-  target->GetSourceLists().push_back(force);
+  target->AddSourceListEntry(force.c_str());
 
   // The output is not actually created so mark it symbolic.
   if(cmSourceFile* sf = this->GetSource(force.c_str()))
@@ -1358,7 +1358,7 @@
     {
     target->SetProperty("EXCLUDE_FROM_ALL", "TRUE");
     }
-  target->GetSourceLists() = srcs;
+  target->SetSourceList(srcs);
   this->AddGlobalLinkInformation(lname, *target);
 }
 
@@ -1371,7 +1371,7 @@
     {
     target->SetProperty("EXCLUDE_FROM_ALL", "TRUE");
     }
-  target->GetSourceLists() = srcs;
+  target->SetSourceList(srcs);
   this->AddGlobalLinkInformation(exeName, *target);
   return target;
 }



More information about the Cmake-commits mailing list