mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-05 05:39:57 -05:00
Merge topic 'vs-sdk-refs'
35a6cac2 VS: Add VS_SDK_REFERENCES target property to reference external SDKs
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user