Merge topic 'vs-TargetFrameworkVersion'

cfe6300 VS: Add support for .NET target framework version
This commit is contained in:
Brad King 2013-06-24 08:37:14 -04:00 committed by CMake Topic Stage
commit 64d14d3ddd
2 changed files with 12 additions and 0 deletions

View File

@ -1402,6 +1402,11 @@ void cmTarget::DefineProperties(cmake *cm)
"Visual Studio project root namespace.",
"Sets the \"RootNamespace\" attribute for a generated Visual Studio "
"project. The attribute will be generated only if this is set.");
cm->DefineProperty
("VS_DOTNET_TARGET_FRAMEWORK_VERSION", cmProperty::TARGET,
"Specify the .NET target framework version.",
"Used to specify the .NET target framework version for C++/CLI. "
"For example, \"v4.5\".");
cm->DefineProperty
("VS_DOTNET_REFERENCES", cmProperty::TARGET,
"Visual Studio managed project .NET references",

View File

@ -280,6 +280,13 @@ void cmVisualStudio10TargetGenerator::Generate()
}
this->WriteString("<ProjectName>", 2);
(*this->BuildFileStream) << projLabel << "</ProjectName>\n";
if(const char* targetFrameworkVersion = this->Target->GetProperty(
"VS_DOTNET_TARGET_FRAMEWORK_VERSION"))
{
this->WriteString("<TargetFrameworkVersion>", 2);
(*this->BuildFileStream) << targetFrameworkVersion
<< "</TargetFrameworkVersion>\n";
}
this->WriteString("</PropertyGroup>\n", 1);
this->WriteString("<Import Project="
"\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n",