VS: Generate WindowsPhone and WindowsStore application types

Generate the ApplicationType and ApplicationTypeRevision elements in
.vcxproj files.
This commit is contained in:
Gilles Khouzam 2014-07-31 13:22:35 -04:00 committed by Brad King
parent 72395ab23e
commit 709cebde66
2 changed files with 23 additions and 0 deletions

View File

@ -286,6 +286,11 @@ void cmVisualStudio10TargetGenerator::Generate()
this->WriteString("<ProjectGUID>", 2);
(*this->BuildFileStream) << "{" << this->GUID << "}</ProjectGUID>\n";
if(this->MSTools && this->Target->GetType() <= cmTarget::UTILITY)
{
this->WriteApplicationTypeSettings();
}
const char* vsProjectTypes =
this->Target->GetProperty("VS_GLOBAL_PROJECT_TYPES");
if(vsProjectTypes)
@ -2100,3 +2105,20 @@ bool cmVisualStudio10TargetGenerator::
expectedResxHeaders.find(headerFile);
return it != expectedResxHeaders.end();
}
void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings()
{
bool const isWindowsPhone = this->GlobalGenerator->TargetsWindowsPhone();
bool const isWindowsStore = this->GlobalGenerator->TargetsWindowsStore();
std::string const& v = this->GlobalGenerator->GetSystemVersion();
if(isWindowsPhone || isWindowsStore)
{
this->WriteString("<ApplicationType>", 2);
(*this->BuildFileStream) << (isWindowsPhone ?
"Windows Phone" : "Windows Store")
<< "</ApplicationType>\n";
this->WriteString("<ApplicationTypeRevision>", 2);
(*this->BuildFileStream) << cmVS10EscapeXML(v)
<< "</ApplicationTypeRevision>\n";
}
}

View File

@ -91,6 +91,7 @@ private:
void WriteCustomCommand(cmSourceFile const* sf);
void WriteGroups();
void WriteProjectReferences();
void WriteApplicationTypeSettings();
bool OutputSourceSpecificFlags(cmSourceFile const* source);
void AddLibraries(cmComputeLinkInformation& cli,
std::vector<std::string>& libVec);