qmake/generators/win32/msbuild_objectmodel.cpp
changeset 33 3e2da88830cd
parent 30 5dc02b23752f
child 37 758a864f9613
--- a/qmake/generators/win32/msbuild_objectmodel.cpp	Tue Jul 06 15:10:48 2010 +0300
+++ b/qmake/generators/win32/msbuild_objectmodel.cpp	Wed Aug 18 10:37:55 2010 +0300
@@ -2656,6 +2656,14 @@
 
                     xml << tag("ClCompile")
                         << attrTag("Include",Option::fixPathToLocalOS(filename));
+                } else if(filename.endsWith(".res")) {
+
+                    xmlFilter << tag("CustomBuild")
+                              << attrTag("Include",Option::fixPathToLocalOS(filename))
+                              << attrTagS("Filter", filtername);
+
+                    xml << tag("CustomBuild")
+                        << attrTag("Include",Option::fixPathToLocalOS(filename));
                 } else {
 
                     xmlFilter << tag("CustomBuild")
@@ -2665,6 +2673,16 @@
                     xml << tag("CustomBuild")
                         << attrTag("Include",Option::fixPathToLocalOS(filename));
                 }
+            } else if(filtername == "Root Files") {
+
+                if (filename.endsWith(".rc")) {
+
+                    xmlFilter << tag("ResourceCompile")
+                              << attrTag("Include",Option::fixPathToLocalOS(filename));
+
+                    xml << tag("ResourceCompile")
+                        << attrTag("Include",Option::fixPathToLocalOS(filename));
+                }
             }
         }
 
@@ -2696,8 +2714,6 @@
                     << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg((*Config).Name))
                     << valueTag(CompilerTool.PrecompiledHeader);
             }
-
-            //xml << CompilerTool;
         }
     }
 
@@ -3023,6 +3039,14 @@
 
                 xml << tag("ClCompile")
                     << attrTag("Include",Option::fixPathToLocalOS(info.file));
+            } else if(info.file.endsWith(".res")) {
+
+                    xmlFilter << tag("CustomBuild")
+                              << attrTag("Include",Option::fixPathToLocalOS(info.file))
+                              << attrTagS("Filter", filtername);
+
+                    xml << tag("CustomBuild")
+                        << attrTag("Include",Option::fixPathToLocalOS(info.file));
             } else {
 
                 xmlFilter << tag("CustomBuild")
@@ -3033,6 +3057,16 @@
                     << attrTag("Include",Option::fixPathToLocalOS(info.file));
             }
 
+        } else if(filtername == "Root Files") {
+
+            if (info.file.endsWith(".rc")) {
+
+                xmlFilter << tag("ResourceCompile")
+                          << attrTag("Include",Option::fixPathToLocalOS(info.file));
+
+                xml << tag("ResourceCompile")
+                    << attrTag("Include",Option::fixPathToLocalOS(info.file));
+            }
         } else {
 
             xmlFilter << tag("None")
@@ -3329,6 +3363,7 @@
     for (int x = 0; x < tool.ExtraCompilers.count(); ++x) {
         tool.outputFilter(xml, xmlFilter, tool.ExtraCompilers.at(x));
     }
+    tool.outputFilter(xml, xmlFilter, "Root Files");
 
     xml << import("Project", "$(VCTargetsPath)\\Microsoft.Cpp.targets");