[Cmake-commits] CMake branch, next, updated. v3.6.0-rc2-448-g22c6146

Brad King brad.king at kitware.com
Mon Jun 20 10:42:37 EDT 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  22c6146d55d52bffaea126e1c439f124e502ae4d (commit)
       via  ccc6270df9842666d1b679c002e63eb073641466 (commit)
      from  6f8e4c7361a20da3e73c60c93f3c63753923205d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=22c6146d55d52bffaea126e1c439f124e502ae4d
commit 22c6146d55d52bffaea126e1c439f124e502ae4d
Merge: 6f8e4c7 ccc6270
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Jun 20 10:42:36 2016 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Jun 20 10:42:36 2016 -0400

    Merge topic 'vs-sdk-refs' into next
    
    ccc6270d VS: Add VS_SDK_REFERENCES target property to reference external SDKs


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ccc6270df9842666d1b679c002e63eb073641466
commit ccc6270df9842666d1b679c002e63eb073641466
Author:     Gilles Khouzam <gillesk at microsoft.com>
AuthorDate: Fri Jun 17 14:18:39 2016 -0700
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Jun 20 10:41:01 2016 -0400

    VS: Add VS_SDK_REFERENCES target property to reference external SDKs
    
    Allow one to specify external SDK references such as
    `Microsoft.AdMediatorWindows81, Version=1.0`.

diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index f082518..bdd8c1b 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -276,6 +276,7 @@ Properties on Targets
    /prop_tgt/VS_SCC_LOCALPATH
    /prop_tgt/VS_SCC_PROJECTNAME
    /prop_tgt/VS_SCC_PROVIDER
+   /prop_tgt/VS_SDK_REFERENCES
    /prop_tgt/VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION
    /prop_tgt/VS_WINRT_COMPONENT
    /prop_tgt/VS_WINRT_EXTENSIONS
diff --git a/Help/prop_tgt/VS_SDK_REFERENCES.rst b/Help/prop_tgt/VS_SDK_REFERENCES.rst
new file mode 100644
index 0000000..769a0d1
--- /dev/null
+++ b/Help/prop_tgt/VS_SDK_REFERENCES.rst
@@ -0,0 +1,7 @@
+VS_SDK_REFERENCES
+-----------------
+
+Visual Studio project SDK references.
+Specify a :ref:`;-list <CMake Language Lists>` of SDK references
+to be added to a generated Visual Studio project, e.g.
+``Microsoft.AdMediatorWindows81, Version=1.0``.
diff --git a/Help/release/dev/vs-sdk-refs.rst b/Help/release/dev/vs-sdk-refs.rst
new file mode 100644
index 0000000..55232e3
--- /dev/null
+++ b/Help/release/dev/vs-sdk-refs.rst
@@ -0,0 +1,5 @@
+vs-sdk-refs
+-----------
+
+* A :prop_tgt:`VS_SDK_REFERENCES` target property was added to tell
+  :ref:`Visual Studio Generators` to reference the named SDKs.
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);
     }
   }
diff --git a/Tests/VSWinStorePhone/CMakeLists.txt b/Tests/VSWinStorePhone/CMakeLists.txt
index ae82755..5429673 100644
--- a/Tests/VSWinStorePhone/CMakeLists.txt
+++ b/Tests/VSWinStorePhone/CMakeLists.txt
@@ -134,6 +134,9 @@ if("${SHORT_VERSION}" STREQUAL "10.0")
   set_property(TARGET ${EXE_NAME} PROPERTY VS_DESKTOP_EXTENSIONS_VERSION "${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
   set_property(TARGET ${EXE_NAME} PROPERTY VS_MOBILE_EXTENSIONS_VERSION "${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
   set_property(TARGET ${EXE_NAME} PROPERTY VS_IOT_EXTENSIONS_VERSION "${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
+
+  # Add a reference to an SDK
+  set_property(TARGET ${EXE_NAME} PROPERTY VS_SDK_REFERENCES "Microsoft.NET.Native.Runtime.1.1, Version=1.1")
 endif()
 
 

-----------------------------------------------------------------------

Summary of changes:
 Help/manual/cmake-properties.7.rst         |    1 +
 Help/prop_tgt/VS_SDK_REFERENCES.rst        |    7 +++++++
 Help/release/dev/vs-sdk-refs.rst           |    5 +++++
 Source/cmVisualStudio10TargetGenerator.cxx |   22 +++++++++++++++++++++-
 Tests/VSWinStorePhone/CMakeLists.txt       |    3 +++
 5 files changed, 37 insertions(+), 1 deletion(-)
 create mode 100644 Help/prop_tgt/VS_SDK_REFERENCES.rst
 create mode 100644 Help/release/dev/vs-sdk-refs.rst


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list