summaryrefslogtreecommitdiffstats
path: root/qmake/generators/win32/msbuild_objectmodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qmake/generators/win32/msbuild_objectmodel.cpp')
-rw-r--r--qmake/generators/win32/msbuild_objectmodel.cpp63
1 files changed, 51 insertions, 12 deletions
diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp
index d1420e95f6..75d3c4fa9c 100644
--- a/qmake/generators/win32/msbuild_objectmodel.cpp
+++ b/qmake/generators/win32/msbuild_objectmodel.cpp
@@ -614,12 +614,16 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool)
<< tag("ItemGroup")
<< attrTag("Label", "ProjectConfigurations");
+ bool isWinRT = false;
+ bool isPhone = false;
for (int i = 0; i < tool.SingleProjects.count(); ++i) {
xml << tag("ProjectConfiguration")
<< attrTag("Include" , tool.SingleProjects.at(i).Configuration.Name)
<< tagValue("Configuration", tool.SingleProjects.at(i).Configuration.ConfigurationName)
<< tagValue("Platform", tool.SingleProjects.at(i).PlatformName)
<< closetag();
+ isWinRT = isWinRT || tool.SingleProjects.at(i).Configuration.WinRT;
+ isPhone = isPhone || tool.SingleProjects.at(i).Configuration.WinPhone;
}
xml << closetag()
@@ -629,18 +633,19 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool)
<< tagValue("RootNamespace", tool.Name)
<< tagValue("Keyword", tool.Keyword);
- if (tool.SingleProjects.at(0).Configuration.WinRT) {
- xml << tagValue("MinimumVisualStudioVersion", "11.0");
- if (tool.SingleProjects.at(0).Configuration.WinPhone)
+ if (isWinRT) {
+ xml << tagValue("MinimumVisualStudioVersion", tool.Version);
+ if (isPhone) {
xml << tagValue("WinMDAssembly", "true");
- else
- xml << tagValue("AppContainerApplication", "true");
- }
-
- if (tool.SingleProjects.at(0).Configuration.WinPhone
- && tool.SingleProjects.at(0).Configuration.ConfigurationType == typeApplication) {
- xml << tagValue("XapOutputs", "true");
- xml << tagValue("XapFilename", "$(RootNamespace)_$(Configuration)_$(Platform).xap");
+ if (tool.SingleProjects.at(0).Configuration.ConfigurationType == typeApplication) {
+ xml << tagValue("XapOutputs", "true");
+ xml << tagValue("XapFilename", "$(RootNamespace)_$(Configuration)_$(Platform).xap");
+ }
+ } else {
+ xml << tagValue("AppContainerApplication", "true")
+ << tagValue("ApplicationType", "Windows Store")
+ << tagValue("ApplicationTypeRevision", tool.SdkVersion);
+ }
}
xml << closetag();
@@ -824,9 +829,43 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool)
<< closetag();
}
+ // App manifest
+ if (isWinRT) {
+ QString manifest = isPhone ? QStringLiteral("WMAppManifest.xml") : QStringLiteral("Package.appxmanifest");
+
+ // Find all icons referenced in the manifest
+ QSet<QString> icons;
+ QFile manifestFile(manifest);
+ if (manifestFile.open(QFile::ReadOnly)) {
+ const QString contents = manifestFile.readAll();
+ QRegExp regexp("[\\\\/a-zA-Z0-9_\\-\\!]*\\.(png|jpg|jpeg)");
+ int pos = 0;
+ while (pos > -1) {
+ pos = regexp.indexIn(contents, pos);
+ if (pos >= 0) {
+ const QString match = regexp.cap(0);
+ icons.insert(match);
+ pos += match.length();
+ }
+ }
+ }
+
+ // Write out manifest + icons as content items
+ xml << tag(_ItemGroup)
+ << tag(isPhone ? "Xml" : "AppxManifest")
+ << attrTag("Include", manifest)
+ << closetag();
+ foreach (const QString &icon, icons) {
+ xml << tag("Image")
+ << attrTag("Include", icon)
+ << closetag();
+ }
+ xml << closetag();
+ }
+
xml << import("Project", "$(VCTargetsPath)\\Microsoft.Cpp.targets");
- if (tool.SingleProjects.at(0).Configuration.WinPhone)
+ if (isPhone)
xml << import("Project", "$(MSBuildExtensionsPath)\\Microsoft\\WindowsPhone\\v8.0\\Microsoft.Cpp.WindowsPhone.8.0.targets");
xml << tag("ImportGroup")