Merge topic 'vs-sdk-refs'

35a6cac2 VS: Add VS_SDK_REFERENCES target property to reference external SDKs
This commit is contained in:
Brad King
2016-06-23 08:59:26 -04:00
committed by CMake Topic Stage
5 changed files with 37 additions and 1 deletions
+21 -1
View File
@@ -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);
}
}