summaryrefslogtreecommitdiffstats
path: root/Source/cmVisualStudio10TargetGenerator.cxx
diff options
context:
space:
mode:
authorEugene Golushkov <eugene_gff@ukr.net>2012-02-03 14:07:12 (GMT)
committerBrad King <brad.king@kitware.com>2012-02-03 14:26:24 (GMT)
commit9e01aefd24cd23878bd88c2f3cae62b5e28802b0 (patch)
treef3846f38c1d3ce11be4d98d4b9960e6d9598589e /Source/cmVisualStudio10TargetGenerator.cxx
parentbb29f2765c0cd752c97862c6eb81975afdcdaed1 (diff)
downloadCMake-9e01aefd24cd23878bd88c2f3cae62b5e28802b0.zip
CMake-9e01aefd24cd23878bd88c2f3cae62b5e28802b0.tar.gz
CMake-9e01aefd24cd23878bd88c2f3cae62b5e28802b0.tar.bz2
VS: Add support for WinRT project properties (#12930)
VS_WINRT_EXTENSIONS: Boolean property that correspond to "Enable Tailored Features" in Visual Studio 11 IDE. VS_WINRT_REFERENCES: Semicolon-delimited list of *.winmd references to add to the project, which creates a new <ItemGroup>.
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx38
1 files changed, 37 insertions, 1 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 449adc1..9193223 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -255,6 +255,7 @@ void cmVisualStudio10TargetGenerator::Generate()
this->WriteObjSources();
this->WriteCLSources();
this->WriteDotNetReferences();
+ this->WriteWinRTReferences();
this->WriteProjectReferences();
this->WriteString(
"<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\""
@@ -299,6 +300,36 @@ void cmVisualStudio10TargetGenerator::WriteDotNetReferences()
}
}
+void cmVisualStudio10TargetGenerator::WriteWinRTReferences()
+{
+ const char* vsWinRTReferences
+ = this->Target->GetProperty("VS_WINRT_REFERENCES");
+ if(vsWinRTReferences)
+ {
+ std::string references(vsWinRTReferences);
+ std::string::size_type position = 0;
+
+ this->WriteString("<ItemGroup>\n", 1);
+ while(references.length() > 0)
+ {
+ if((position = references.find(";")) == std::string::npos)
+ {
+ position = references.length() + 1;
+ }
+
+ this->WriteString("<Reference Include=\"", 2);
+ (*this->BuildFileStream) <<
+ cmVS10EscapeXML(references.substr(0, position)) << "\">\n";
+ this->WriteString("<IsWinMDFile>true</IsWinMDFile>\n", 3);
+ this->WriteString("</Reference>\n", 2);
+
+ references.erase(0, position + 1);
+ }
+
+ this->WriteString("</ItemGroup>\n", 1);
+ }
+}
+
// ConfigurationType Application, Utility StaticLibrary DynamicLibrary
void cmVisualStudio10TargetGenerator::WriteProjectConfigurations()
@@ -372,7 +403,8 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues()
this->WriteString(mfcLine.c_str(), 2);
if(this->Target->GetType() <= cmTarget::MODULE_LIBRARY &&
- this->ClOptions[*i]->UsingUnicode())
+ this->ClOptions[*i]->UsingUnicode() ||
+ this->Target->GetPropertyAsBool("VS_WINRT_EXTENSIONS"))
{
this->WriteString("<CharacterSet>Unicode</CharacterSet>\n", 2);
}
@@ -387,6 +419,10 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues()
pts += "</PlatformToolset>\n";
this->WriteString(pts.c_str(), 2);
}
+ if(this->Target->GetPropertyAsBool("VS_WINRT_EXTENSIONS"))
+ {
+ this->WriteString("<Immersive>true</Immersive>\n", 2);
+ }
this->WriteString("</PropertyGroup>\n", 1);
}
}