[cmake-commits] martink committed cmGlobalVisualStudio71Generator.cxx 1.38 1.39 cmGlobalVisualStudio7Generator.cxx 1.83 1.84 cmGlobalVisualStudio8Generator.cxx 1.18 1.19 cmLocalVisualStudio7Generator.cxx 1.185 1.186 cmLocalVisualStudio7Generator.h 1.36 1.37 cmTarget.cxx 1.133 1.134

cmake-commits at cmake.org cmake-commits at cmake.org
Tue Apr 10 09:54:03 EDT 2007


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

Modified Files:
	cmGlobalVisualStudio71Generator.cxx 
	cmGlobalVisualStudio7Generator.cxx 
	cmGlobalVisualStudio8Generator.cxx 
	cmLocalVisualStudio7Generator.cxx 
	cmLocalVisualStudio7Generator.h cmTarget.cxx 
Log Message:
ENH: added internal target property for the name of the project file


Index: cmLocalVisualStudio7Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudio7Generator.cxx,v
retrieving revision 1.185
retrieving revision 1.186
diff -u -d -r1.185 -r1.186
--- cmLocalVisualStudio7Generator.cxx	28 Mar 2007 03:13:25 -0000	1.185
+++ cmLocalVisualStudio7Generator.cxx	10 Apr 2007 13:54:01 -0000	1.186
@@ -110,9 +110,6 @@
 
   // Create the VCProj or set of VCProj's for libraries and executables
 
-  // clear project names
-  this->CreatedProjectNames.clear();
-
   // Call TraceVSDependencies on all targets
   cmTargets &tgts = this->Makefile->GetTargets();
   for(cmTargets::iterator l = tgts.begin();
@@ -158,7 +155,7 @@
 {
   // add to the list of projects
   std::string pname = lname;
-  this->CreatedProjectNames.push_back(pname);
+  target.SetProperty("GENERATOR_FILE_NAME",lname);
   // create the dsp.cmake file
   std::string fname;
   fname = this->Makefile->GetStartOutputDirectory();

Index: cmLocalVisualStudio7Generator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudio7Generator.h,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- cmLocalVisualStudio7Generator.h	12 Mar 2007 16:35:11 -0000	1.36
+++ cmLocalVisualStudio7Generator.h	10 Apr 2007 13:54:01 -0000	1.37
@@ -54,14 +54,6 @@
    */
   void SetBuildType(BuildType,const char *name);
 
-  /**
-   * Return array of created DSP names in a STL vector.
-   * Each executable must have its own dsp.
-   */
-  std::vector<std::string> GetCreatedProjectNames() 
-    {
-    return this->CreatedProjectNames;
-    }
   void SetVersion71() {this->Version = 71;}
   void SetVersion8() {this->Version = 8;}
   void SetPlatformName(const char* n) { this->PlatformName = n;}
@@ -127,7 +119,6 @@
   virtual std::string GetTargetDirectory(cmTarget&);
 
   cmVS7FlagTable const* ExtraFlagTable;
-  std::vector<std::string> CreatedProjectNames;
   std::string ModuleDefinitionFile;
   int Version;
   std::string PlatformName; // Win32 or x64 

Index: cmGlobalVisualStudio8Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio8Generator.cxx,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- cmGlobalVisualStudio8Generator.cxx	13 Mar 2007 19:18:27 -0000	1.18
+++ cmGlobalVisualStudio8Generator.cxx	10 Apr 2007 13:54:01 -0000	1.19
@@ -184,9 +184,6 @@
       continue;
       }
     cmMakefile* mf = generators[i]->GetMakefile();
-    std::vector<std::string> dspnames =
-      static_cast<cmLocalVisualStudio7Generator*>(generators[i])
-      ->GetCreatedProjectNames();
     cmTargets& tgts = mf->GetTargets();
     for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); ++l)
       {

Index: cmGlobalVisualStudio71Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio71Generator.cxx,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- cmGlobalVisualStudio71Generator.cxx	4 Apr 2007 18:49:35 -0000	1.38
+++ cmGlobalVisualStudio71Generator.cxx	10 Apr 2007 13:54:01 -0000	1.39
@@ -85,13 +85,9 @@
     // Get the list of create dsp files names from the cmVCProjWriter, more
     // than one dsp could have been created per input CMakeLists.txt file
     // for each target
-    std::vector<std::string> dspnames = 
-      static_cast<cmLocalVisualStudio7Generator *>(generators[i])
-      ->GetCreatedProjectNames();
     cmTargets &tgts = generators[i]->GetMakefile()->GetTargets();
     cmTargets::iterator l = tgts.begin();
-    for(std::vector<std::string>::iterator si = dspnames.begin(); 
-        l != tgts.end() && si != dspnames.end(); ++l)
+    for(; l != tgts.end(); ++l)
       {
       // special handling for the current makefile
       if(mf == generators[0]->GetMakefile())
@@ -221,9 +217,13 @@
             }
           if(!skip)
             {
-            this->WriteProject(fout, si->c_str(), dir.c_str(),l->second);
+            const char *dspname = 
+              l->second.GetProperty("GENERATOR_FILE_NAME");
+            if (dspname)
+              {
+              this->WriteProject(fout, dspname, dir.c_str(),l->second);
+              }
             }
-          ++si;
           }
         }
       }
@@ -241,13 +241,10 @@
     // Get the list of create dsp files names from the cmVCProjWriter, more
     // than one dsp could have been created per input CMakeLists.txt file
     // for each target
-    std::vector<std::string> dspnames = 
-      pg->GetCreatedProjectNames();
     cmTargets &tgts = pg->GetMakefile()->GetTargets();
     cmTargets::iterator l = tgts.begin();
     std::string dir = mf->GetStartDirectory();
-    for(std::vector<std::string>::iterator si = dspnames.begin(); 
-        l != tgts.end() && si != dspnames.end(); ++l)
+    for(; l != tgts.end(); ++l)
       {
       if (strncmp(l->first.c_str(), "INCLUDE_EXTERNAL_MSPROJECT", 26) == 0)
         {
@@ -263,9 +260,13 @@
         bool partOfDefaultBuild = this->IsPartOfDefaultBuild(
           root->GetMakefile()->GetProjectName(),
           &l->second);
-        this->WriteProjectConfigurations(fout, si->c_str(),
-                                         partOfDefaultBuild);
-        ++si;
+        const char *dspname = 
+          l->second.GetProperty("GENERATOR_FILE_NAME");
+        if (dspname)
+          {
+          this->WriteProjectConfigurations(fout, dspname,
+                                           partOfDefaultBuild);
+          }
         }
       }
     }

Index: cmTarget.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTarget.cxx,v
retrieving revision 1.133
retrieving revision 1.134
diff -u -d -r1.133 -r1.134
--- cmTarget.cxx	28 Mar 2007 03:13:25 -0000	1.133
+++ cmTarget.cxx	10 Apr 2007 13:54:01 -0000	1.134
@@ -276,6 +276,12 @@
      "All Windows-based systems including Cygwin are DLL platforms.");
 
   cm->DefineProperty
+    ("GENERATOR_FILE_NAME", cmProperty::TARGET, 
+     "Generator's file for this target.",
+     "An internal property used by some generators to record the name of "
+     "project or dsp file associated with this target.");
+
+  cm->DefineProperty
     ("OBJECT_FILES", cmProperty::TARGET, 
      "Used to get the resulting list of object files that make up a "
      "target.",

Index: cmGlobalVisualStudio7Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio7Generator.cxx,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -d -r1.83 -r1.84
--- cmGlobalVisualStudio7Generator.cxx	4 Apr 2007 18:49:35 -0000	1.83
+++ cmGlobalVisualStudio7Generator.cxx	10 Apr 2007 13:54:01 -0000	1.84
@@ -317,13 +317,9 @@
     // Get the list of create dsp files names from the cmVCProjWriter, more
     // than one dsp could have been created per input CMakeLists.txt file
     // for each target
-    std::vector<std::string> dspnames = 
-      static_cast<cmLocalVisualStudio7Generator *>(generators[i])
-      ->GetCreatedProjectNames();
     cmTargets &tgts = generators[i]->GetMakefile()->GetTargets();
     cmTargets::iterator l = tgts.begin();
-    for(std::vector<std::string>::iterator si = dspnames.begin(); 
-        l != tgts.end(); ++l)
+    for(; l != tgts.end(); ++l)
       {
       // special handling for the current makefile
       if(mf == generators[0]->GetMakefile())
@@ -442,9 +438,13 @@
             }
           if(!skip)
             {
-            this->WriteProject(fout, si->c_str(), dir.c_str(),l->second);
+            const char *dspname = 
+              l->second.GetProperty("GENERATOR_FILE_NAME");
+            if (dspname)
+              {
+              this->WriteProject(fout, dspname, dir.c_str(),l->second);
+              }
             }
-          ++si;
           }
         }
       }
@@ -471,13 +471,10 @@
     // Get the list of create dsp files names from the cmVCProjWriter, more
     // than one dsp could have been created per input CMakeLists.txt file
     // for each target
-    std::vector<std::string> dspnames = 
-      pg->GetCreatedProjectNames();
     cmTargets &tgts = pg->GetMakefile()->GetTargets();
     cmTargets::iterator l = tgts.begin();
     std::string dir = mf->GetStartDirectory();
-    for(std::vector<std::string>::iterator si = dspnames.begin(); 
-        l != tgts.end() && si != dspnames.end(); ++l)
+    for(; l != tgts.end(); ++l)
       {
        if (strncmp(l->first.c_str(), "INCLUDE_EXTERNAL_MSPROJECT", 26) == 0)
          {
@@ -507,8 +504,13 @@
        else if ((l->second.GetType() != cmTarget::INSTALL_FILES)
                 && (l->second.GetType() != cmTarget::INSTALL_PROGRAMS))
         {
-        this->WriteProjectDepends(fout, si->c_str(), dir.c_str(), l->second);
-        ++si;
+        const char *dspname = 
+          l->second.GetProperty("GENERATOR_FILE_NAME");
+        if (dspname)
+          {
+          this->WriteProjectDepends(fout, dspname, 
+                                    dir.c_str(), l->second);
+          }
         }
       }
     }
@@ -523,13 +525,10 @@
     // Get the list of create dsp files names from the cmVCProjWriter, more
     // than one dsp could have been created per input CMakeLists.txt file
     // for each target
-    std::vector<std::string> dspnames = 
-      pg->GetCreatedProjectNames();
     cmTargets &tgts = pg->GetMakefile()->GetTargets();
     cmTargets::iterator l = tgts.begin();
     std::string dir = mf->GetStartDirectory();
-    for(std::vector<std::string>::iterator si = dspnames.begin(); 
-        l != tgts.end() && si != dspnames.end(); ++l)
+    for(; l != tgts.end(); ++l)
       {
       if(strncmp(l->first.c_str(), "INCLUDE_EXTERNAL_MSPROJECT", 26) == 0)
         {
@@ -545,9 +544,13 @@
         bool partOfDefaultBuild = this->IsPartOfDefaultBuild(
           root->GetMakefile()->GetProjectName(),
           &l->second);
-        this->WriteProjectConfigurations(fout, si->c_str(),
-                                         partOfDefaultBuild);
-        ++si;
+        const char *dspname = 
+          l->second.GetProperty("GENERATOR_FILE_NAME");
+        if (dspname)
+          {
+          this->WriteProjectConfigurations(fout, dspname,
+                                           partOfDefaultBuild);
+          }
         }
       }
     }



More information about the Cmake-commits mailing list