summaryrefslogtreecommitdiffstats
path: root/Source/cmVisualStudio10TargetGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx22
1 files changed, 21 insertions, 1 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 3b1cddb..6ab32bf 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -2643,6 +2643,20 @@ void cmVisualStudio10TargetGenerator::WriteSinglePlatformExtension(
void cmVisualStudio10TargetGenerator::WriteSDKReferences()
{
+ std::vector<std::string> sdkReferences;
+ bool hasWrittenItemGroup = false;
+ if (const char* vsSDKReferences =
+ this->GeneratorTarget->GetProperty("VS_SDK_REFERENCES")) {
+ cmSystemTools::ExpandListArgument(vsSDKReferences, sdkReferences);
+ this->WriteString("<ItemGroup>\n", 1);
+ hasWrittenItemGroup = true;
+ for (std::vector<std::string>::iterator ri = sdkReferences.begin();
+ ri != sdkReferences.end(); ++ri) {
+ this->WriteString("<SDKReference Include=\"", 2);
+ (*this->BuildFileStream) << cmVS10EscapeXML(*ri) << "\"/>\n";
+ }
+ }
+
// This only applies to Windows 10 apps
if (this->GlobalGenerator->TargetsWindowsStore() &&
cmHasLiteralPrefix(this->GlobalGenerator->GetSystemVersion(), "10.0")) {
@@ -2655,7 +2669,10 @@ void cmVisualStudio10TargetGenerator::WriteSDKReferences()
if (desktopExtensionsVersion || mobileExtensionsVersion ||
iotExtensionsVersion) {
- this->WriteString("<ItemGroup>\n", 1);
+ if (!hasWrittenItemGroup) {
+ this->WriteString("<ItemGroup>\n", 1);
+ hasWrittenItemGroup = true;
+ }
if (desktopExtensionsVersion) {
this->WriteSingleSDKReference("WindowsDesktop",
desktopExtensionsVersion);
@@ -2667,6 +2684,9 @@ void cmVisualStudio10TargetGenerator::WriteSDKReferences()
if (iotExtensionsVersion) {
this->WriteSingleSDKReference("WindowsIoT", iotExtensionsVersion);
}
+ }
+
+ if (hasWrittenItemGroup) {
this->WriteString("</ItemGroup>\n", 1);
}
}