From 5a078e488c2b8bc65dbe84cfb8eedd43ca0b2e41 Mon Sep 17 00:00:00 2001
From: Gilles Khouzam <gillesk@microsoft.com>
Date: Thu, 10 Sep 2015 09:30:34 -0700
Subject: [PATCH] Adding Windows 10 Support.

---
 Help/manual/cmake-properties.7.rst                 |   6 +
 Help/prop_sf/VS_TOOL_OVERRIDE.rst                  |   5 +
 Help/prop_tgt/VS_DESKTOP_EXTENSIONS_VERSION.rst    |   8 +
 Help/prop_tgt/VS_IOT_EXTENSIONS_VERSION.rst        |   8 +
 Help/prop_tgt/VS_IOT_STARTUP_TASK.rst              |   6 +
 Help/prop_tgt/VS_MOBILE_EXTENSIONS_VERSION.rst     |   8 +
 Help/prop_tgt/VS_TARGET_PLATFORM_MIN_VERSION.rst   |   8 +
 Help/prop_tgt/VS_TARGET_PLATFORM_VERSION.rst       |   8 +
 Modules/CMakeDetermineCompilerId.cmake             |   3 +
 Modules/CompilerId/VS-10.vcxproj.in                |   1 +
 Modules/Platform/Windows-MSVC.cmake                |   5 +-
 Source/CMakeLists.txt                              |  13 +-
 Source/QtDialog/CMakeLists.txt                     |   2 +-
 Source/cmGeneratorTarget.cxx                       |  14 ++
 Source/cmGeneratorTarget.h                         |   2 +
 Source/cmGlobalVisualStudio14Generator.cxx         | 145 ++++++++++++
 Source/cmGlobalVisualStudio14Generator.h           |  11 +-
 Source/cmTarget.cxx                                |   1 +
 Source/cmVisualStudio10TargetGenerator.cxx         | 258 ++++++++++++++++++++-
 Source/cmVisualStudio10TargetGenerator.h           |   8 +
 Source/cmake.version.manifest                      |  18 ++
 Tests/CMakeLists.txt                               |   9 +-
 Tests/VSWinStorePhone/CMakeLists.txt               |  19 +-
 .../Direct3DApp1/Strings/en-US/Resources.resw      | 123 ++++++++++
 .../cmake/Package_vc14.store.appxmanifest.in       |  36 +++
 25 files changed, 706 insertions(+), 19 deletions(-)
 create mode 100644 Help/prop_sf/VS_TOOL_OVERRIDE.rst
 create mode 100644 Help/prop_tgt/VS_DESKTOP_EXTENSIONS_VERSION.rst
 create mode 100644 Help/prop_tgt/VS_IOT_EXTENSIONS_VERSION.rst
 create mode 100644 Help/prop_tgt/VS_IOT_STARTUP_TASK.rst
 create mode 100644 Help/prop_tgt/VS_MOBILE_EXTENSIONS_VERSION.rst
 create mode 100644 Help/prop_tgt/VS_TARGET_PLATFORM_MIN_VERSION.rst
 create mode 100644 Help/prop_tgt/VS_TARGET_PLATFORM_VERSION.rst
 create mode 100644 Source/cmake.version.manifest
 create mode 100644 Tests/VSWinStorePhone/Direct3DApp1/Strings/en-US/Resources.resw
 create mode 100644 Tests/VSWinStorePhone/cmake/Package_vc14.store.appxmanifest.in

diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index ac893c2..421ca71 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -254,17 +254,23 @@ Properties on Targets
    /prop_tgt/TYPE
    /prop_tgt/VERSION
    /prop_tgt/VISIBILITY_INLINES_HIDDEN
+   /prop_tgt/VS_DESKTOP_EXTENSIONS_VERSION
    /prop_tgt/VS_DOTNET_REFERENCES
    /prop_tgt/VS_DOTNET_TARGET_FRAMEWORK_VERSION
    /prop_tgt/VS_GLOBAL_KEYWORD
    /prop_tgt/VS_GLOBAL_PROJECT_TYPES
    /prop_tgt/VS_GLOBAL_ROOTNAMESPACE
    /prop_tgt/VS_GLOBAL_variable
+   /prop_tgt/VS_IOT_EXTENSIONS_VERSION
+   /prop_tgt/VS_IOT_STARTUP_TASK
    /prop_tgt/VS_KEYWORD
+   /prop_tgt/VS_MOBILE_EXTENSIONS_VERSION
    /prop_tgt/VS_SCC_AUXPATH
    /prop_tgt/VS_SCC_LOCALPATH
    /prop_tgt/VS_SCC_PROJECTNAME
    /prop_tgt/VS_SCC_PROVIDER
+   /prop_tgt/VS_TARGET_PLATFORM_MIN_VERSION
+   /prop_tgt/VS_TARGET_PLATFORM_VERSION
    /prop_tgt/VS_WINRT_COMPONENT
    /prop_tgt/VS_WINRT_EXTENSIONS
    /prop_tgt/VS_WINRT_REFERENCES
diff --git a/Help/prop_sf/VS_TOOL_OVERRIDE.rst b/Help/prop_sf/VS_TOOL_OVERRIDE.rst
new file mode 100644
index 0000000..7fe9075
--- /dev/null
+++ b/Help/prop_sf/VS_TOOL_OVERRIDE.rst
@@ -0,0 +1,5 @@
+VS_TOOL_OVERRIDE
+----------------
+
+Override the default Visual Studio tool that will be applied to the source file
+with a new tool not based on the extension of the file.
\ No newline at end of file
diff --git a/Help/prop_tgt/VS_DESKTOP_EXTENSIONS_VERSION.rst b/Help/prop_tgt/VS_DESKTOP_EXTENSIONS_VERSION.rst
new file mode 100644
index 0000000..29cd1cb
--- /dev/null
+++ b/Help/prop_tgt/VS_DESKTOP_EXTENSIONS_VERSION.rst
@@ -0,0 +1,8 @@
+VS_DESKTOP_EXTENSIONS_VERSION
+-----------------------------
+
+Visual Studio Windows 10 Desktop Extensions Version
+
+Specifies the version of the Desktop Extensions that should be included in the
+target. For example 1.0.10240.0. If the value is not specified, the Desktop
+Extensions will not be included.
diff --git a/Help/prop_tgt/VS_IOT_EXTENSIONS_VERSION.rst b/Help/prop_tgt/VS_IOT_EXTENSIONS_VERSION.rst
new file mode 100644
index 0000000..b63782e
--- /dev/null
+++ b/Help/prop_tgt/VS_IOT_EXTENSIONS_VERSION.rst
@@ -0,0 +1,8 @@
+VS_IOT_EXTENSIONS_VERSION
+-------------------------
+
+Visual Studio Windows 10 IoT Extensions Version
+
+Specifies the version of the IoT Extensions that should be included in the
+target. For example 1.0.10240.0. If the value is not specified, the IoT
+Extensions will not be included.
diff --git a/Help/prop_tgt/VS_IOT_STARTUP_TASK.rst b/Help/prop_tgt/VS_IOT_STARTUP_TASK.rst
new file mode 100644
index 0000000..add50cb
--- /dev/null
+++ b/Help/prop_tgt/VS_IOT_STARTUP_TASK.rst
@@ -0,0 +1,6 @@
+VS_IOT_STARTUP_TASK
+-------------------
+
+Visual Studio Windows 10 IoT Continuous Background Task
+
+Specifies that the target should be compiled as a Continuous Background Task library.
diff --git a/Help/prop_tgt/VS_MOBILE_EXTENSIONS_VERSION.rst b/Help/prop_tgt/VS_MOBILE_EXTENSIONS_VERSION.rst
new file mode 100644
index 0000000..dc4973a
--- /dev/null
+++ b/Help/prop_tgt/VS_MOBILE_EXTENSIONS_VERSION.rst
@@ -0,0 +1,8 @@
+VS_MOBILE_EXTENSIONS_VERSION
+----------------------------
+
+Visual Studio Windows 10 Mobile Extensions Version
+
+Specifies the version of the Mobile Extensions that should be included in the
+target. For example 1.0.10240.0. If the value is not specified, the Mobile
+Extensions will not be included.
diff --git a/Help/prop_tgt/VS_TARGET_PLATFORM_MIN_VERSION.rst b/Help/prop_tgt/VS_TARGET_PLATFORM_MIN_VERSION.rst
new file mode 100644
index 0000000..d93f276
--- /dev/null
+++ b/Help/prop_tgt/VS_TARGET_PLATFORM_MIN_VERSION.rst
@@ -0,0 +1,8 @@
+VS_TARGET_PLATFORM_MIN_VERSION
+------------------------------
+
+Visual Studio Target  Platform Minimum Version
+
+For Windows 10. Specifies the minimum version of the OS that is being
+targeted. For example 1.0.10135.0. If the value is not specified, the 
+target platform minimum version will not be specified for the project.
diff --git a/Help/prop_tgt/VS_TARGET_PLATFORM_VERSION.rst b/Help/prop_tgt/VS_TARGET_PLATFORM_VERSION.rst
new file mode 100644
index 0000000..3cd49b2
--- /dev/null
+++ b/Help/prop_tgt/VS_TARGET_PLATFORM_VERSION.rst
@@ -0,0 +1,8 @@
+VS_TARGET_PLATFORM_VERSION
+--------------------------
+
+Visual Studio Target Platform Version
+
+For Windows 10. Specifies the version of the OS that is being targeted.
+For example 1.0.10135.0. If the value is not specified, the target
+platform version will not be specified for the project.
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index c699315..3e0e3f2 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -198,6 +198,9 @@ Id flags: ${testflags}
     endif()
     if(id_system AND CMAKE_SYSTEM_VERSION)
       set(id_system_version "<ApplicationTypeRevision>${CMAKE_SYSTEM_VERSION}</ApplicationTypeRevision>")
+      if(CMAKE_SYSTEM_VERSION STREQUAL "10.0" AND CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
+        set(id_WindowsTargetPlatformVersion "<WindowsTargetPlatformVersion>${CMAKE_VS_TARGET_PLATFORM_VERSION}</WindowsTargetPlatformVersion>")
+      endif()
     else()
       set(id_system_version "")
     endif()
diff --git a/Modules/CompilerId/VS-10.vcxproj.in b/Modules/CompilerId/VS-10.vcxproj.in
index a17d03d..2870a11 100644
--- a/Modules/CompilerId/VS-10.vcxproj.in
+++ b/Modules/CompilerId/VS-10.vcxproj.in
@@ -12,6 +12,7 @@
     <Keyword>Win32Proj</Keyword>
     @id_system@
     @id_system_version@
+    @id_WindowsTargetPlatformVersion@
     @id_WindowsSDKDesktopARMSupport@
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake
index 94470c3..8c85b82 100644
--- a/Modules/Platform/Windows-MSVC.cmake
+++ b/Modules/Platform/Windows-MSVC.cmake
@@ -179,7 +179,10 @@ elseif(WINDOWS_PHONE OR WINDOWS_STORE)
   set(_PLATFORM_DEFINES "/DWIN32")
   set(_FLAGS_C " /DUNICODE /D_UNICODE")
   set(_FLAGS_CXX " /DUNICODE /D_UNICODE /GR /EHsc")
-  if(WINDOWS_PHONE)
+  if(WINDOWS_STORE AND MSVC_VERSION GREATER 1800)
+    # if WINDOWS_STORE, greater than MSVC 1800, then this is a Universal Application Platform project
+    set(CMAKE_C_STANDARD_LIBRARIES_INIT "MinCore.lib")
+  elseif(WINDOWS_PHONE)
     set(CMAKE_C_STANDARD_LIBRARIES_INIT "WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib")
   elseif(_MSVC_C_ARCHITECTURE_FAMILY STREQUAL "ARM" OR _MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "ARM")
     set(CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib")
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 16b9ea1..f909bdd 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -502,6 +502,11 @@ if (WIN32)
       cmGhsMultiGpj.cxx
       cmGhsMultiGpj.h
       )
+
+    # Add a manifest file to executables on Windows to allow for GetVersion
+    # to work properly on Windows 8 and above
+    set(MANIFEST_FILE cmake.version.manifest)
+
   endif()
 endif ()
 
@@ -531,7 +536,7 @@ set(SRCS ${SRCS}
 
 if(WIN32 AND NOT CYGWIN)
   set_source_files_properties(cmcldeps.cxx PROPERTIES COMPILE_DEFINITIONS _WIN32_WINNT=0x0501)
-  add_executable(cmcldeps cmcldeps.cxx)
+  add_executable(cmcldeps cmcldeps.cxx ${MANIFEST_FILE})
   target_link_libraries(cmcldeps CMakeLib)
   install(TARGETS cmcldeps DESTINATION bin)
 endif()
@@ -720,15 +725,15 @@ if(APPLE)
 endif()
 
 # Build CMake executable
-add_executable(cmake cmakemain.cxx cmcmd.cxx cmcmd.h)
+add_executable(cmake cmakemain.cxx cmcmd.cxx cmcmd.h ${MANIFEST_FILE})
 target_link_libraries(cmake CMakeLib)
 
 # Build CTest executable
-add_executable(ctest ctest.cxx)
+add_executable(ctest ctest.cxx ${MANIFEST_FILE})
 target_link_libraries(ctest CTestLib)
 
 # Build CPack executable
-add_executable(cpack CPack/cpack.cxx)
+add_executable(cpack CPack/cpack.cxx ${MANIFEST_FILE})
 target_link_libraries(cpack CPackLib)
 
 # Curses GUI
diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt
index ad6a7fb..5fb4431 100644
--- a/Source/QtDialog/CMakeLists.txt
+++ b/Source/QtDialog/CMakeLists.txt
@@ -155,7 +155,7 @@ endif()
 
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
 
-add_executable(cmake-gui WIN32 MACOSX_BUNDLE ${SRCS})
+add_executable(cmake-gui WIN32 MACOSX_BUNDLE ${SRCS} ${MANIFEST_FILE})
 target_link_libraries(cmake-gui CMakeLib ${QT_QTMAIN_LIBRARY} ${CMake_QT_LIBRARIES})
 if(Qt_BIN_DIR)
   set_property(TARGET cmake-gui PROPERTY Qt_BIN_DIR ${Qt_BIN_DIR})
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 09387b7..fb5805b 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -75,6 +75,7 @@ struct IDLSourcesTag {};
 struct ResxTag {};
 struct ModuleDefinitionFileTag {};
 struct AppManifestTag{};
+struct ManifestsTag{};
 struct CertificatesTag{};
 struct XamlTag{};
 
@@ -216,6 +217,10 @@ struct TagVisitor
       {
       DoAccept<IsSameTag<Tag, AppManifestTag>::Result>::Do(this->Data, sf);
       }
+    else if (ext == "manifest")
+      {
+      DoAccept<IsSameTag<Tag, ManifestsTag>::Result>::Do(this->Data, sf);
+      }
     else if (ext == "pfx")
       {
       DoAccept<IsSameTag<Tag, CertificatesTag>::Result>::Do(this->Data, sf);
@@ -626,6 +631,15 @@ cmGeneratorTarget
 //----------------------------------------------------------------------------
 void
 cmGeneratorTarget
+::GetManifests(std::vector<cmSourceFile const*>& data,
+               const std::string& config) const
+{
+  IMPLEMENT_VISIT(Manifests);
+}
+
+//----------------------------------------------------------------------------
+void
+cmGeneratorTarget
 ::GetCertificates(std::vector<cmSourceFile const*>& data,
                   const std::string& config) const
 {
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 06d9a1f..916f281 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -71,6 +71,8 @@ public:
                               const std::string& config) const;
   void GetAppManifest(std::vector<cmSourceFile const*>&,
                       const std::string& config) const;
+  void GetManifests(std::vector<cmSourceFile const*>&,
+                    const std::string& config) const;
   void GetCertificates(std::vector<cmSourceFile const*>&,
                        const std::string& config) const;
   void GetXamlSources(std::vector<cmSourceFile const*>&,
diff --git a/Source/cmGlobalVisualStudio14Generator.cxx b/Source/cmGlobalVisualStudio14Generator.cxx
index d73eedf..ccbb289 100644
--- a/Source/cmGlobalVisualStudio14Generator.cxx
+++ b/Source/cmGlobalVisualStudio14Generator.cxx
@@ -9,6 +9,10 @@
   implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the License for more information.
 ============================================================================*/
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#include "windows.h" // For Windows 10 SDK detection
+#endif
+
 #include "cmGlobalVisualStudio14Generator.h"
 #include "cmLocalVisualStudio10Generator.h"
 #include "cmMakefile.h"
@@ -111,6 +115,67 @@ cmGlobalVisualStudio14Generator::MatchesGeneratorName(
 }
 
 //----------------------------------------------------------------------------
+bool cmGlobalVisualStudio14Generator::InitializeWindowsStore(cmMakefile* mf)
+{
+  std::ostringstream  e;
+  if(!this->SelectWindowsStoreToolset(this->DefaultPlatformToolset))
+    {
+    if(this->DefaultPlatformToolset.empty())
+      {
+      e << this->GetName() << " supports Windows Store '8.0', '8.1' and "
+        "'10.0', but not '" << this->SystemVersion <<
+        "'.  Check CMAKE_SYSTEM_VERSION.";
+      }
+    else
+      {
+      e << "A Windows Store component with CMake requires both the Windows "
+        << "Desktop SDK as well as the Windows Store '" << this->SystemVersion
+        << "' SDK. Please make sure that you have both installed";
+      }
+    mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+    return false;
+    }
+  if (this->SystemVersion == "10.0")
+    {
+    // Find the default version of the Windows 10 SDK and set
+    // a default CMAKE_VS_TARGET_PLATFORM_VERSION
+    std::string sdkVersion = GetWindows10SDKVersion();
+    if(sdkVersion.empty())
+      {
+      e << "Could not find an appropriate version of the Windows 10 SDK"
+        << "installed on this machine";
+      mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+      return false;
+      }
+    mf->AddDefinition("CMAKE_VS_TARGET_PLATFORM_VERSION",
+      sdkVersion.c_str());
+    }
+  return true;
+}
+
+//----------------------------------------------------------------------------
+bool
+cmGlobalVisualStudio14Generator::SelectWindowsStoreToolset(
+  std::string& toolset) const
+{
+  if(this->SystemVersion == "10.0")
+    {
+    if (this->IsWindowsStoreToolsetInstalled() &&
+        this->IsWindowsDesktopToolsetInstalled())
+      {
+      toolset = "v140";
+      return true;
+      }
+    else
+      {
+      return false;
+      }
+    }
+  return
+    this->cmGlobalVisualStudio12Generator::SelectWindowsStoreToolset(toolset);
+}
+
+//----------------------------------------------------------------------------
 void cmGlobalVisualStudio14Generator::WriteSLNHeader(std::ostream& fout)
 {
   // Visual Studio 14 writes .sln format 12.00
@@ -137,3 +202,83 @@ cmGlobalVisualStudio14Generator::IsWindowsDesktopToolsetInstalled() const
   return cmSystemTools::GetRegistrySubKeys(desktop10Key,
     vc14, cmSystemTools::KeyWOW64_32);
 }
+
+//----------------------------------------------------------------------------
+bool
+cmGlobalVisualStudio14Generator::IsWindowsStoreToolsetInstalled() const
+{
+  const char universal10Key[] =
+    "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\"
+    "VisualStudio\\14.0\\Setup\\Build Tools for Windows 10;SrcPath";
+
+  std::string win10SDK;
+  return cmSystemTools::ReadRegistryValue(universal10Key,
+    win10SDK, cmSystemTools::KeyWOW64_32);
+}
+
+//----------------------------------------------------------------------------
+std::string cmGlobalVisualStudio14Generator::GetWindows10SDKVersion()
+{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+  // This logic is taken from the vcvarsqueryregistry.bat file from VS2015
+  std::string win10Root;
+  if (!cmSystemTools::ReadRegistryValue(
+    "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots;"
+    "KitsRoot10", win10Root, cmSystemTools::KeyWOW64_32))
+    {
+    // If we can't find the root in HKLM try HKCU
+    if (!cmSystemTools::ReadRegistryValue(
+      "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots;"
+      "KitsRoot10", win10Root, cmSystemTools::KeyWOW64_32))
+      {
+      return std::string();
+      }
+    }
+
+  std::vector<std::string> sdks;
+  std::string path = win10Root + "Include/*";
+  // Grab the paths of the different SDKs that are installed
+  cmSystemTools::GlobDirs(path, sdks);
+  if (!sdks.empty())
+    {
+    // Each component of the comparison mask needs to be done seperately
+    ULONGLONG dwlConditionMask = 0;
+    dwlConditionMask = VerSetConditionMask(dwlConditionMask,
+      VER_MAJORVERSION, VER_GREATER_EQUAL);
+    dwlConditionMask = VerSetConditionMask(dwlConditionMask,
+      VER_MINORVERSION, VER_GREATER_EQUAL);
+    dwlConditionMask = VerSetConditionMask(dwlConditionMask,
+      VER_BUILDNUMBER, VER_GREATER_EQUAL);
+
+    // Sort the results to make sure we select the most recent one that
+    // has a version less or equal to our version of the operating system
+    std::sort(sdks.begin(), sdks.end(), std::greater<std::string>());
+    for(std::vector<std::string>::iterator i = sdks.begin();
+        i != sdks.end(); ++i)
+      {
+      // Get the SDK version in the form 10.0.10240.0 and split into tokens
+      std::string sdkVersion = cmSystemTools::GetFilenameName(*i);
+      std::vector<std::string> tokens =
+        cmSystemTools::tokenize(sdkVersion, ".");
+      if (tokens.size()>=3)
+        {
+        OSVERSIONINFOEX osviex;
+        ZeroMemory(&osviex, sizeof(osviex));
+        osviex.dwOSVersionInfoSize = sizeof(osviex);
+        osviex.dwMajorVersion = atoi(tokens[0].c_str());
+        osviex.dwMinorVersion = atoi(tokens[1].c_str());
+        osviex.dwBuildNumber = atoi(tokens[2].c_str());
+        if (VerifyVersionInfo(&osviex,
+          VER_MAJORVERSION | VER_MINORVERSION | VER_BUILDNUMBER,
+          dwlConditionMask))
+          {
+          // This is the most recent SDK that we can run safely
+          return sdkVersion;
+          }
+        }
+      }
+    }
+#endif
+  // Return an empty string
+  return std::string();
+}
diff --git a/Source/cmGlobalVisualStudio14Generator.h b/Source/cmGlobalVisualStudio14Generator.h
index 02c6274..21e42c6 100644
--- a/Source/cmGlobalVisualStudio14Generator.h
+++ b/Source/cmGlobalVisualStudio14Generator.h
@@ -30,12 +30,21 @@ public:
 
   virtual const char* GetToolsVersion() { return "14.0"; }
 protected:
-  virtual const char* GetIDEVersion() { return "14.0"; }
+  virtual bool InitializeWindowsStore(cmMakefile* mf);
+  virtual bool SelectWindowsStoreToolset(std::string& toolset) const;
 
   // Used to verify that the Desktop toolset for the current generator is
   // installed on the machine.
   virtual bool IsWindowsDesktopToolsetInstalled() const;
 
+  // These aren't virtual because we need to check if the selected version
+  // of the toolset is installed. The desktop version is virtual since we
+  // want the desktop to match the generator that we are using
+  bool IsWindowsStoreToolsetInstalled() const;
+  std::string GetWindows10SDKVersion();
+
+  virtual const char* GetIDEVersion() { return "14.0"; }
+
 private:
   class Factory;
 };
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 3425f34..f257540 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -250,6 +250,7 @@ void cmTarget::SetMakefile(cmMakefile* mf)
     this->SetPropertyDefault("CXX_EXTENSIONS", 0);
     this->SetPropertyDefault("LINK_SEARCH_START_STATIC", 0);
     this->SetPropertyDefault("LINK_SEARCH_END_STATIC", 0);
+    this->SetPropertyDefault("VS_TARGET_PLATFORM_VERSION", 0);
     }
 
   // Collect the set of configuration types.
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 4c380f7..f5224ff 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -462,6 +462,7 @@ void cmVisualStudio10TargetGenerator::Generate()
   this->WriteString("<Import Project=\"" VS10_USER_PROPS "\""
                     " Condition=\"exists('" VS10_USER_PROPS "')\""
                     " Label=\"LocalAppDataPlatform\" />\n", 2);
+  this->WritePlatformExtensions();
   this->WriteString("</ImportGroup>\n", 1);
   this->WriteString("<PropertyGroup Label=\"UserMacros\" />\n", 1);
   this->WriteWinRTPackageCertificateKeyFile();
@@ -474,6 +475,7 @@ void cmVisualStudio10TargetGenerator::Generate()
   this->WriteXamlFilesGroup();
   this->WriteWinRTReferences();
   this->WriteProjectReferences();
+  this->WriteSDKReferences();
   this->WriteString(
     "<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\""
     " />\n", 1);
@@ -1303,6 +1305,7 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
     {
     tool = "XML";
     }
+
   if(this->NsightTegra)
     {
     // Nsight Tegra needs specific file types to check up-to-dateness.
@@ -1326,6 +1329,12 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
       }
     }
 
+  const char* toolOverride = sf->GetProperty("VS_TOOL_OVERRIDE");
+  if(toolOverride && *toolOverride)
+    {
+    tool = toolOverride;
+    }
+
   std::string deployContent;
   std::string deployLocation;
   if(this->GlobalGenerator->TargetsWindowsPhone() ||
@@ -2203,6 +2212,37 @@ cmVisualStudio10TargetGenerator::WriteLibOptions(std::string const& config)
     }
 }
 
+void cmVisualStudio10TargetGenerator::WriteManifestOptions(
+  std::string const& config)
+{
+  if(this->Target->GetType() == cmTarget::EXECUTABLE ||
+     this->Target->GetType() == cmTarget::SHARED_LIBRARY ||
+     this->Target->GetType() == cmTarget::MODULE_LIBRARY)
+    {
+    bool wroteTag = false;
+    std::vector<cmSourceFile const*> manifests;
+    this->GeneratorTarget->GetManifests(manifests, "");
+    for(std::vector<cmSourceFile const*>::const_iterator si =
+        manifests.begin(); si != manifests.end(); ++si)
+      {
+      std::string manifest = this->ConvertPath((*si)->GetFullPath(), false);
+      this->ConvertToWindowsSlash(manifest);
+      if(!wroteTag)
+        {
+        wroteTag = true;
+        this->WriteString("<Manifest>\n", 2);
+        this->WriteString("<AdditionalManifestFiles>", 3);
+        }
+      (*this->BuildFileStream) << manifest << ";";
+      }
+    if(wroteTag)
+      {
+      (*this->BuildFileStream) << "</AdditionalManifestFiles>\n";
+      this->WriteString("</Manifest>\n", 2);
+      }
+    }
+}
+
 
 //----------------------------------------------------------------------------
 void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
@@ -2559,7 +2599,8 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
 
     // A Windows Runtime component uses internal .NET metadata,
     // so does not have an import library.
-    if(this->Target->GetPropertyAsBool("VS_WINRT_COMPONENT"))
+    if (this->Target->GetPropertyAsBool("VS_WINRT_COMPONENT") &&
+        this->Target->GetType() != cmTarget::EXECUTABLE)
       {
       linkOptions.AddFlag("GenerateWindowsMetadata", "true");
       }
@@ -2630,7 +2671,7 @@ cmVisualStudio10TargetGenerator::WriteLinkOptions(std::string const& config)
     {
     this->WriteString("<ProjectReference>\n", 2);
     this->WriteString(
-      "  <LinkLibraryDependencies>false</LinkLibraryDependencies>\n", 2);
+      "<LinkLibraryDependencies>false</LinkLibraryDependencies>\n", 3);
     this->WriteString("</ProjectReference>\n", 2);
     }
 }
@@ -2740,6 +2781,8 @@ void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups()
     this->WriteLinkOptions(*i);
     //    output lib flags       <Lib></Lib>
     this->WriteLibOptions(*i);
+    //    output manifest flags  <Manifest></Manifest>
+    this->WriteManifestOptions(*i);
     if(this->NsightTegra &&
        this->Target->GetType() == cmTarget::EXECUTABLE &&
        this->Target->GetPropertyAsBool("ANDROID_GUI"))
@@ -2863,6 +2906,101 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences()
   this->WriteString("</ItemGroup>\n", 1);
 }
 
+void cmVisualStudio10TargetGenerator::WritePlatformExtensions()
+{
+  // This only applies to Windows 10 apps
+  if(this->GlobalGenerator->TargetsWindowsStore() &&
+     this->GlobalGenerator->GetSystemVersion() == "10.0")
+    {
+    const char* desktopExtensionsVersion =
+      this->Target->GetProperty("VS_DESKTOP_EXTENSIONS_VERSION");
+    if(desktopExtensionsVersion)
+      {
+      this->WriteSinglePlatformExtension("WindowsDesktop",
+                                         desktopExtensionsVersion);
+      }
+    const char* mobileExtensionsVersion =
+      this->Target->GetProperty("VS_MOBILE_EXTENSIONS_VERSION");
+    if(mobileExtensionsVersion)
+      {
+      this->WriteSinglePlatformExtension("WindowsMobile",
+                                         mobileExtensionsVersion);
+      }
+    }
+}
+
+void cmVisualStudio10TargetGenerator::WriteSinglePlatformExtension(
+  std::string const& extension,
+  std::string const& version
+  )
+{
+      this->WriteString("<Import Project=", 2);
+      (*this->BuildFileStream)
+        << "\"$([Microsoft.Build.Utilities.ToolLocationHelper]"
+        << "::GetPlatformExtensionSDKLocation(`"
+        << extension <<", Version=" << version
+        << "`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), null, "
+        << "$(ExtensionSDKDirectoryRoot), null))"
+        << "\\DesignTime\\CommonConfiguration\\Neutral\\"
+        << extension << ".props\" "
+        << "Condition=\"exists('$("
+        << "[Microsoft.Build.Utilities.ToolLocationHelper]"
+        << "::GetPlatformExtensionSDKLocation(`"
+        << extension << ", Version=" << version
+        << "`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), null, "
+        << "$(ExtensionSDKDirectoryRoot), null))"
+        << "\\DesignTime\\CommonConfiguration\\Neutral\\"
+        << extension << ".props')\" />\n";
+}
+
+void cmVisualStudio10TargetGenerator::WriteSDKReferences()
+{
+  // This only applies to Windows 10 apps
+  if(this->GlobalGenerator->TargetsWindowsStore() &&
+     this->GlobalGenerator->GetSystemVersion() == "10.0")
+    {
+    const char* desktopExtensionsVersion =
+      this->Target->GetProperty("VS_DESKTOP_EXTENSIONS_VERSION");
+    const char* mobileExtensionsVersion =
+      this->Target->GetProperty("VS_MOBILE_EXTENSIONS_VERSION");
+    const char* iotExtensionsVersion =
+      this->Target->GetProperty("VS_IOT_EXTENSIONS_VERSION");
+
+    if(desktopExtensionsVersion || mobileExtensionsVersion ||
+       iotExtensionsVersion)
+      {
+      this->WriteString("<ItemGroup>\n", 1);
+      if(desktopExtensionsVersion)
+        {
+        this->WriteSingleSDKReference("WindowsDesktop",
+                                      desktopExtensionsVersion);
+        }
+      if(mobileExtensionsVersion)
+        {
+        this->WriteSingleSDKReference("WindowsMobile",
+                                      mobileExtensionsVersion);
+        }
+      if(iotExtensionsVersion)
+        {
+        this->WriteSingleSDKReference("WindowsIoT",
+                                      iotExtensionsVersion);
+        }
+      this->WriteString("</ItemGroup>\n", 1);
+      }
+    }
+}
+
+void cmVisualStudio10TargetGenerator::WriteSingleSDKReference(
+  std::string const& extension,
+  std::string const& version
+  )
+{
+  this->WriteString("<SDKReference Include=\"", 2);
+  (*this->BuildFileStream) << extension
+    << ", Version=" << version << "\" />\n";
+}
+
+
 void cmVisualStudio10TargetGenerator::WriteWinRTPackageCertificateKeyFile()
 {
   if((this->GlobalGenerator->TargetsWindowsStore() ||
@@ -2983,12 +3121,23 @@ void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings()
     (*this->BuildFileStream) << (isWindowsPhone ?
                                  "Windows Phone" : "Windows Store")
                              << "</ApplicationType>\n";
+    this->WriteString("<DefaultLanguage>en-US"
+                      "</DefaultLanguage>\n", 2);
     this->WriteString("<ApplicationTypeRevision>", 2);
     (*this->BuildFileStream) << cmVS10EscapeXML(v)
                              << "</ApplicationTypeRevision>\n";
-    this->WriteString("<DefaultLanguage>en-US"
-                      "</DefaultLanguage>\n", 2);
-    if(v == "8.1")
+    if(v == "10.0")
+      {
+      // Visual Studio 14.0 is necessary for building 10.0 apps
+      this->WriteString("<MinimumVisualStudioVersion>14.0"
+        "</MinimumVisualStudioVersion>\n", 2);
+
+      if(this->Target->GetType() < cmTarget::UTILITY)
+        {
+        isAppContainer = true;
+        }
+      }
+    else if(v == "8.1")
       {
       // Visual Studio 12.0 is necessary for building 8.1 apps
       this->WriteString("<MinimumVisualStudioVersion>12.0"
@@ -3029,6 +3178,38 @@ void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings()
     this->WriteString("<WindowsSDKDesktopARMSupport>true"
                       "</WindowsSDKDesktopARMSupport>\n", 2);
     }
+  const char* targetPlatformVersion =
+      this->Target->GetProperty("VS_TARGET_PLATFORM_VERSION");
+  if(targetPlatformVersion)
+    {
+    this->WriteString("<WindowsTargetPlatformVersion>", 2);
+    (*this->BuildFileStream) << cmVS10EscapeXML(targetPlatformVersion) <<
+      "</WindowsTargetPlatformVersion>\n";
+    }
+  const char* targetPlatformMinVersion =
+      this->Target->GetProperty("VS_TARGET_PLATFORM_MIN_VERSION");
+  if(targetPlatformMinVersion)
+    {
+    this->WriteString("<WindowsTargetPlatformMinVersion>", 2);
+    (*this->BuildFileStream) << cmVS10EscapeXML(targetPlatformMinVersion) <<
+      "</WindowsTargetPlatformMinVersion>\n";
+    }
+  else if (isWindowsStore && v == "10.0")
+    {
+    // If the min version is not set, then use the TargetPlatformVersion
+    if (targetPlatformVersion)
+      {
+      this->WriteString("<WindowsTargetPlatformMinVersion>", 2);
+      (*this->BuildFileStream) << cmVS10EscapeXML(targetPlatformVersion) <<
+        "</WindowsTargetPlatformMinVersion>\n";
+      }
+    }
+
+  // Added IoT Startup Task support
+  if(this->Target->GetPropertyAsBool("VS_IOT_STARTUP_TASK"))
+    {
+    this->WriteString("<ContainsStartupTask>true</ContainsStartupTask>\n", 2);
+    }
 }
 
 void cmVisualStudio10TargetGenerator::VerifyNecessaryFiles()
@@ -3081,7 +3262,7 @@ void cmVisualStudio10TargetGenerator::VerifyNecessaryFiles()
             {
             this->IsMissingFiles = true;
             }
-          else if (v == "8.1")
+          else if (v == "8.1" || v == "10.0")
             {
             this->IsMissingFiles = true;
             }
@@ -3115,6 +3296,10 @@ void cmVisualStudio10TargetGenerator::WriteMissingFiles()
      {
      this->WriteMissingFilesWS81();
      }
+   else if(v == "10.0")
+     {
+     this->WriteMissingFilesWS10_0();
+     }
    }
 }
 
@@ -3320,7 +3505,7 @@ void cmVisualStudio10TargetGenerator::WriteMissingFilesWS80()
 }
 
 void cmVisualStudio10TargetGenerator::WriteMissingFilesWS81()
-{
+  {
   std::string manifestFile =
     this->DefaultArtifactDir + "/package.appxManifest";
   std::string artifactDir =
@@ -3374,7 +3559,64 @@ void cmVisualStudio10TargetGenerator::WriteMissingFilesWS81()
     "</Package>\n";
 
   this->WriteCommonMissingFiles(manifestFile);
-}
+  }
+
+void cmVisualStudio10TargetGenerator::WriteMissingFilesWS10_0()
+  {
+  std::string manifestFile =
+    this->DefaultArtifactDir + "/package.appxManifest";
+  std::string artifactDir =
+    this->LocalGenerator->GetTargetDirectory(*this->Target);
+  this->ConvertToWindowsSlash(artifactDir);
+  std::string artifactDirXML = cmVS10EscapeXML(artifactDir);
+  std::string targetNameXML = cmVS10EscapeXML(this->Target->GetName());
+
+  cmGeneratedFileStream fout(manifestFile.c_str());
+  fout.SetCopyIfDifferent(true);
+
+  fout <<
+    "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
+    "<Package\n\t"
+    "xmlns=\"http://schemas.microsoft.com/appx/manifest/foundation/windows10\""
+    "\txmlns:mp=\"http://schemas.microsoft.com/appx/2014/phone/manifest\"\n"
+    "\txmlns:uap=\"http://schemas.microsoft.com/appx/manifest/uap/windows10\""
+    "\n\tIgnorableNamespaces=\"uap mp\">\n\n"
+    "\t<Identity Name=\"" << this->GUID << "\" Publisher=\"CN=CMake\""
+    " Version=\"1.0.0.0\" />\n"
+    "\t<mp:PhoneIdentity PhoneProductId=\"" << this->GUID << 
+    "\" PhonePublisherId=\"00000000-0000-0000-0000-000000000000\"/>\n"
+    "\t<Properties>\n"
+    "\t\t<DisplayName>" << targetNameXML << "</DisplayName>\n"
+    "\t\t<PublisherDisplayName>CMake</PublisherDisplayName>\n"
+    "\t\t<Logo>" << artifactDirXML << "\\StoreLogo.png</Logo>\n"
+    "\t</Properties>\n"
+    "\t<Dependencies>\n"
+    "\t\t<TargetDeviceFamily Name=\"Windows.Universal\" "
+    "MinVersion=\"10.0.0.0\" MaxVersionTested=\"10.0.0.0\" />\n"
+    "\t</Dependencies>\n"
+
+    "\t<Resources>\n"
+    "\t\t<Resource Language=\"x-generate\" />\n"
+    "\t</Resources>\n"
+    "\t<Applications>\n"
+    "\t\t<Application Id=\"App\""
+    " Executable=\"" << targetNameXML << ".exe\""
+    " EntryPoint=\"" << targetNameXML << ".App\">\n"
+    "\t\t\t<uap:VisualElements\n"
+    "\t\t\t\tDisplayName=\"" << targetNameXML << "\"\n"
+    "\t\t\t\tDescription=\"" << targetNameXML << "\"\n"
+    "\t\t\t\tBackgroundColor=\"#336699\"\n"
+    "\t\t\t\tSquare150x150Logo=\"" << artifactDirXML << "\\Logo.png\"\n"
+    "\t\t\t\tSquare44x44Logo=\"" << artifactDirXML << "\\SmallLogo.png\">\n"
+    "\t\t\t\t<uap:SplashScreen"
+    " Image=\"" << artifactDirXML << "\\SplashScreen.png\" />\n"
+    "\t\t\t</uap:VisualElements>\n"
+    "\t\t</Application>\n"
+    "\t</Applications>\n"
+    "</Package>\n";
+
+  this->WriteCommonMissingFiles(manifestFile);
+  }
 
 void
 cmVisualStudio10TargetGenerator
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index 451f8b2..980aa03 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -78,6 +78,13 @@ private:
   void WriteMissingFilesWP81();
   void WriteMissingFilesWS80();
   void WriteMissingFilesWS81();
+  void WriteMissingFilesWS10_0();
+  void WritePlatformExtensions();
+  void WriteSinglePlatformExtension(std::string const& extension,
+                                    std::string const& version);
+  void WriteSDKReferences();
+  void WriteSingleSDKReference(std::string const& extension,
+                               std::string const& version);
   void WriteCommonMissingFiles(const std::string& manifestFile);
   void WriteTargetSpecificReferences();
 
@@ -111,6 +118,7 @@ private:
   void AddLibraries(cmComputeLinkInformation& cli,
                     std::vector<std::string>& libVec);
   void WriteLibOptions(std::string const& config);
+  void WriteManifestOptions(std::string const& config);
   void WriteEvents(std::string const& configName);
   void WriteEvent(const char* name,
                   std::vector<cmCustomCommand> const& commands,
diff --git a/Source/cmake.version.manifest b/Source/cmake.version.manifest
new file mode 100644
index 0000000..e7010c9
--- /dev/null
+++ b/Source/cmake.version.manifest
@@ -0,0 +1,18 @@
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1"
+          manifestVersion="1.0"
+		  xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" >
+   <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
+       <application>
+           <!-- Windows Vista -->
+           <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
+           <!-- Windows 7 -->
+           <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
+           <!-- Windows 8 -->
+           <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
+           <!-- Windows 8.1 -->
+           <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
+           <!-- Windows 10 -->
+           <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
+       </application>
+   </compatibility>
+</assembly>
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 2c6a42c..538a8b7 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1952,13 +1952,15 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
     set(reg_vs10 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;InstallDir]")
     set(reg_vs11 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0;InstallDir]")
     set(reg_vs12 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\12.0;InstallDir]")
+    set(reg_vs14 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots;KitsRoot10]")
     set(reg_ws80 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;InstallationFolder]")
     set(reg_ws81 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.1;InstallationFolder]")
+    set(reg_ws10_0 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\14.0\\Setup\\Build Tools for Windows 10;srcPath]")
     set(reg_wp80 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\WindowsPhone\\v8.0;InstallationFolder]")
     set(reg_wp81 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\WindowsPhone\\v8.1;InstallationFolder]")
     select_wince_sdk(reg_wince wince_sdk)
     set(reg_tegra "[HKEY_LOCAL_MACHINE\\SOFTWARE\\NVIDIA Corporation\\Nsight Tegra;sdkRoot]")
-    foreach(reg vs10 vs11 vs12 ws80 ws81 wp80 wp81 wince tegra)
+    foreach(reg vs10 vs11 vs12 vs14 ws80 ws81 ws10_0 wp80 wp81 wince tegra)
       get_filename_component(r "${reg_${reg}}" ABSOLUTE)
       if(IS_DIRECTORY "${r}")
         set(${reg} 1)
@@ -2005,6 +2007,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
                           -DCMAKE_SYSTEM_VERSION=8.1
         )
     endif()
+    if(vs14 AND ws10_0)
+      add_test_VSWinStorePhone(vs14-store10_0-X86 "Visual Studio 14 2015" WindowsStore 10.0)
+      add_test_VSWinStorePhone(vs14-store10_0-ARM "Visual Studio 14 2015 ARM" WindowsStore 10.0)
+      add_test_VSWinStorePhone(vs14-store10_0-X64 "Visual Studio 14 2015 Win64" WindowsStore 10.0)
+    endif()
     if(vs11 AND wp80)
       add_test_VSWinStorePhone(vs11-phone80-X86 "Visual Studio 11 2012" WindowsPhone 8.0)
       add_test_VSWinStorePhone(vs11-phone80-ARM "Visual Studio 11 2012 ARM" WindowsPhone 8.0)
diff --git a/Tests/VSWinStorePhone/CMakeLists.txt b/Tests/VSWinStorePhone/CMakeLists.txt
index 8357d5f..9f3552f 100644
--- a/Tests/VSWinStorePhone/CMakeLists.txt
+++ b/Tests/VSWinStorePhone/CMakeLists.txt
@@ -1,7 +1,8 @@
 cmake_minimum_required(VERSION 3.0)
 project(VSWinStorePhone)
-
-if(MSVC_VERSION GREATER 1700)
+if(MSVC_VERSION GREATER 1899)
+  set(COMPILER_VERSION "14")
+elseif(MSVC_VERSION GREATER 1700)
   set(COMPILER_VERSION "12")
 elseif(MSVC_VERSION GREATER 1600)
   set(COMPILER_VERSION "11")
@@ -96,13 +97,17 @@ elseif (NOT "${PLATFORM}" STREQUAL "DESKTOP")
     )
 endif()
 
+set(STRING_FILES
+  Direct3DApp1/Strings/en-US/Resources.resw)
+
 set(RESOURCE_FILES
-  ${CONTENT_FILES} ${DEBUG_CONTENT_FILES} ${RELEASE_CONTENT_FILES} ${ASSET_FILES}
+  ${CONTENT_FILES} ${DEBUG_CONTENT_FILES} ${RELEASE_CONTENT_FILES} ${ASSET_FILES} ${STRING_FILES}
   Direct3DApp1/Direct3DApp1_TemporaryKey.pfx)
 
 set_property(SOURCE ${CONTENT_FILES} PROPERTY VS_DEPLOYMENT_CONTENT 1)
 set_property(SOURCE ${ASSET_FILES} PROPERTY VS_DEPLOYMENT_CONTENT 1)
 set_property(SOURCE ${ASSET_FILES} PROPERTY VS_DEPLOYMENT_LOCATION "Assets")
+set_property(SOURCE ${STRING_FILES} PROPERTY VS_TOOL_OVERRIDE "PRIResource")
 set_property(SOURCE ${DEBUG_CONTENT_FILES} PROPERTY VS_DEPLOYMENT_CONTENT $<CONFIG:Debug>)
 set_property(SOURCE ${RELEASE_CONTENT_FILES} PROPERTY
   VS_DEPLOYMENT_CONTENT $<OR:$<CONFIG:Release>,$<CONFIG:RelWithDebInfo>,$<CONFIG:MinSizeRel>>)
@@ -124,4 +129,12 @@ source_group("Resource Files" FILES ${RESOURCE_FILES})
 
 add_executable(${EXE_NAME} WIN32 ${SOURCE_FILES} ${HEADER_FILES} ${RESOURCE_FILES})
 set_property(TARGET ${EXE_NAME} PROPERTY VS_WINRT_COMPONENT TRUE)
+
+if("${CMAKE_SYSTEM_VERSION}" STREQUAL "10.0")
+  set_property(TARGET ${EXE_NAME} PROPERTY VS_DESKTOP_EXTENSIONS_VERSION "10.0.10240.0")
+  set_property(TARGET ${EXE_NAME} PROPERTY VS_MOBILE_EXTENSIONS_VERSION "10.0.10240.0")
+  set_property(TARGET ${EXE_NAME} PROPERTY VS_IOT_EXTENSIONS_VERSION "10.0.10240.0")
+endif()
+
+
 target_link_libraries(${EXE_NAME} d3d11)
diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Strings/en-US/Resources.resw b/Tests/VSWinStorePhone/Direct3DApp1/Strings/en-US/Resources.resw
new file mode 100644
index 0000000..4dc31ab
--- /dev/null
+++ b/Tests/VSWinStorePhone/Direct3DApp1/Strings/en-US/Resources.resw
@@ -0,0 +1,123 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="TestString" xml:space="preserve">
+    <value>Test String</value>
+  </data>
+</root>
\ No newline at end of file
diff --git a/Tests/VSWinStorePhone/cmake/Package_vc14.store.appxmanifest.in b/Tests/VSWinStorePhone/cmake/Package_vc14.store.appxmanifest.in
new file mode 100644
index 0000000..c1a441f
--- /dev/null
+++ b/Tests/VSWinStorePhone/cmake/Package_vc14.store.appxmanifest.in
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Package
+  xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
+  xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
+  xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
+  IgnorableNamespaces="uap mp">
+
+  <Identity Name="@PACKAGE_GUID@" Publisher="CN=mgong" Version="1.1.0.0" />
+  <mp:PhoneIdentity PhoneProductId="@PACKAGE_GUID@" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
+
+  <Properties>
+    <DisplayName>@SHORT_NAME@</DisplayName>
+    <PublisherDisplayName>mgong</PublisherDisplayName>
+    <Logo>Assets/StoreLogo.png</Logo>
+  </Properties>
+
+  <Dependencies>
+    <TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.65535.65535" />
+  </Dependencies>
+
+  <Resources>
+    <Resource Language="x-generate" />
+  </Resources>
+  <Applications>
+    <Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="@SHORT_NAME@.App">
+      <uap:VisualElements
+        DisplayName="@SHORT_NAME@"
+        Description="@SHORT_NAME@"
+        BackgroundColor="#336699"
+        Square150x150Logo="Assets/Logo.png"
+        Square44x44Logo="Assets/SmallLogo.png">
+        <uap:SplashScreen Image="Assets/SplashScreen.png" />
+      </uap:VisualElements>
+    </Application>
+  </Applications>
+</Package>
-- 
2.5.1.windows.1

