diff options
author | Brad King <brad.king@kitware.com> | 2016-06-23 12:59:26 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-06-23 12:59:26 (GMT) |
commit | 015876fa810f45c560c1feb7f0b8092301304db8 (patch) | |
tree | 29b9fac1b658bb40b7b1b07ec295790214d20126 /Source | |
parent | f101d4eff3462acd90623ba801027d3e7b642fbd (diff) | |
parent | 35a6cac2d3bf550edf5306e6270a80fc848deeb8 (diff) | |
download | CMake-015876fa810f45c560c1feb7f0b8092301304db8.zip CMake-015876fa810f45c560c1feb7f0b8092301304db8.tar.gz CMake-015876fa810f45c560c1feb7f0b8092301304db8.tar.bz2 |
Merge topic 'vs-sdk-refs'
35a6cac2 VS: Add VS_SDK_REFERENCES target property to reference external SDKs
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 22 |
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); } } |