MCPcopy Create free account
hub / github.com/Kitware/CMake / WriteSDKReferences

Method WriteSDKReferences

Source/cmVisualStudio10TargetGenerator.cxx:5209–5251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5207}
5208
5209void cmVisualStudio10TargetGenerator::WriteSDKReferences(Elem& e0)
5210{
5211 cmList sdkReferences;
5212 std::unique_ptr<Elem> spe1;
5213 if (cmValue vsSDKReferences =
5214 this->GeneratorTarget->GetProperty("VS_SDK_REFERENCES")) {
5215 sdkReferences.assign(*vsSDKReferences);
5216 spe1 = cm::make_unique<Elem>(e0, "ItemGroup");
5217 for (auto const& ri : sdkReferences) {
5218 Elem(*spe1, "SDKReference").Attribute("Include", ri);
5219 }
5220 }
5221
5222 // This only applies to Windows 10 apps
5223 if (this->GlobalGenerator->TargetsWindowsStore() &&
5224 cmHasLiteralPrefix(this->GlobalGenerator->GetSystemVersion(), "10.0")) {
5225 cmValue desktopExtensionsVersion =
5226 this->GeneratorTarget->GetProperty("VS_DESKTOP_EXTENSIONS_VERSION");
5227 cmValue mobileExtensionsVersion =
5228 this->GeneratorTarget->GetProperty("VS_MOBILE_EXTENSIONS_VERSION");
5229 cmValue iotExtensionsVersion =
5230 this->GeneratorTarget->GetProperty("VS_IOT_EXTENSIONS_VERSION");
5231
5232 if (desktopExtensionsVersion || mobileExtensionsVersion ||
5233 iotExtensionsVersion) {
5234 if (!spe1) {
5235 spe1 = cm::make_unique<Elem>(e0, "ItemGroup");
5236 }
5237 if (desktopExtensionsVersion) {
5238 this->WriteSingleSDKReference(*spe1, "WindowsDesktop",
5239 *desktopExtensionsVersion);
5240 }
5241 if (mobileExtensionsVersion) {
5242 this->WriteSingleSDKReference(*spe1, "WindowsMobile",
5243 *mobileExtensionsVersion);
5244 }
5245 if (iotExtensionsVersion) {
5246 this->WriteSingleSDKReference(*spe1, "WindowsIoT",
5247 *iotExtensionsVersion);
5248 }
5249 }
5250 }
5251}
5252
5253void cmVisualStudio10TargetGenerator::WriteSingleSDKReference(
5254 Elem& e1, std::string const& extension, std::string const& version)

Callers 1

Calls 7

ElemClass · 0.85
cmHasLiteralPrefixFunction · 0.85
assignMethod · 0.80
AttributeMethod · 0.80
TargetsWindowsStoreMethod · 0.80
GetPropertyMethod · 0.45

Tested by

no test coverage detected