diff -r -u cmake-2.4.2/Source/cmLocalVisualStudio7Generator.cxx cmake-2.4.2-spd1/Source/cmLocalVisualStudio7Generator.cxx
--- cmake-2.4.2/Source/cmLocalVisualStudio7Generator.cxx	2006-05-16 17:07:42.000000000 +0200
+++ cmake-2.4.2-spd1/Source/cmLocalVisualStudio7Generator.cxx	2006-07-10 06:06:47.703125000 +0200
@@ -255,6 +255,8 @@
 cmVS7FlagTable cmLocalVisualStudio7GeneratorFlagTable[] =
 {
   // option flags (some flags map to the same option)
+  {"UsePrecompiledHeader", "Yc", "Create Precompiled Header",             "1"},
+  {"UsePrecompiledHeader", "Yu", "Use Precompiled Header",                "3"},
   {"BasicRuntimeChecks", "GZ", "Stack frame checks",                      "1"},
   {"BasicRuntimeChecks", "RTCsu", "Both stack and uninitialized checks", "3"},
   {"BasicRuntimeChecks", "RTCs", "Stack frame checks",                    "1"},
@@ -1031,6 +1033,10 @@
              std::ostream &fout, const char *libName, 
              std::vector<std::string> *configs)
 {
+  // create a map of xml tags to the values they should have in the output
+  // for example, "BufferSecurityCheck" = "TRUE"
+  std::map<cmStdString, cmStdString> flagMap;
+
   const std::vector<const cmSourceFile *> &sourceFiles =
     sg->GetSourceFiles();
   // If the group is empty, don't write it at all.
@@ -1094,6 +1100,12 @@
         compileFlags += " /TC ";
         }
       }
+	  // now fill the flagMap from the command line flags, and
+	  // if a flag is used, it will be removed from the flags string by
+	  // this function call
+	  this->FillFlagMapFromCommandFlags
+		  (flagMap, &cmLocalVisualStudio7GeneratorFlagTable[0], compileFlags);
+
     // Check for extra object-file dependencies.
     const char* deps = (*sf)->GetProperty("OBJECT_DEPENDS");
     if(deps)
@@ -1157,6 +1169,14 @@
                << "|" << this->PlatformName << "\">\n"
                << "\t\t\t\t\t<Tool\n"
                << "\t\t\t\t\tName=\"" << aCompilerTool << "\"\n";
+
+		  // Now copy the flag map into the xml for the file
+		  for(std::map<cmStdString, cmStdString>::iterator m = flagMap.begin();
+			  m != flagMap.end(); ++m)
+		  {
+			  fout << "\t\t\t\t\t" << m->first << "=\"" << m->second << "\"\n";
+		  }
+
           if(compileFlags.size())
             {
             fout << "\t\t\t\t\tAdditionalOptions=\""
