Imported Upstream version 2.8.11.2
[platform/upstream/cmake.git] / Source / cmGlobalVisualStudio71Generator.cxx
index d6b653c..2494f55 100644 (file)
@@ -34,14 +34,6 @@ cmLocalGenerator *cmGlobalVisualStudio71Generator::CreateLocalGenerator()
 }
 
 //----------------------------------------------------------------------------
-void cmGlobalVisualStudio71Generator::AddPlatformDefinitions(cmMakefile* mf)
-{
-  this->cmGlobalVisualStudio7Generator::AddPlatformDefinitions(mf);
-  mf->RemoveDefinition("MSVC70");
-  mf->AddDefinition("MSVC71", "1");
-}
-
-//----------------------------------------------------------------------------
 std::string cmGlobalVisualStudio71Generator::GetUserMacrosDirectory()
 {
   // Macros not supported on Visual Studio 7.1 and earlier because
@@ -99,7 +91,7 @@ void cmGlobalVisualStudio71Generator
 ::WriteSLNFile(std::ostream& fout,
                cmLocalGenerator* root,
                std::vector<cmLocalGenerator*>& generators)
-{ 
+{
   // Write out the header for a SLN file
   this->WriteSLNHeader(fout);
 
@@ -136,6 +128,9 @@ void cmGlobalVisualStudio71Generator
     fout << "\tEndGlobalSection\n";
     }
 
+  // Write out global sections
+  this->WriteSLNGlobalSections(fout, root);
+
   // Write the footer for the SLN file
   this->WriteSLNFooter(fout);
 }
@@ -156,7 +151,7 @@ cmGlobalVisualStudio71Generator
 
 //----------------------------------------------------------------------------
 // Write a dsp file into the SLN file,
-// Note, that dependencies from executables to 
+// Note, that dependencies from executables to
 // the libraries it uses are also done here
 void
 cmGlobalVisualStudio71Generator::WriteProject(std::ostream& fout,
@@ -166,11 +161,11 @@ cmGlobalVisualStudio71Generator::WriteProject(std::ostream& fout,
 {
   // check to see if this is a fortran build
   const char* ext = ".vcproj";
-  const char* project = 
+  const char* project =
     "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"";
   if(this->TargetIsFortranOnly(t))
     {
-    ext = ".vfproj"; 
+    ext = ".vfproj";
     project = "Project(\"{6989167D-11E4-40FE-8C1A-2192A86A7E90}\") = \"";
     }
   const char* targetExt = t.GetProperty("GENERATOR_FILE_NAME_EXT");
@@ -187,7 +182,7 @@ cmGlobalVisualStudio71Generator::WriteProject(std::ostream& fout,
   fout << "\tProjectSection(ProjectDependencies) = postProject\n";
   this->WriteProjectDepends(fout, dspname, dir, t);
   fout << "\tEndProjectSection\n";
-  
+
   fout <<"EndProject\n";
 
   UtilityDependsMap::iterator ui = this->UtilityDepends.find(&t);
@@ -208,7 +203,7 @@ cmGlobalVisualStudio71Generator::WriteProject(std::ostream& fout,
 
 //----------------------------------------------------------------------------
 // Write a dsp file into the SLN file,
-// Note, that dependencies from executables to 
+// Note, that dependencies from executables to
 // the libraries it uses are also done here
 void
 cmGlobalVisualStudio71Generator
@@ -238,12 +233,12 @@ cmGlobalVisualStudio71Generator
 // Write a dsp file into the SLN file, Note, that dependencies from
 // executables to the libraries it uses are also done here
 void cmGlobalVisualStudio71Generator
-::WriteExternalProject(std::ostream& fout, 
+::WriteExternalProject(std::ostream& fout,
                        const char* name,
                        const char* location,
                        const char* typeGuid,
                        const std::set<cmStdString>& depends)
-{ 
+{
   fout << "Project(\"{"
        << (typeGuid ? typeGuid : "8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942")
        << "}\") = \""
@@ -251,7 +246,7 @@ void cmGlobalVisualStudio71Generator
        << this->ConvertToSolutionPath(location) << "\", \"{"
        << this->GetGUID(name)
        << "}\"\n";
-  
+
   // write out the dependencies here VS 7.1 includes dependencies with the
   // project instead of in the global section
   if(!depends.empty())
@@ -262,18 +257,18 @@ void cmGlobalVisualStudio71Generator
       {
       if(it->size() > 0)
         {
-        fout << "\t\t{" 
-             << this->GetGUID(it->c_str()) 
-             << "} = {" 
-             << this->GetGUID(it->c_str()) 
+        fout << "\t\t{"
+             << this->GetGUID(it->c_str())
+             << "} = {"
+             << this->GetGUID(it->c_str())
              << "}\n";
         }
       }
     fout << "\tEndProjectSection\n";
-    }  
+    }
 
   fout << "EndProject\n";
-  
+
 
 }
 
@@ -281,18 +276,21 @@ void cmGlobalVisualStudio71Generator
 // Write a dsp file into the SLN file, Note, that dependencies from
 // executables to the libraries it uses are also done here
 void cmGlobalVisualStudio71Generator
-::WriteProjectConfigurations(std::ostream& fout, const char* name,
-                             bool partOfDefaultBuild,
-                             const char* platformMapping)
+::WriteProjectConfigurations(
+  std::ostream& fout, const char* name, cmTarget::TargetType,
+  const std::set<std::string>& configsPartOfDefaultBuild,
+  const char* platformMapping)
 {
   std::string guid = this->GetGUID(name);
   for(std::vector<std::string>::iterator i = this->Configurations.begin();
       i != this->Configurations.end(); ++i)
     {
-    fout << "\t\t{" << guid << "}." << *i 
+    fout << "\t\t{" << guid << "}." << *i
          << ".ActiveCfg = " << *i << "|"
          << (platformMapping ? platformMapping : "Win32") << std::endl;
-    if(partOfDefaultBuild)
+    std::set<std::string>::const_iterator
+      ci = configsPartOfDefaultBuild.find(*i);
+    if(!(ci == configsPartOfDefaultBuild.end()))
       {
       fout << "\t\t{" << guid << "}." << *i
            << ".Build.0 = " << *i << "|"
@@ -302,17 +300,6 @@ void cmGlobalVisualStudio71Generator
 }
 
 //----------------------------------------------------------------------------
-// Standard end of dsw file
-void cmGlobalVisualStudio71Generator::WriteSLNFooter(std::ostream& fout)
-{
-  fout << "\tGlobalSection(ExtensibilityGlobals) = postSolution\n"
-       << "\tEndGlobalSection\n"
-       << "\tGlobalSection(ExtensibilityAddIns) = postSolution\n"
-       << "\tEndGlobalSection\n"
-       << "EndGlobal\n";
-}
-
-//----------------------------------------------------------------------------
 // ouput standard header for dsw file
 void cmGlobalVisualStudio71Generator::WriteSLNHeader(std::ostream& fout)
 {
@@ -321,9 +308,9 @@ void cmGlobalVisualStudio71Generator::WriteSLNHeader(std::ostream& fout)
 
 //----------------------------------------------------------------------------
 void cmGlobalVisualStudio71Generator
-::GetDocumentation(cmDocumentationEntry& entry) const
+::GetDocumentation(cmDocumentationEntry& entry)
 {
-  entry.Name = this->GetName();
+  entry.Name = cmGlobalVisualStudio71Generator::GetActualName();
   entry.Brief = "Generates Visual Studio .NET 2003 project files.";
   entry.Full = "";
 }