diff -r b329241f1d77 Source/cmVisualStudio10TargetGenerator.cxx
--- a/Source/cmVisualStudio10TargetGenerator.cxx Fri Nov 08 22:22:20 2013 +0800
+++ b/Source/cmVisualStudio10TargetGenerator.cxx Sat Nov 09 22:59:32 2013 +0800
@@ -296,6 +296,11 @@
}
this->WriteString("", 2);
(*this->BuildFileStream) << projLabel << "\n";
+ if(this->Target->GetPropertyAsBool("VS_WINRT_EXTENSIONS"))
+ {
+ this->WriteString("true"
+ "\n", 2);
+ }
if(const char* targetFrameworkVersion = this->Target->GetProperty(
"VS_DOTNET_TARGET_FRAMEWORK_VERSION"))
{
@@ -956,6 +961,10 @@
}
this->ConvertToWindowsSlash(sourceFile);
this->WriteString("<", 2);
+ if (sf->GetExtension() == "appxmanifest")
+ {
+ tool = "AppxManifest";
+ }
(*this->BuildFileStream ) << tool << " Include=\"" << sourceFile << "\"";
if(sf->GetExtension() == "h" &&
@@ -967,7 +976,67 @@
}
else
{
- (*this->BuildFileStream ) << (end? end : " />\n");
+ std::vector deployment;
+ std::vector excluded;
+ bool addition_prop = false;
+ if (this->Target->GetPropertyAsBool("VS_WINRT_EXTENSIONS") &&
+ (0 == strcmp("None", tool)))
+ {
+ std::vector *configs =
+ static_cast
+ (this->GlobalGenerator)->GetConfigurations();
+ deployment.resize(configs->size(), false);
+ excluded.resize(configs->size(), false);
+ for (size_t i = 0; i != configs->size(); ++i)
+ {
+ std::string configUpper = cmSystemTools::UpperCase((*configs)[i]);
+ std::string defPropName = "COMPILE_DEFINITIONS_";
+ defPropName += configUpper;
+ const char* ccdefs = sf->GetProperty(defPropName.c_str());
+ if (ccdefs)
+ {
+ if (strcmp(ccdefs, "-DCONTENT") == 0)
+ {
+ deployment[i] = true;
+ addition_prop = true;
+ }
+ else if (strcmp(ccdefs, "-DEXCLUDED") == 0)
+ {
+ excluded[i] = true;
+ addition_prop = true;
+ }
+ }
+ }
+ }
+
+ if (addition_prop)
+ {
+ std::vector *configs =
+ static_cast
+ (this->GlobalGenerator)->GetConfigurations();
+
+ (*this->BuildFileStream) << ">\n";
+ for (size_t i = 0; i < configs->size(); ++i)
+ {
+ if (deployment[i])
+ {
+ this->WriteString("BuildFileStream) << (*configs)[i] << "|" << this->Platform << "'\">true";
+ this->WriteString("\n", 0);
+ }
+ else if (excluded[i])
+ {
+ this->WriteString("BuildFileStream) << (*configs)[i] << "|" << this->Platform << "'\">true";
+ this->WriteString("\n", 0);
+ }
+ }
+ this->WriteString("\n", 2);
+ }
+ else
+ {
+ (*this->BuildFileStream) << (end ? end : " />\n");
+ }
}
ToolSource toolSource = {sf, forceRelative};