1
0
Эх сурвалжийг харах

BUG: More fixing of support for global target son visual studio

Andy Cedilnik 19 жил өмнө
parent
commit
07d0e776ad

+ 36 - 17
Source/cmGlobalVisualStudio6Generator.cxx

@@ -169,23 +169,6 @@ void cmGlobalVisualStudio6Generator::Generate()
       gen[0]->GetMakefile()->
       gen[0]->GetMakefile()->
         AddUtilityCommand("ALL_BUILD", false, no_output, no_depends, no_working_dir,
         AddUtilityCommand("ALL_BUILD", false, no_output, no_depends, no_working_dir,
                           "echo", "Build all projects");
                           "echo", "Build all projects");
-      std::string cmake_command = 
-        m_LocalGenerators[0]->GetMakefile()->GetRequiredDefinition("CMAKE_COMMAND");
-      gen[0]->GetMakefile()->
-        AddUtilityCommand("INSTALL", false, no_output, no_depends, no_working_dir,
-                          cmake_command.c_str(),
-                          "-DBUILD_TYPE=$(IntDir)", "-P", "cmake_install.cmake");
-
-      // Make the INSTALL target depend on ALL_BUILD unless the
-      // project says to not do so.
-      const char* noall =
-        gen[0]->GetMakefile()
-        ->GetDefinition("CMAKE_SKIP_INSTALL_ALL_DEPENDENCY");
-      if(!noall || cmSystemTools::IsOff(noall))
-        {
-        cmTarget* install = gen[0]->GetMakefile()->FindTarget("INSTALL");
-        install->AddUtility("ALL_BUILD");
-        }
       }
       }
     }
     }
   
   
@@ -215,6 +198,9 @@ void cmGlobalVisualStudio6Generator::WriteDSWFile(std::ostream& fout,
   bool doneAllBuild = false;
   bool doneAllBuild = false;
   bool doneRunTests = false;
   bool doneRunTests = false;
   bool doneInstall = false;
   bool doneInstall = false;
+  bool doneEditCache = false;
+  bool doneRebuildCache = false;
+  bool donePackage = false;
 
 
   for(i = 0; i < generators.size(); ++i)
   for(i = 0; i < generators.size(); ++i)
     {
     {
@@ -322,6 +308,39 @@ void cmGlobalVisualStudio6Generator::WriteDSWFile(std::ostream& fout,
               doneRunTests = true;
               doneRunTests = true;
               }
               }
             }
             }
+          if(l->first == "EDIT_CACHE")
+            {
+            if(doneEditCache)
+              {
+              skip = true;
+              }
+            else
+              {
+              doneEditCache = true;
+              }
+            }
+          if(l->first == "REBUILD_CACHE")
+            {
+            if(doneRebuildCache)
+              {
+              skip = true;
+              }
+            else
+              {
+              doneRebuildCache = true;
+              }
+            }
+          if(l->first == "PACKAGE")
+            {
+            if(donePackage)
+              {
+              skip = true;
+              }
+            else
+              {
+              donePackage = true;
+              }
+            }
           if(!skip)
           if(!skip)
             {
             {
             this->WriteProject(fout, si->c_str(), dir.c_str(),l->second);
             this->WriteProject(fout, si->c_str(), dir.c_str(),l->second);

+ 2 - 1
Source/cmGlobalVisualStudio71Generator.cxx

@@ -107,7 +107,8 @@ void cmGlobalVisualStudio71Generator::WriteSLNFile(std::ostream& fout,
               {
               {
               if (al->second.IsInAll())
               if (al->second.IsInAll())
                 {
                 {
-                if (al->second.GetType() == cmTarget::UTILITY)
+                if (al->second.GetType() == cmTarget::UTILITY &&
+                    al->second.GetType() == cmTarget::GLOBAL_TARGET)
                   {
                   {
                   l->second.AddUtility(al->first.c_str());
                   l->second.AddUtility(al->first.c_str());
                   }
                   }

+ 2 - 17
Source/cmGlobalVisualStudio7Generator.cxx

@@ -205,22 +205,6 @@ void cmGlobalVisualStudio7Generator::Generate()
                           "echo", "Build all projects");
                           "echo", "Build all projects");
       std::string cmake_command = 
       std::string cmake_command = 
         m_LocalGenerators[0]->GetMakefile()->GetRequiredDefinition("CMAKE_COMMAND");
         m_LocalGenerators[0]->GetMakefile()->GetRequiredDefinition("CMAKE_COMMAND");
-      gen[0]->GetMakefile()->
-        AddUtilityCommand("INSTALL", false, no_output, no_depends,
-                          no_working_dir,
-                          cmake_command.c_str(),
-                          "-DBUILD_TYPE=$(OutDir)", "-P", "cmake_install.cmake");
-
-      // Make the INSTALL target depend on ALL_BUILD unless the
-      // project says to not do so.
-      const char* noall =
-        gen[0]->GetMakefile()
-        ->GetDefinition("CMAKE_SKIP_INSTALL_ALL_DEPENDENCY");
-      if(!noall || cmSystemTools::IsOff(noall))
-        {
-        cmTarget* install = gen[0]->GetMakefile()->FindTarget("INSTALL");
-        install->AddUtility("ALL_BUILD");
-        }
       }
       }
     }
     }
 
 
@@ -331,7 +315,8 @@ void cmGlobalVisualStudio7Generator::WriteSLNFile(std::ostream& fout,
               {
               {
               if (al->second.IsInAll())
               if (al->second.IsInAll())
                 {
                 {
-                if (al->second.GetType() == cmTarget::UTILITY)
+                if (al->second.GetType() == cmTarget::UTILITY &&
+                    al->second.GetType() == cmTarget::GLOBAL_TARGET)
                   {
                   {
                   l->second.AddUtility(al->first.c_str());
                   l->second.AddUtility(al->first.c_str());
                   }
                   }

+ 7 - 3
Source/cmLocalVisualStudio6Generator.cxx

@@ -183,6 +183,7 @@ void cmLocalVisualStudio6Generator::OutputDSPFile()
         this->SetBuildType(EXECUTABLE,l->first.c_str(), l->second);
         this->SetBuildType(EXECUTABLE,l->first.c_str(), l->second);
         break;
         break;
       case cmTarget::UTILITY:
       case cmTarget::UTILITY:
+      case cmTarget::GLOBAL_TARGET:
         this->SetBuildType(UTILITY, l->first.c_str(), l->second);
         this->SetBuildType(UTILITY, l->first.c_str(), l->second);
         break;
         break;
       case cmTarget::INSTALL_FILES:
       case cmTarget::INSTALL_FILES:
@@ -309,7 +310,8 @@ void cmLocalVisualStudio6Generator::WriteDSPFile(std::ostream& fout,
   // special care for dependencies.  The first rule must depend on all
   // special care for dependencies.  The first rule must depend on all
   // the dependencies of all the rules.  The later rules must each
   // the dependencies of all the rules.  The later rules must each
   // depend only on the previous rule.
   // depend only on the previous rule.
-  if (target.GetType() == cmTarget::UTILITY &&
+  if ((target.GetType() == cmTarget::UTILITY ||
+      target.GetType() == cmTarget::GLOBAL_TARGET) &&
       (!target.GetPreBuildCommands().empty() ||
       (!target.GetPreBuildCommands().empty() ||
        !target.GetPostBuildCommands().empty()))
        !target.GetPostBuildCommands().empty()))
     {
     {
@@ -453,7 +455,8 @@ void cmLocalVisualStudio6Generator::WriteGroup(const cmSourceGroup *sg, cmTarget
       {
       {
       cmSystemTools::ExpandListArgument(dependsValue, depends);
       cmSystemTools::ExpandListArgument(dependsValue, depends);
       }
       }
-    if (source != libName || target.GetType() == cmTarget::UTILITY)
+    if (source != libName || target.GetType() == cmTarget::UTILITY
+      || target.GetType() == cmTarget::GLOBAL_TARGET)
       {
       {
       fout << "# Begin Source File\n\n";
       fout << "# Begin Source File\n\n";
         
         
@@ -718,7 +721,8 @@ cmLocalVisualStudio6Generator::CreateTargetRules(cmTarget &target,
 {
 {
   std::string customRuleCode = "";
   std::string customRuleCode = "";
 
 
-  if (target.GetType() >= cmTarget::UTILITY)
+  if (target.GetType() >= cmTarget::UTILITY ||
+    target.GetType() >= cmTarget::GLOBAL_TARGET)
     {
     {
     return customRuleCode;
     return customRuleCode;
     }
     }

+ 6 - 7
Source/cmLocalVisualStudio7Generator.cxx

@@ -162,11 +162,6 @@ void cmLocalVisualStudio7Generator::OutputVCProjFile()
               && (l->second.GetType() != cmTarget::INSTALL_PROGRAMS)
               && (l->second.GetType() != cmTarget::INSTALL_PROGRAMS)
               && (strncmp(l->first.c_str(), "INCLUDE_EXTERNAL_MSPROJECT", 26) != 0)
               && (strncmp(l->first.c_str(), "INCLUDE_EXTERNAL_MSPROJECT", 26) != 0)
               && (strcmp(l->first.c_str(), "ALL_BUILD") != 0)
               && (strcmp(l->first.c_str(), "ALL_BUILD") != 0)
-              && (strcmp(l->first.c_str(), "RUN_TESTS") != 0)
-              && (strcmp(l->first.c_str(), "EDIT_CACHE") != 0)
-              && (strcmp(l->first.c_str(), "REBUILD_CACHE") != 0)
-              && (strcmp(l->first.c_str(), "PACKAGE") != 0)
-              && (strcmp(l->first.c_str(), "INSTALL") != 0)
               && (strcmp(l->first.c_str(), CMAKE_CHECK_BUILD_SYSTEM_TARGET) != 0))
               && (strcmp(l->first.c_str(), CMAKE_CHECK_BUILD_SYSTEM_TARGET) != 0))
             {
             {
             cmTarget& target = l->second;
             cmTarget& target = l->second;
@@ -435,6 +430,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
       configType = "1";
       configType = "1";
       break; 
       break; 
     case cmTarget::UTILITY:
     case cmTarget::UTILITY:
+    case cmTarget::GLOBAL_TARGET:
       configType = "10";
       configType = "10";
     default:
     default:
       break;
       break;
@@ -859,6 +855,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
     break;
     break;
     }
     }
     case cmTarget::UTILITY:
     case cmTarget::UTILITY:
+    case cmTarget::GLOBAL_TARGET:
       break;
       break;
     }
     }
 }
 }
@@ -1070,7 +1067,8 @@ void cmLocalVisualStudio7Generator::WriteGroup(const cmSourceGroup *sg, cmTarget
           }
           }
         }
         }
       }
       }
-    if (source != libName || target.GetType() == cmTarget::UTILITY)
+    if (source != libName || target.GetType() == cmTarget::UTILITY ||
+      target.GetType() == cmTarget::GLOBAL_TARGET )
       {
       {
       fout << "\t\t\t<File\n";
       fout << "\t\t\t<File\n";
       std::string d = this->ConvertToXMLOutputPathSingle(source.c_str());
       std::string d = this->ConvertToXMLOutputPathSingle(source.c_str());
@@ -1222,7 +1220,8 @@ void cmLocalVisualStudio7Generator::OutputTargetRules(std::ostream& fout,
                                                       cmTarget &target, 
                                                       cmTarget &target, 
                                                       const char * /*libName*/)
                                                       const char * /*libName*/)
 {
 {
-  if (target.GetType() > cmTarget::UTILITY)
+  if (target.GetType() > cmTarget::UTILITY ||
+    target.GetType() > cmTarget::GLOBAL_TARGET)
     {
     {
     return;
     return;
     }
     }