diff -ur cmake-2.8.0.orig/Source/cmCustomCommand.h cmake-2.8.0.vs_asm/Source/cmCustomCommand.h
--- cmake-2.8.0.orig/Source/cmCustomCommand.h	2009-11-13 10:32:54.000000000 -0800
+++ cmake-2.8.0.vs_asm/Source/cmCustomCommand.h	2010-02-19 08:53:16.000000000 -0800
@@ -81,4 +81,7 @@
   ImplicitDependsList ImplicitDepends;
 };
 
+
+typedef std::map<std::string, const cmCustomCommand *> cmMultiConfigCustomCommand;
+
 #endif
diff -ur cmake-2.8.0.orig/Source/cmLocalVisualStudio7Generator.cxx cmake-2.8.0.vs_asm/Source/cmLocalVisualStudio7Generator.cxx
--- cmake-2.8.0.orig/Source/cmLocalVisualStudio7Generator.cxx	2009-11-13 10:32:57.000000000 -0800
+++ cmake-2.8.0.vs_asm/Source/cmLocalVisualStudio7Generator.cxx	2010-02-19 16:24:22.000000000 -0800
@@ -69,6 +69,7 @@
   lang.insert("Fortran");
   this->CreateCustomTargetsAndCommands(lang);
   this->FixGlobalTargets();
+  this->FixObjectCommands(lang);
 }
 
 void cmLocalVisualStudio7Generator::Generate()
@@ -113,6 +114,142 @@
     }
 }
 
+void cmLocalVisualStudio7Generator::FixObjectCommands(std::set<cmStdString> const& lang)
+{
+  cmTargets &tgts = this->Makefile->GetTargets();
+  for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); l++)
+    {
+    cmTarget& target = l->second;
+    switch(target.GetType())
+      { 
+      case cmTarget::STATIC_LIBRARY:
+      case cmTarget::SHARED_LIBRARY:
+      case cmTarget::MODULE_LIBRARY:
+      case cmTarget::EXECUTABLE: 
+        {
+        const std::vector<cmSourceFile *> &sourceFiles = target.GetSourceFiles();
+        for(std::vector<cmSourceFile *>::const_iterator sf = sourceFiles.begin(); sf != sourceFiles.end(); sf++)
+          {
+          // If we already have a custom command, don't add a generalized one.
+          if((*sf)->GetCustomCommand() != 0)
+            continue;
+
+          // Check to see if the language of this file is already handled by the generator.
+          const char *sflang = (*sf)->GetLanguage();
+          if(sflang == 0)
+            continue;
+          bool found_sflang = false;
+          for(std::set<cmStdString>::const_iterator li = lang.begin(); li != lang.end(); li++)
+            {
+            if((*li) == sflang)
+              {
+              found_sflang = true;
+              break;
+              }
+            }
+
+          // Since it is not handled, we need to add a custom command based on the CMAKE_${sflang}_COMPILE_OBJECT variable
+          if(!found_sflang)
+            {
+            cmMultiConfigCustomCommand *commands = new cmMultiConfigCustomCommand();
+            std::vector<std::string> *configs = static_cast<cmGlobalVisualStudio7Generator *>(this->GlobalGenerator)->GetConfigurations();
+            for(std::vector<std::string>::iterator config = configs->begin(); config != configs->end(); ++config)
+              {
+              // Determine the object file
+              std::string outfile = this->Makefile->GetStartOutputDirectory();
+              outfile += "/";
+              outfile += this->GetTargetDirectory(target);
+              outfile += "/";
+              outfile += *config;
+              outfile += "/";
+              std::string outfilebase = (*sf)->GetLocation().GetName();
+              std::string::size_type outext = outfilebase.find_last_of('.');
+              if (std::string::npos != outext)
+                outfilebase.erase(outext);
+              outfilebase += ".obj";
+              outfile += outfilebase;
+              std::vector<std::string> outfiles;
+              outfiles.push_back(outfile);
+
+              // Determine the commandline
+              cmCustomCommandLines lines;
+              cmCustomCommandLine line;
+              // Fetch the command line from the variable CMAKE_${sflang}_COMPILE_OBJECT
+              std::string cmake_compile_var = "CMAKE_";
+              cmake_compile_var += sflang;
+              cmake_compile_var += "_COMPILE_OBJECT";
+              std::string cmake_compile_line = this->Makefile->GetRequiredDefinition(cmake_compile_var.c_str());
+              // Now substitute variables of interest
+              RuleVariables vars;
+              vars.RuleLauncher = cmake_compile_var.c_str();
+              vars.CMTarget = &target;
+              // Object file (<OBJECT>)
+              vars.Object = outfile.c_str();
+              // Source file (<SOURCE>)
+              vars.Source = (*sf)->GetFullPath().c_str();
+              // Flags (<FLAGS>)
+              std::string cmake_flags_var = "CMAKE_";
+              cmake_flags_var += sflang;
+              cmake_flags_var += "_FLAGS";
+              std::string cmake_flags;
+              // global language flags (CMAKE_${sflang}_FLAGS)
+              if(this->Makefile->IsDefinitionSet(cmake_flags_var.c_str()))
+                {
+                cmake_flags += this->Makefile->GetDefinition(cmake_flags_var.c_str());
+                cmake_flags += " ";
+                }
+              // config specific language flags (CMAKE_${sflang}_FLAGS)
+              cmake_flags_var += "_";
+              cmake_flags_var += cmSystemTools::UpperCase(*config);
+              if(this->Makefile->IsDefinitionSet(cmake_flags_var.c_str()))
+                {
+                cmake_flags += this->Makefile->GetDefinition(cmake_flags_var.c_str());
+                cmake_flags += " ";
+                }
+              // source file specific flags (COMPILE_FLAGS)
+              if(const char *cflags = (*sf)->GetProperty("COMPILE_FLAGS"))
+                {
+                cmake_flags += cflags;
+                cmake_flags += " ";
+                }
+              vars.Flags = cmake_flags.c_str();
+              this->ExpandRuleVariables(cmake_compile_line, vars);
+              // Now split up the command for insertion into the cmCustomCommandLine object
+              std::stringstream ss(cmake_compile_line);
+              std::string item;
+              while(std::getline(ss, item, ' '))
+                {
+                line.push_back(item);
+                }
+              lines.push_back(line);
+
+              // Set the comment
+              std::string comment = "Building ";
+              comment += sflang;
+              comment += " object ";
+              comment += outfilebase;
+              comment += "...";
+
+              // Set the working directory
+              std::string workingdir;
+
+              // Build the command object and store it in the multiconfig map
+              cmCustomCommand *cmd = new cmCustomCommand(outfiles, (*sf)->GetDepends(), lines, comment.c_str(), workingdir.c_str());
+              (*commands)[*config] = cmd;
+              }
+
+            // Store the completed multiconfig map in the source file
+            (*sf)->SetMultiConfigCustomCommand(commands);
+            }
+          }
+        }
+        break; 
+      default:
+        break;
+      }
+    }
+}
+
 // TODO
 // for CommandLine= need to repleace quotes with &quot
 // write out configurations
@@ -1413,7 +1550,11 @@
       // Tell MS-Dev what the source is.  If the compiler knows how to
       // build it, then it will.
       fout << "\t\t\t\tRelativePath=\"" << d << "\">\n";
-      if(cmCustomCommand const* command = (*sf)->GetCustomCommand())
+      if(cmMultiConfigCustomCommand const* commands = (*sf)->GetMultiConfigCustomCommand())
+        {
+        this->WriteMultiConfigCustomRule(fout, source.c_str(), *commands, fcinfo);
+        }
+      else if(cmCustomCommand const* command = (*sf)->GetCustomCommand())
         {
         this->WriteCustomRule(fout, source.c_str(), *command, fcinfo);
         }
@@ -1514,8 +1655,25 @@
                 const cmCustomCommand& command,
                 FCInfo& fcinfo)
 {
-  std::string comment = this->ConstructComment(command);
-  
+  // Build a multiconfig map from the command and call the multiconfig version
+  std::vector<std::string>::iterator i;
+  std::vector<std::string> *configs =
+    static_cast<cmGlobalVisualStudio7Generator *>
+    (this->GlobalGenerator)->GetConfigurations();
+  cmMultiConfigCustomCommand commands;
+  for(i = configs->begin(); i != configs->end(); ++i)
+    {
+    commands[*i] = &command;
+    }
+  this->WriteMultiConfigCustomRule(fout, source, commands, fcinfo);
+}
+
+void cmLocalVisualStudio7Generator::
+WriteMultiConfigCustomRule(std::ostream& fout,
+                           const char* source,
+                           const cmMultiConfigCustomCommand& commands,
+                           FCInfo& fcinfo)
+{
   // Write the rule for each configuration.
   std::vector<std::string>::iterator i;
   std::vector<std::string> *configs =
@@ -1533,6 +1691,8 @@
     }
   for(i = configs->begin(); i != configs->end(); ++i)
     {
+    const cmCustomCommand *command = commands.find(*i)->second;
+    std::string comment = this->ConstructComment(*command);
     cmLVS7GFileConfig const& fc = fcinfo.FileConfigMap[*i];
     fout << "\t\t\t\t<FileConfiguration\n";
     fout << "\t\t\t\t\tName=\"" << *i << "|" << this->PlatformName << "\">\n";
@@ -1545,11 +1705,11 @@
       }
 
     std::string script = 
-      this->ConstructScript(command.GetCommandLines(),
-                            command.GetWorkingDirectory(),
+      this->ConstructScript(command->GetCommandLines(),
+                            command->GetWorkingDirectory(),
                             i->c_str(),
-                            command.GetEscapeOldStyle(),
-                            command.GetEscapeAllowMakeVars());
+                            command->GetEscapeOldStyle(),
+                            command->GetEscapeAllowMakeVars());
     fout << "\t\t\t\t\t<Tool\n"
          << "\t\t\t\t\tName=\"" << customTool << "\"\n"
          << "\t\t\t\t\tDescription=\"" 
@@ -1557,7 +1717,7 @@
          << "\t\t\t\t\tCommandLine=\"" 
          << this->EscapeForXML(script.c_str()) << "\"\n"
          << "\t\t\t\t\tAdditionalDependencies=\"";
-    if(command.GetDepends().empty())
+    if(command->GetDepends().empty())
       {
       // There are no real dependencies.  Produce an artificial one to
       // make sure the rule runs reliably.
@@ -1572,8 +1732,8 @@
       {
       // Write out the dependencies for the rule.
       for(std::vector<std::string>::const_iterator d = 
-          command.GetDepends().begin();
-          d != command.GetDepends().end(); 
+          command->GetDepends().begin();
+          d != command->GetDepends().end(); 
           ++d)
         {
         // Get the real name of the dependency in case it is a CMake target.
@@ -1584,7 +1744,7 @@
       }
     fout << "\"\n";
     fout << "\t\t\t\t\tOutputs=\"";
-    if(command.GetOutputs().empty())
+    if(command->GetOutputs().empty())
       {
       fout << source << "_force";
       }
@@ -1593,8 +1753,8 @@
       // Write a rule for the output generated by this command.
       const char* sep = "";
       for(std::vector<std::string>::const_iterator o = 
-          command.GetOutputs().begin(); 
-          o != command.GetOutputs().end(); 
+          command->GetOutputs().begin(); 
+          o != command->GetOutputs().end(); 
           ++o)
         {
         fout << sep << this->ConvertToXMLOutputPathSingle(o->c_str());
diff -ur cmake-2.8.0.orig/Source/cmLocalVisualStudio7Generator.h cmake-2.8.0.vs_asm/Source/cmLocalVisualStudio7Generator.h
--- cmake-2.8.0.orig/Source/cmLocalVisualStudio7Generator.h	2009-11-13 10:32:57.000000000 -0800
+++ cmake-2.8.0.vs_asm/Source/cmLocalVisualStudio7Generator.h	2010-02-19 16:09:07.000000000 -0800
@@ -20,6 +20,7 @@
 class cmCustomCommand;
 class cmSourceGroup;
 
+typedef std::map<std::string, const cmCustomCommand *> cmMultiConfigCustomCommand;
 
 class cmLocalVisualStudio7GeneratorOptions;
 class cmLocalVisualStudio7GeneratorFCInfo;
@@ -81,6 +82,7 @@
   std::string GetBuildTypeLinkerFlags(std::string rootLinkerFlags,
                                       const char* configName);
   void FixGlobalTargets();
+  void FixObjectCommands(std::set<cmStdString> const& lang);
   void WriteProjectFiles();
   void WriteVCProjHeader(std::ostream& fout, const char *libName,
                          cmTarget &tgt, std::vector<cmSourceGroup> &sgs);
@@ -115,6 +117,10 @@
                        const char* source,
                        const cmCustomCommand& command,
                        FCInfo& fcinfo);
+  void WriteMultiConfigCustomRule(std::ostream& fout,
+                                  const char* source,
+                                  const cmMultiConfigCustomCommand& commands,
+                                  FCInfo& fcinfo);
   void WriteTargetVersionAttribute(std::ostream& fout, cmTarget& target);
 
   void WriteGroup(const cmSourceGroup *sg, 
diff -ur cmake-2.8.0.orig/Source/cmSourceFile.cxx cmake-2.8.0.vs_asm/Source/cmSourceFile.cxx
--- cmake-2.8.0.orig/Source/cmSourceFile.cxx	2009-11-13 10:32:58.000000000 -0800
+++ cmake-2.8.0.vs_asm/Source/cmSourceFile.cxx	2010-02-19 16:08:49.000000000 -0800
@@ -22,6 +22,7 @@
   Location(mf, name)
 {
   this->CustomCommand = 0;
+  this->MultiConfigCustomCommand = 0;
   this->Properties.SetCMakeInstance(mf->GetCMakeInstance());
   this->FindFullPathFailed = false;
 }
@@ -30,6 +31,7 @@
 cmSourceFile::~cmSourceFile()
 {
   this->SetCustomCommand(0);
+  this->SetMultiConfigCustomCommand(0);
 }
 
 //----------------------------------------------------------------------------
@@ -369,6 +371,34 @@
 }
 
 //----------------------------------------------------------------------------
+cmMultiConfigCustomCommand* cmSourceFile::GetMultiConfigCustomCommand()
+{
+  return this->MultiConfigCustomCommand;
+}
+
+//----------------------------------------------------------------------------
+cmMultiConfigCustomCommand const* cmSourceFile::GetMultiConfigCustomCommand() const
+{
+  return this->MultiConfigCustomCommand;
+}
+
+//----------------------------------------------------------------------------
+void cmSourceFile::SetMultiConfigCustomCommand(cmMultiConfigCustomCommand *ccs)
+{
+  cmMultiConfigCustomCommand* old = this->MultiConfigCustomCommand;
+  this->MultiConfigCustomCommand = ccs;
+  if(old != 0)
+    {
+    for(cmMultiConfigCustomCommand::iterator i = old->begin(); i != old->end(); i++)
+      {
+      delete i->second;
+      }
+    delete old;
+    }
+}
+
+
+//----------------------------------------------------------------------------
 void cmSourceFile::DefineProperties(cmake *cm)
 {
   // define properties
diff -ur cmake-2.8.0.orig/Source/cmSourceFile.h cmake-2.8.0.vs_asm/Source/cmSourceFile.h
--- cmake-2.8.0.orig/Source/cmSourceFile.h	2009-11-13 10:32:58.000000000 -0800
+++ cmake-2.8.0.vs_asm/Source/cmSourceFile.h	2010-02-19 15:47:25.000000000 -0800
@@ -41,6 +41,9 @@
   cmCustomCommand* GetCustomCommand();
   cmCustomCommand const* GetCustomCommand() const;
   void SetCustomCommand(cmCustomCommand *cc);
+  cmMultiConfigCustomCommand* GetMultiConfigCustomCommand();
+  cmMultiConfigCustomCommand const* GetMultiConfigCustomCommand() const;
+  void SetMultiConfigCustomCommand(cmMultiConfigCustomCommand *ccs);
 
   ///! Set/Get a property of this source file
   void SetProperty(const char *prop, const char *value);
@@ -103,6 +106,7 @@
   cmSourceFileLocation Location;
   cmPropertyMap Properties;
   cmCustomCommand* CustomCommand;
+  cmMultiConfigCustomCommand *MultiConfigCustomCommand;
   std::string Extension;
   std::string Language;
   std::string FullPath;
