[cmake-commits] hoffman committed cmGlobalVisualStudio7Generator.cxx 1.97 1.98

cmake-commits at cmake.org cmake-commits at cmake.org
Wed Jan 30 16:22:53 EST 2008


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

Modified Files:
	cmGlobalVisualStudio7Generator.cxx 
Log Message:
ENH: make sure global targets are in the right projects


Index: cmGlobalVisualStudio7Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio7Generator.cxx,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -d -r1.97 -r1.98
--- cmGlobalVisualStudio7Generator.cxx	30 Jan 2008 17:04:38 -0000	1.97
+++ cmGlobalVisualStudio7Generator.cxx	30 Jan 2008 21:22:51 -0000	1.98
@@ -308,20 +308,6 @@
     cmGlobalGenerator::TargetDependSet& originalTargets
     )
 {
-  // Create a map of project that should only show up once
-  // in a project
-  const char* onlyOnceNames[] = 
-    {"INCLUDE_EXTERNAL_MSPROJECT","CMAKE_CHECK_BUILD_SYSTEM_TARGET",
-     "INSTALL", "RUN_TESTS", "EDIT_CACHE", "REBUILD_CACHE", "PACKAGE", 0};
-  std::map<cmStdString, int> onlyOnceMap;
-  int i =0;
-  for(const char* name = onlyOnceNames[i];
-      name != 0; name = onlyOnceNames[++i])
-    {
-    onlyOnceMap[name] = 0;
-    }
-  // add the CMAKE_CHECK_BUILD_SYSTEM_TARGET 
-  onlyOnceMap[CMAKE_CHECK_BUILD_SYSTEM_TARGET] = 0;
   std::string rootdir = root->GetMakefile()->GetStartOutputDirectory();
   rootdir += "/";
   for(cmGlobalGenerator::TargetDependSet::iterator tt =
@@ -343,26 +329,21 @@
       const cmCustomCommandLines& cmds = cc.GetCommandLines();
       std::string project = cmds[0][0];
       std::string location = cmds[0][1];
-      std::cout << "About to call WriteExternalProject " << this->GetName() << "\n";
       this->WriteExternalProject(fout, project.c_str(), 
                                  location.c_str(), cc.GetDepends());
       }
     else
       {
-      // if the target is an onlyOnceNames do it once
-      std::map<cmStdString, int>::iterator o = 
-        onlyOnceMap.find(target->GetName());
       bool skip = false;
-      if(o != onlyOnceMap.end())
+      // if it is a global target or the check build system target
+      // then only use the one that is for the root
+      if(target->GetType() == cmTarget::GLOBAL_TARGET
+         || !strcmp(target->GetName(), CMAKE_CHECK_BUILD_SYSTEM_TARGET))
         {
-        if(o->second > 0)
+        if(target->GetMakefile() != root->GetMakefile())
           {
           skip = true;
           }
-        else
-          {
-          o->second++;
-          }
         }
       // if not skipping the project then write it into the 
       // solution



More information about the Cmake-commits mailing list