[Cmake-commits] CMake branch, next, updated. v3.0.1-4956-g033a5cf

Brad King brad.king at kitware.com
Mon Aug 18 15:23:10 EDT 2014


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  033a5cf50898dd2fffcdbe32f9b06bb332ab516d (commit)
       via  b40d348cd625c82c6824eaecd2a9334f33b17009 (commit)
       via  d73fb09b3ce459bc807ee8c1104403e8903cc0be (commit)
       via  2aee89db17d214111f26f157f667a82eac98f350 (commit)
       via  921a19d2d3253ccf1612ea9d2202125f451ce77f (commit)
       via  06ea637e225d1bfcbf0907be22e6fd0e917b49fc (commit)
       via  b1ac434fd02b065e3c5721a0db807074b087d651 (commit)
       via  bb170d36c2c980c4aaa278c151d1a4ea2d80291c (commit)
       via  6b02cb0cf171f1668ca450efbab756b05da5c573 (commit)
       via  dd980e8b87f2e09681c645495812d1606b1f9ffc (commit)
      from  20baa5fac73783c78c5f088e88672fbf0a2cf614 (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 -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=033a5cf50898dd2fffcdbe32f9b06bb332ab516d
commit 033a5cf50898dd2fffcdbe32f9b06bb332ab516d
Merge: 20baa5f b40d348
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Aug 18 15:23:08 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Aug 18 15:23:08 2014 -0400

    Merge topic 'vs-windows-apps' into next
    
    b40d348c VS: Mark Windows Phone and Store targets as App Containers
    d73fb09b VS: Always ignore ole32 on Windows Phone 8.0
    2aee89db VS: Generate Windows Metadata for WinRT components
    921a19d2 VS: Generate Windows Phone and Windows Store projects as Unicode
    06ea637e VS: Add VS_WINRT_COMPONENT property to enable CompileAsWinRT
    b1ac434f VS: Handle .pfx files explicitly in generator
    bb170d36 VS: Handle AppxManifest sources explicitly in generator
    6b02cb0c VS: Set Window Phone/Store app type in CMake-generated targets
    dd980e8b VS: Mark CMake-generated targets as Utility in .vcxproj files


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b40d348cd625c82c6824eaecd2a9334f33b17009
commit b40d348cd625c82c6824eaecd2a9334f33b17009
Author:     Gilles Khouzam <gillesk at microsoft.com>
AuthorDate: Thu Aug 14 14:52:53 2014 -0700
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Aug 18 15:14:48 2014 -0400

    VS: Mark Windows Phone and Store targets as App Containers
    
    * Add AppContainerApplication to non-UTILITY targets
    * Generate app manifest and related files if project does not provide them
    * Mark WinRT components with WinMDAssembly
    * Import Windows Phone 8.0 targets in .vcxproj files when necessary,
      and reference platform.winmd.
    
    Inspired-by: Paul Annetts <paul at lightunobscured.com>

diff --git a/.gitattributes b/.gitattributes
index d21f1dd..d3f7280 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -12,6 +12,8 @@ configure        crlf=input
 *.dsp           -crlf
 *.dsptemplate   -crlf
 *.dsw           -crlf
+*.pfx           -crlf
+*.png           -crlf
 *.sln           -crlf
 *.vcproj        -crlf
 
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 76068ac..138ff4c 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -160,6 +160,7 @@ cmVisualStudio10TargetGenerator(cmTarget* target,
   this->Platform = gg->GetPlatformName();
   this->MSTools = true;
   this->BuildFileStream = 0;
+  this->IsMissingFiles = false;
 }
 
 cmVisualStudio10TargetGenerator::~cmVisualStudio10TargetGenerator()
@@ -289,6 +290,7 @@ void cmVisualStudio10TargetGenerator::Generate()
   if(this->MSTools && this->Target->GetType() <= cmTarget::GLOBAL_TARGET)
     {
     this->WriteApplicationTypeSettings();
+    this->VerifyNecessaryFiles();
     }
 
   const char* vsProjectTypes =
@@ -325,6 +327,11 @@ void cmVisualStudio10TargetGenerator::Generate()
       }
     }
 
+  if(this->Target->GetPropertyAsBool("VS_WINRT_COMPONENT"))
+    {
+    this->WriteString("<WinMDAssembly>true</WinMDAssembly>\n", 2);
+    }
+
   const char* vsGlobalKeyword =
     this->Target->GetProperty("VS_GLOBAL_KEYWORD");
   if(!vsGlobalKeyword)
@@ -396,6 +403,7 @@ void cmVisualStudio10TargetGenerator::Generate()
   this->WriteString(
     "<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\""
     " />\n", 1);
+  this->WriteTargetSpecificReferences();
   this->WriteString("<ImportGroup Label=\"ExtensionTargets\">\n", 1);
   if (this->GlobalGenerator->IsMasmEnabled())
     {
@@ -475,6 +483,22 @@ void cmVisualStudio10TargetGenerator::WriteEmbeddedResourceGroup()
     }
 }
 
+void cmVisualStudio10TargetGenerator::WriteTargetSpecificReferences()
+{
+  if(this->MSTools)
+    {
+    if(this->GlobalGenerator->TargetsWindowsPhone() &&
+       this->GlobalGenerator->GetSystemVersion() == "8.0")
+      {
+      this->WriteString(
+        "<Import Project=\""
+        "$(MSBuildExtensionsPath)\\Microsoft\\WindowsPhone\\v"
+        "$(TargetPlatformVersion)\\Microsoft.Cpp.WindowsPhone."
+        "$(TargetPlatformVersion).targets\" />\n", 1);
+      }
+    }
+}
+
 void cmVisualStudio10TargetGenerator::WriteWinRTReferences()
 {
   std::vector<std::string> references;
@@ -483,6 +507,13 @@ void cmVisualStudio10TargetGenerator::WriteWinRTReferences()
     {
     cmSystemTools::ExpandListArgument(vsWinRTReferences, references);
     }
+
+  if(this->GlobalGenerator->TargetsWindowsPhone() &&
+     this->GlobalGenerator->GetSystemVersion() == "8.0" &&
+     references.empty())
+    {
+    references.push_back("platform.winmd");
+    }
   if(!references.empty())
     {
     this->WriteString("<ItemGroup>\n", 1);
@@ -825,6 +856,49 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
     this->WriteGroupSources(ti->first.c_str(), ti->second, sourceGroups);
     }
 
+  // Added files are images and the manifest.
+  if (!this->AddedFiles.empty())
+    {
+    this->WriteString("<ItemGroup>\n", 1);
+    for(std::vector<std::string>::const_iterator
+          oi = this->AddedFiles.begin(); oi != this->AddedFiles.end(); ++oi)
+      {
+      std::string fileName = cmSystemTools::LowerCase(
+        cmSystemTools::GetFilenameName(*oi));
+      if (fileName == "wmappmanifest.xml")
+        {
+        this->WriteString("<XML Include=\"", 2);
+        (*this->BuildFileStream) << *oi << "\">\n";
+        this->WriteString("<Filter>Resource Files</Filter>\n", 3);
+        this->WriteString("</XML>\n", 2);
+        }
+      else if(cmSystemTools::GetFilenameExtension(fileName) ==
+              ".appxmanifest")
+        {
+        this->WriteString("<AppxManifest Include=\"", 2);
+        (*this->BuildFileStream) << *oi << "\">\n";
+        this->WriteString("<Filter>Resource Files</Filter>\n", 3);
+        this->WriteString("</AppxManifest>\n", 2);
+        }
+      else if(cmSystemTools::GetFilenameExtension(fileName) ==
+              ".pfx")
+        {
+        this->WriteString("<None Include=\"", 2);
+        (*this->BuildFileStream) << *oi << "\">\n";
+        this->WriteString("<Filter>Resource Files</Filter>\n", 3);
+        this->WriteString("</None>\n", 2);
+        }
+      else
+        {
+        this->WriteString("<Image Include=\"", 2);
+        (*this->BuildFileStream) << *oi << "\">\n";
+        this->WriteString("<Filter>Resource Files</Filter>\n", 3);
+        this->WriteString("</Image>\n", 2);
+        }
+      }
+    this->WriteString("</ItemGroup>\n", 1);
+    }
+
   std::vector<cmSourceFile const*> resxObjs;
     this->GeneratorTarget->GetResxSources(resxObjs, "");
   if(!resxObjs.empty())
@@ -898,7 +972,7 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
     this->WriteString("</Filter>\n", 2);
     }
 
-  if(!resxObjs.empty())
+  if(!resxObjs.empty() || !this->AddedFiles.empty())
     {
     this->WriteString("<Filter Include=\"Resource Files\">\n", 2);
     std::string guidName = "SG_Filter_Resource Files";
@@ -1281,6 +1355,11 @@ void cmVisualStudio10TargetGenerator::WriteAllSources()
     (*this->BuildFileStream ) << cmVS10EscapeXML(obj) << "\" />\n";
     }
 
+  if (this->IsMissingFiles)
+    {
+    this->WriteMissingFiles();
+    }
+
   this->WriteString("</ItemGroup>\n", 1);
 }
 
@@ -2243,6 +2322,23 @@ void cmVisualStudio10TargetGenerator::WriteWinRTPackageCertificateKeyFile()
       break;
       }
 
+    // If we are missing files and we don't have a certificate and
+    // aren't targeting WP8.0, add a default certificate
+    if(pfxFile.empty() && this->IsMissingFiles &&
+       !(this->GlobalGenerator->TargetsWindowsPhone() &&
+         this->GlobalGenerator->GetSystemVersion() == "8.0"))
+      {
+      std::string baseFolder = this->Makefile->GetStartOutputDirectory() +
+                               std::string("/") + this->Target->GetName();
+      std::string templateFolder = cmSystemTools::GetCMakeRoot() +
+                                   "/Templates/Windows";
+      pfxFile = baseFolder + "/Windows_TemporaryKey.pfx";
+      cmSystemTools::CopyAFile(templateFolder + "/Windows_TemporaryKey.pfx",
+                               pfxFile, false);
+      this->ConvertToWindowsSlash(pfxFile);
+      this->AddedFiles.push_back(pfxFile);
+      }
+
     if(!pfxFile.empty())
       {
       this->WriteString("<PropertyGroup>\n", 1);
@@ -2267,6 +2363,7 @@ bool cmVisualStudio10TargetGenerator::
 
 void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings()
 {
+  bool isAppContainer = false;
   bool const isWindowsPhone = this->GlobalGenerator->TargetsWindowsPhone();
   bool const isWindowsStore = this->GlobalGenerator->TargetsWindowsStore();
   std::string const& v = this->GlobalGenerator->GetSystemVersion();
@@ -2284,17 +2381,441 @@ void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings()
       // Visual Studio 12.0 is necessary for building 8.1 apps
       this->WriteString("<MinimumVisualStudioVersion>12.0"
                         "</MinimumVisualStudioVersion>\n", 2);
+
+      if (this->Target->GetType() < cmTarget::UTILITY)
+        {
+        isAppContainer = true;
+        }
       }
     else if (v == "8.0")
       {
       // Visual Studio 11.0 is necessary for building 8.0 apps
       this->WriteString("<MinimumVisualStudioVersion>11.0"
                         "</MinimumVisualStudioVersion>\n", 2);
+
+      if (isWindowsStore && this->Target->GetType() < cmTarget::UTILITY)
+        {
+        isAppContainer = true;
+        }
+      else if (isWindowsPhone &&
+               this->Target->GetType() == cmTarget::EXECUTABLE)
+        {
+        this->WriteString("<XapOutputs>true</XapOutputs>\n", 2);
+        this->WriteString("<XapFilename>", 2);
+        (*this->BuildFileStream) << cmVS10EscapeXML(this->Name.c_str()) <<
+           "_$(Configuration)_$(Platform).xap</XapFilename>\n";
+        }
       }
     }
-  if (this->Platform == "ARM")
+  if(isAppContainer)
+    {
+    this->WriteString("<AppContainerApplication>true"
+                      "</AppContainerApplication>", 2);
+    }
+  else if (this->Platform == "ARM")
     {
     this->WriteString("<WindowsSDKDesktopARMSupport>true"
                       "</WindowsSDKDesktopARMSupport>", 2);
     }
 }
+
+void cmVisualStudio10TargetGenerator::VerifyNecessaryFiles()
+{
+  // For Windows and Windows Phone executables, we will assume that if a
+  // manifest is not present that we need to add all the necessary files
+  if (this->Target->GetType() == cmTarget::EXECUTABLE)
+    {
+    std::vector<cmSourceFile const*> manifestSources;
+    this->GeneratorTarget->GetAppManifest(manifestSources, "");
+      {
+      std::string const& v = this->GlobalGenerator->GetSystemVersion();
+      if(this->GlobalGenerator->TargetsWindowsPhone())
+        {
+        if (v == "8.0")
+          {
+          // Look through the sources for WMAppManifest.xml
+          std::vector<cmSourceFile const*> extraSources;
+          this->GeneratorTarget->GetExtraSources(extraSources, "");
+          bool foundManifest = false;
+          for(std::vector<cmSourceFile const*>::const_iterator si =
+            extraSources.begin(); si != extraSources.end(); ++si)
+            {
+            // Need to do a lowercase comparison on the filename
+            if("wmappmanifest.xml" == cmSystemTools::LowerCase(
+              (*si)->GetLocation().GetName()))
+              {
+              foundManifest = true;
+              break;
+              }
+            }
+          if (!foundManifest)
+            {
+            this->IsMissingFiles = true;
+            }
+          }
+        else if (v == "8.1")
+          {
+          if(manifestSources.empty())
+            {
+            this->IsMissingFiles = true;
+            }
+          }
+        }
+      else if (this->GlobalGenerator->TargetsWindowsStore())
+        {
+        if (manifestSources.empty())
+          {
+          if (v == "8.0")
+            {
+            this->IsMissingFiles = true;
+            }
+          else if (v == "8.1")
+            {
+            this->IsMissingFiles = true;
+            }
+          }
+        }
+      }
+    }
+}
+
+void cmVisualStudio10TargetGenerator::WriteMissingFiles()
+{
+  std::string const& v = this->GlobalGenerator->GetSystemVersion();
+  if(this->GlobalGenerator->TargetsWindowsPhone())
+    {
+    if (v == "8.0")
+      {
+      this->WriteMissingFilesWP80();
+      }
+    else if (v == "8.1")
+      {
+      this->WriteMissingFilesWP81();
+      }
+    }
+  else if (this->GlobalGenerator->TargetsWindowsStore())
+   {
+   if (v == "8.0")
+     {
+     this->WriteMissingFilesWS80();
+     }
+   else if (v == "8.1")
+     {
+     this->WriteMissingFilesWS81();
+     }
+   }
+}
+
+void cmVisualStudio10TargetGenerator::WriteMissingFilesWP80()
+{
+  std::string baseFolder = this->Makefile->GetStartOutputDirectory() +
+                           std::string("/") + this->Target->GetName();
+  std::string templateFolder = cmSystemTools::GetCMakeRoot() +
+                               "/Templates/Windows";
+
+  // For WP80, the manifest needs to be in the same folder as the project
+  // this can cause an overwrite problem if projects aren't organized in
+  // folders
+  std::string manifestFile = this->Makefile->GetStartOutputDirectory() +
+                             std::string("/WMAppManifest.xml");
+
+  cmGeneratedFileStream fout(manifestFile.c_str());
+  fout.SetCopyIfDifferent(true);
+
+  fout << "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
+    << "<Deployment xmlns="
+    << "\"http://schemas.microsoft.com/windowsphone/2012/deployment\" "
+    << "AppPlatformVersion=\"8.0\">\n"
+    << "\t<DefaultLanguage xmlns=\"\" code=\"en-US\"/>\n"
+    << "\t<App xmlns=\"\" ProductID=\"{" << this->GUID << "}\" "
+    << "Title=\"CMake Test Program\" RuntimeType=\"Modern Native\" "
+    << "Version=\"1.0.0.0\" Genre=\"apps.normal\"  Author=\"CMake\" "
+    << "Description=\"Default CMake App\" Publisher=\"CMake\" "
+    << "PublisherID=\"{" << this->GUID << "}\">\n"
+    << "\t\t<IconPath IsRelative=\"true\" IsResource=\"false\">"
+    << this->Target->GetName() << "\\ApplicationIcon.png</IconPath>"
+    << "\n"
+    << "\t\t<Capabilities/>\n"
+    << "\t\t<Tasks>\n"
+    << "\t\t\t<DefaultTask Name=\"_default\" ImagePath=\""
+    << "CMakeTestExecutable.exe\" ImageParams=\"\" />\n"
+    << "\t\t</Tasks>\n"
+    << "\t\t<Tokens>\n"
+    << "\t\t\t<PrimaryToken TokenID=\"" << this->Name
+    << "Token\" TaskName=\"_default\">\n"
+    << "\t\t\t\t<TemplateFlip>\n"
+    << "\t\t\t\t\t<SmallImageURI IsRelative=\"true\" IsResource=\"false\">"
+    << this->Target->GetName() << "\\SmallLogo.png</SmallImageURI>"
+    << "\n"
+    << "\t\t\t\t\t<Count>0</Count>\n"
+    << "\t\t\t\t\t<BackgroundImageURI IsRelative=\"true\" IsResource="
+    << "\"false\">"
+    << this->Target->GetName() << "\\Logo.png</BackgroundImageURI>"
+    << "\n"
+    << "\t\t\t\t</TemplateFlip>\n"
+    << "\t\t\t</PrimaryToken>\n"
+    << "\t\t</Tokens>\n"
+    << "\t\t<ScreenResolutions>\n"
+    << "\t\t\t<ScreenResolution Name=\"ID_RESOLUTION_WVGA\" />\n"
+    << "\t\t</ScreenResolutions>\n"
+    << "\t</App>\n"
+    << "</Deployment>\n";
+
+  std::string sourceFile = this->ConvertPath(manifestFile, false);
+  ConvertToWindowsSlash(sourceFile);
+  this->WriteString("<Xml Include=\"", 2);
+  (*this->BuildFileStream) << sourceFile << "\">\n";
+  this->WriteString("<SubType>Designer</SubType>\n", 3);
+  this->WriteString("</Xml>\n", 2);
+  this->AddedFiles.push_back(sourceFile);
+
+  std::string smallLogo = baseFolder + "/SmallLogo.png";
+  cmSystemTools::CopyAFile(templateFolder + "/SmallLogo.png",
+                           smallLogo, false);
+  ConvertToWindowsSlash(smallLogo);
+  this->WriteString("<Image Include=\"", 2);
+  (*this->BuildFileStream) << smallLogo << "\" />\n";
+  this->AddedFiles.push_back(smallLogo);
+
+  std::string logo = baseFolder + "/Logo.png";
+  cmSystemTools::CopyAFile(templateFolder + "/Logo.png",
+                           logo, false);
+  ConvertToWindowsSlash(logo);
+  this->WriteString("<Image Include=\"", 2);
+  (*this->BuildFileStream) << logo << "\" />\n";
+  this->AddedFiles.push_back(logo);
+
+  std::string applicationIcon = baseFolder + "/ApplicationIcon.png";
+  cmSystemTools::CopyAFile(templateFolder + "/ApplicationIcon.png",
+                           applicationIcon, false);
+  ConvertToWindowsSlash(applicationIcon);
+  this->WriteString("<Image Include=\"", 2);
+  (*this->BuildFileStream) << applicationIcon << "\" />\n";
+  this->AddedFiles.push_back(applicationIcon);
+}
+
+void cmVisualStudio10TargetGenerator::WriteMissingFilesWP81()
+{
+  std::string baseFolder = this->Makefile->GetStartOutputDirectory() +
+                           std::string("/") + this->Target->GetName();
+  std::string manifestFile = baseFolder + "/package.appxManifest";
+
+  cmGeneratedFileStream fout(manifestFile.c_str());
+  fout.SetCopyIfDifferent(true);
+
+  fout << "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
+    << "<Package xmlns=\"http://schemas.microsoft.com/appx/2010/manifest\" "
+    << "xmlns:m2=\"http://schemas.microsoft.com/appx/2013/manifest\" "
+    << "xmlns:mp=\"http://schemas.microsoft.com/appx/2014/phone/manifest\">"
+    << "\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>" << this->Target->GetName() << "</DisplayName>"
+    << "\n"
+    << "\t\t<PublisherDisplayName>CMake</PublisherDisplayName>\n"
+    << "\t\t<Logo>" << this->Target->GetName() << "\\StoreLogo.png</Logo>"
+    << "\n"
+    << "\t</Properties>\n"
+    << "\t<Prerequisites>\n"
+    << "\t\t<OSMinVersion>6.3.1</OSMinVersion>\n"
+    << "\t\t<OSMaxVersionTested>6.3.1</OSMaxVersionTested>\n"
+    << "\t</Prerequisites>\n"
+    << "\t<Resources>\n"
+    << "\t\t<Resource Language=\"x-generate\" />\n"
+    << "\t</Resources>\n"
+    << "\t<Applications>\n"
+    <<"\t\t<Application Id=\"App\" Executable=\""
+    << this->Target->GetName() << ".exe\" EntryPoint=\""
+    << this->Target->GetName() << ".App\">\n"
+    << "\t\t\t<m2:VisualElements\n"
+    << "\t\t\t\tDisplayName=\"" << this->Target->GetName() << "\"\n"
+    << "\t\t\t\tDescription=\"" << this->Target->GetName() << "\"\n"
+    << "\t\t\t\tBackgroundColor=\"#336699\"\n"
+    << "\t\t\t\tForegroundText=\"light\"\n"
+    << "\t\t\t\tSquare150x150Logo=\"" << this->Target->GetName()
+    << "\\Logo.png\"\n"
+    << "\t\t\t\tSquare30x30Logo=\"" << this->Target->GetName()
+    << "\\SmallLogo.png\">\n"
+    << "\t\t\t\t<m2:DefaultTile ShortName=\""
+    << this->Target->GetName() << "\">\n"
+    << "\t\t\t\t\t<m2:ShowNameOnTiles>\n"
+    << "\t\t\t\t\t\t<m2:ShowOn Tile=\"square150x150Logo\" />\n"
+    << "\t\t\t\t\t</m2:ShowNameOnTiles>\n"
+    << "\t\t\t\t</m2:DefaultTile>\n"
+    << "\t\t\t\t<m2:SplashScreen Image=\"" << this->Target->GetName()
+    << "\\SplashScreen.png\" />\n"
+    << "\t\t\t</m2:VisualElements>\n"
+    << "\t\t</Application>\n"
+    << "\t</Applications>\n"
+    << "</Package>\n";
+
+  this->WriteCommonMissingFiles(manifestFile);
+}
+
+void cmVisualStudio10TargetGenerator::WriteMissingFilesWS80()
+{
+  std::string baseFolder = this->Makefile->GetStartOutputDirectory() +
+                           std::string("/") + this->Target->GetName();
+  std::string manifestFile = baseFolder + "/package.appxManifest";
+
+  cmGeneratedFileStream fout(manifestFile.c_str());
+  fout.SetCopyIfDifferent(true);
+
+  fout << "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
+    << "<Package xmlns=\"http://schemas.microsoft.com/appx/2010/manifest\">"
+    << "\n"
+    << "\t<Identity Name=\"" << this->GUID << "\" Publisher=\"CN=CMake\" "
+    << "Version=\"1.0.0.0\" />\n"
+    << "\t<Properties>\n"
+    << "\t\t<DisplayName>" << this->Target->GetName() << "</DisplayName>"
+    << "\n"
+    << "\t\t<PublisherDisplayName>CMake</PublisherDisplayName>\n"
+    << "\t\t<Logo>" << this->Target->GetName() << "\\StoreLogo.png</Logo>"
+    << "\n"
+    << "\t</Properties>\n"
+    << "\t<Prerequisites>\n"
+    << "\t\t<OSMinVersion>6.2.1</OSMinVersion>\n"
+    << "\t\t<OSMaxVersionTested>6.2.1</OSMaxVersionTested>\n"
+    << "\t</Prerequisites>\n"
+    << "\t<Resources>\n"
+    << "\t\t<Resource Language=\"x-generate\" />\n"
+    << "\t</Resources>\n"
+    << "\t<Applications>\n"
+    <<"\t\t<Application Id=\"App\" Executable=\""
+    << this->Target->GetName() << ".exe\" EntryPoint=\""
+    << this->Target->GetName() << ".App\">\n"
+    << "\t\t\t<VisualElements DisplayName=\"" << this->Target->GetName()
+    << "\" Description=\"" << this->Target->GetName()
+    << "\" BackgroundColor=\"#336699\" ForegroundText=\"light\" "
+    << "Logo=\"" << this->Target->GetName() << "\\Logo.png\" "
+    << "SmallLogo=\"" << this->Target->GetName() << "\\SmallLogo.png\">"
+    << "\n"
+    << "\t\t\t\t<DefaultTile ShowName=\"allLogos\" ShortName=\""
+    << this->Target->GetName() << "\" />\n"
+    << "\t\t\t\t<SplashScreen Image=\"" << this->Target->GetName()
+    << "\\SplashScreen.png\" />\n"
+    << "\t\t\t</VisualElements>\n"
+    << "\t\t</Application>\n"
+    << "\t</Applications>\n"
+    << "</Package>\n";
+
+  this->WriteCommonMissingFiles(manifestFile);
+}
+
+void cmVisualStudio10TargetGenerator::WriteMissingFilesWS81()
+{
+  std::string baseFolder = this->Makefile->GetStartOutputDirectory() +
+                           std::string("/") + this->Target->GetName();
+  std::string manifestFile = baseFolder + "/package.appxManifest";
+
+  cmGeneratedFileStream fout(manifestFile.c_str());
+  fout.SetCopyIfDifferent(true);
+
+  fout << "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
+    << "<Package xmlns=\"http://schemas.microsoft.com/appx/2010/manifest\" "
+    << "xmlns:m2=\"http://schemas.microsoft.com/appx/2013/manifest\">"
+    << "\n"
+    << "\t<Identity Name=\"" << this->GUID << "\" Publisher=\"CN=CMake\" "
+    << "Version=\"1.0.0.0\" />\n"
+    << "\t<Properties>\n"
+    << "\t\t<DisplayName>" << this->Target->GetName() << "</DisplayName>"
+    << "\n"
+    << "\t\t<PublisherDisplayName>CMake</PublisherDisplayName>\n"
+    << "\t\t<Logo>" << this->Target->GetName() << "\\StoreLogo.png</Logo>"
+    << "\n"
+    << "\t</Properties>\n"
+    << "\t<Prerequisites>\n"
+    << "\t\t<OSMinVersion>6.3</OSMinVersion>\n"
+    << "\t\t<OSMaxVersionTested>6.3</OSMaxVersionTested>\n"
+    << "\t</Prerequisites>\n"
+    << "\t<Resources>\n"
+    << "\t\t<Resource Language=\"x-generate\" />\n"
+    << "\t</Resources>\n"
+    << "\t<Applications>\n"
+    <<"\t\t<Application Id=\"App\" Executable=\""
+    << this->Target->GetName() << ".exe\" EntryPoint=\""
+    << this->Target->GetName() << ".App\">\n"
+    << "\t\t\t<m2:VisualElements\n"
+    << "\t\t\t\tDisplayName=\"" << this->Target->GetName() << "\"\n"
+    << "\t\t\t\tDescription=\"" << this->Target->GetName() << "\"\n"
+    << "\t\t\t\tBackgroundColor=\"#336699\"\n"
+    << "\t\t\t\tForegroundText=\"light\"\n"
+    << "\t\t\t\tSquare150x150Logo=\"" << this->Target->GetName()
+    << "\\Logo.png\"\n"
+    << "\t\t\t\tSquare30x30Logo=\"" << this->Target->GetName()
+    << "\\SmallLogo.png\">\n"
+    << "\t\t\t\t<m2:DefaultTile ShortName=\""
+    << this->Target->GetName() << "\">\n"
+    << "\t\t\t\t\t<m2:ShowNameOnTiles>\n"
+    << "\t\t\t\t\t\t<m2:ShowOn Tile=\"square150x150Logo\" />\n"
+    << "\t\t\t\t\t</m2:ShowNameOnTiles>\n"
+    << "\t\t\t\t</m2:DefaultTile>\n"
+    << "\t\t\t\t<m2:SplashScreen Image=\"" << this->Target->GetName()
+    << "\\SplashScreen.png\" />\n"
+    << "\t\t\t</m2:VisualElements>\n"
+    << "\t\t</Application>\n"
+    << "\t</Applications>\n"
+    << "</Package>\n";
+
+  this->WriteCommonMissingFiles(manifestFile);
+}
+
+void
+cmVisualStudio10TargetGenerator
+::WriteCommonMissingFiles(const std::string& manifestFile)
+{
+  std::string baseFolder = this->Makefile->GetStartOutputDirectory() +
+                           std::string("/") + this->Target->GetName();
+  std::string templateFolder = cmSystemTools::GetCMakeRoot() +
+                               "/Templates/Windows";
+
+  std::string sourceFile = this->ConvertPath(manifestFile, false);
+  this->ConvertToWindowsSlash(sourceFile);
+  this->WriteString("<AppxManifest Include=\"", 2);
+  (*this->BuildFileStream) << sourceFile << "\">\n";
+  this->WriteString("<SubType>Designer</SubType>\n", 3);
+  this->WriteString("</AppxManifest>\n", 2);
+  this->AddedFiles.push_back(sourceFile);
+
+  std::string smallLogo = baseFolder + "/SmallLogo.png";
+  cmSystemTools::CopyAFile(templateFolder + "/SmallLogo.png",
+                           smallLogo, false);
+  this->ConvertToWindowsSlash(smallLogo);
+  this->WriteString("<Image Include=\"", 2);
+  (*this->BuildFileStream) << smallLogo << "\" />\n";
+  this->AddedFiles.push_back(smallLogo);
+
+  std::string logo = baseFolder + "/Logo.png";
+  cmSystemTools::CopyAFile(templateFolder + "/Logo.png",
+                           logo, false);
+  this->ConvertToWindowsSlash(logo);
+  this->WriteString("<Image Include=\"", 2);
+  (*this->BuildFileStream) << logo << "\" />\n";
+  this->AddedFiles.push_back(logo);
+
+  std::string storeLogo = baseFolder + "/StoreLogo.png";
+  cmSystemTools::CopyAFile(templateFolder + "/StoreLogo.png",
+                           storeLogo, false);
+  this->ConvertToWindowsSlash(storeLogo);
+  this->WriteString("<Image Include=\"", 2);
+  (*this->BuildFileStream) << storeLogo << "\" />\n";
+  this->AddedFiles.push_back(storeLogo);
+
+  std::string splashScreen = baseFolder + "/SplashScreen.png";
+  cmSystemTools::CopyAFile(templateFolder + "/SplashScreen.png",
+                           splashScreen, false);
+  ConvertToWindowsSlash(splashScreen);
+  this->WriteString("<Image Include=\"", 2);
+  (*this->BuildFileStream) << splashScreen << "\" />\n";
+  this->AddedFiles.push_back(splashScreen);
+
+  // This file has already been added to the build so don't copy it
+  std::string keyFile = baseFolder + "/Windows_TemporaryKey.pfx";
+  ConvertToWindowsSlash(keyFile);
+  this->WriteString("<None Include=\"", 2);
+  (*this->BuildFileStream) << keyFile << "\" />\n";
+}
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index 827287b..e05e436 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -70,6 +70,14 @@ private:
   void WriteWinRTPackageCertificateKeyFile();
   void WritePathAndIncrementalLinkOptions();
   void WriteItemDefinitionGroups();
+  void VerifyNecessaryFiles();
+  void WriteMissingFiles();
+  void WriteMissingFilesWP80();
+  void WriteMissingFilesWP81();
+  void WriteMissingFilesWS80();
+  void WriteMissingFilesWS81();
+  void WriteCommonMissingFiles(const std::string& manifestFile);
+  void WriteTargetSpecificReferences();
 
   bool ComputeClOptions();
   bool ComputeClOptions(std::string const& configName);
@@ -130,6 +138,8 @@ private:
   cmGeneratedFileStream* BuildFileStream;
   cmLocalVisualStudio7Generator* LocalGenerator;
   std::set<cmSourceFile const*> SourcesVisited;
+  bool IsMissingFiles;
+  std::vector<std::string> AddedFiles;
 
   typedef std::map<std::string, ToolSources> ToolSourceMap;
   ToolSourceMap Tools;
diff --git a/Templates/Windows/ApplicationIcon.png b/Templates/Windows/ApplicationIcon.png
new file mode 100644
index 0000000..7d95d4e
Binary files /dev/null and b/Templates/Windows/ApplicationIcon.png differ
diff --git a/Templates/Windows/Logo.png b/Templates/Windows/Logo.png
new file mode 100644
index 0000000..e26771c
Binary files /dev/null and b/Templates/Windows/Logo.png differ
diff --git a/Templates/Windows/SmallLogo.png b/Templates/Windows/SmallLogo.png
new file mode 100644
index 0000000..1eb0d9d
Binary files /dev/null and b/Templates/Windows/SmallLogo.png differ
diff --git a/Templates/Windows/SplashScreen.png b/Templates/Windows/SplashScreen.png
new file mode 100644
index 0000000..c951e03
Binary files /dev/null and b/Templates/Windows/SplashScreen.png differ
diff --git a/Templates/Windows/StoreLogo.png b/Templates/Windows/StoreLogo.png
new file mode 100644
index 0000000..dcb6727
Binary files /dev/null and b/Templates/Windows/StoreLogo.png differ
diff --git a/Templates/Windows/Windows_TemporaryKey.pfx b/Templates/Windows/Windows_TemporaryKey.pfx
new file mode 100644
index 0000000..2c9110c
Binary files /dev/null and b/Templates/Windows/Windows_TemporaryKey.pfx differ

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d73fb09b3ce459bc807ee8c1104403e8903cc0be
commit d73fb09b3ce459bc807ee8c1104403e8903cc0be
Author:     Gilles Khouzam <gillesk at microsoft.com>
AuthorDate: Mon Aug 11 14:44:35 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Aug 18 15:14:45 2014 -0400

    VS: Always ignore ole32 on Windows Phone 8.0
    
    Inspired-by: Paul Annetts <paul at lightunobscured.com>

diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 9e9011d..76068ac 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1982,6 +1982,13 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
       // component, then do not generate the metadata here.
       linkOptions.AddFlag("GenerateWindowsMetadata", "false");
       }
+
+    if (this->GlobalGenerator->TargetsWindowsPhone() &&
+        this->GlobalGenerator->GetSystemVersion() == "8.0")
+      {
+      // WindowsPhone 8.0 does not have ole32.
+      linkOptions.AppendFlag("IgnoreSpecificDefaultLibraries", "ole32.lib");
+      }
     }
 
   linkOptions.Parse(flags.c_str());

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2aee89db17d214111f26f157f667a82eac98f350
commit 2aee89db17d214111f26f157f667a82eac98f350
Author:     Gilles Khouzam <gillesk at microsoft.com>
AuthorDate: Mon Aug 11 14:40:09 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Aug 18 15:14:43 2014 -0400

    VS: Generate Windows Metadata for WinRT components
    
    Inspired-by: Paul Annetts <paul at lightunobscured.com>

diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 08daad4..9e9011d 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1774,6 +1774,18 @@ cmVisualStudio10TargetGenerator::WriteLibOptions(std::string const& config)
     libOptions.OutputFlagMap(*this->BuildFileStream, "      ");
     this->WriteString("</Lib>\n", 2);
     }
+
+  // We cannot generate metadata for static libraries.  WindowsPhone
+  // and WindowsStore tools look at GenerateWindowsMetadata in the
+  // Link tool options even for static libraries.
+  if(this->GlobalGenerator->TargetsWindowsPhone() ||
+     this->GlobalGenerator->TargetsWindowsStore())
+    {
+    this->WriteString("<Link>\n", 2);
+    this->WriteString("<GenerateWindowsMetadata>false"
+                      "</GenerateWindowsMetadata>\n", 3);
+    this->WriteString("</Link>\n", 2);
+    }
 }
 
 //----------------------------------------------------------------------------
@@ -1955,6 +1967,21 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config)
 
     linkOptions.AddFlag("ImportLibrary", imLib.c_str());
     linkOptions.AddFlag("ProgramDataBaseFile", pdb.c_str());
+
+    // A Windows Runtime component uses internal .NET metadata,
+    // so does not have an import library.
+    if(this->Target->GetPropertyAsBool("VS_WINRT_COMPONENT"))
+      {
+      linkOptions.AddFlag("GenerateWindowsMetadata", "true");
+      }
+    else if (this->GlobalGenerator->TargetsWindowsPhone() ||
+             this->GlobalGenerator->TargetsWindowsStore())
+      {
+      // WindowsPhone and WindowsStore components are in an app container
+      // and produce WindowsMetadata.  If we are not producing a WINRT
+      // component, then do not generate the metadata here.
+      linkOptions.AddFlag("GenerateWindowsMetadata", "false");
+      }
     }
 
   linkOptions.Parse(flags.c_str());

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=921a19d2d3253ccf1612ea9d2202125f451ce77f
commit 921a19d2d3253ccf1612ea9d2202125f451ce77f
Author:     Gilles Khouzam <gillesk at microsoft.com>
AuthorDate: Mon Aug 11 14:33:11 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Aug 18 15:14:41 2014 -0400

    VS: Generate Windows Phone and Windows Store projects as Unicode

diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index b4ece20..08daad4 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -592,6 +592,8 @@ void cmVisualStudio10TargetGenerator
   if((this->Target->GetType() <= cmTarget::OBJECT_LIBRARY &&
       this->ClOptions[config]->UsingUnicode()) ||
      this->Target->GetPropertyAsBool("VS_WINRT_COMPONENT") ||
+     this->GlobalGenerator->TargetsWindowsPhone() ||
+     this->GlobalGenerator->TargetsWindowsStore() ||
      this->Target->GetPropertyAsBool("VS_WINRT_EXTENSIONS"))
     {
     this->WriteString("<CharacterSet>Unicode</CharacterSet>\n", 2);

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=06ea637e225d1bfcbf0907be22e6fd0e917b49fc
commit 06ea637e225d1bfcbf0907be22e6fd0e917b49fc
Author:     Gilles Khouzam <gillesk at microsoft.com>
AuthorDate: Mon Aug 11 14:21:16 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Aug 18 15:14:38 2014 -0400

    VS: Add VS_WINRT_COMPONENT property to enable CompileAsWinRT
    
    Deprecate VS_WINRT_EXTENSIONS and document VS_WINRT_COMPONENT as for VS
    generators only.  Also define _WINRT_DLL in SHARED libraries in order to
    get a .lib produced.
    
    Inspired-by: Paul Annetts <paul at lightunobscured.com>

diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index 5b0673a..d28229a 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -235,6 +235,7 @@ Properties on Targets
    /prop_tgt/VS_SCC_LOCALPATH
    /prop_tgt/VS_SCC_PROJECTNAME
    /prop_tgt/VS_SCC_PROVIDER
+   /prop_tgt/VS_WINRT_COMPONENT
    /prop_tgt/VS_WINRT_EXTENSIONS
    /prop_tgt/VS_WINRT_REFERENCES
    /prop_tgt/WIN32_EXECUTABLE
diff --git a/Help/prop_tgt/VS_WINRT_COMPONENT.rst b/Help/prop_tgt/VS_WINRT_COMPONENT.rst
new file mode 100644
index 0000000..a017f0e
--- /dev/null
+++ b/Help/prop_tgt/VS_WINRT_COMPONENT.rst
@@ -0,0 +1,14 @@
+VS_WINRT_COMPONENT
+------------------
+
+Mark a target as a Windows Runtime component for the Visual Studio generator.
+Compile the target with ``C++/CX`` language extensions for Windows Runtime.
+For ``SHARED`` and ``MODULE`` libraries, this also defines the
+``_WINRT_DLL`` preprocessor macro.
+
+.. note::
+  Behavior is not defined for targets with source files that compile as
+  any language other than ``CXX``.
+
+  Currently this is implemented only by Visual Studio generators.
+  Support may be added to other generators in the future.
diff --git a/Help/prop_tgt/VS_WINRT_EXTENSIONS.rst b/Help/prop_tgt/VS_WINRT_EXTENSIONS.rst
index cc6fb16..d1cba34 100644
--- a/Help/prop_tgt/VS_WINRT_EXTENSIONS.rst
+++ b/Help/prop_tgt/VS_WINRT_EXTENSIONS.rst
@@ -1,6 +1,5 @@
 VS_WINRT_EXTENSIONS
 -------------------
 
-Visual Studio project C++/CX language extensions for Windows Runtime
-
-Can be set to enable C++/CX language extensions.
+Deprecated.  Use :prop_tgt:`VS_WINRT_COMPONENT` instead.
+This property was an experimental partial implementation of that one.
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index b1dec64..b4ece20 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -591,6 +591,7 @@ void cmVisualStudio10TargetGenerator
 
   if((this->Target->GetType() <= cmTarget::OBJECT_LIBRARY &&
       this->ClOptions[config]->UsingUnicode()) ||
+     this->Target->GetPropertyAsBool("VS_WINRT_COMPONENT") ||
      this->Target->GetPropertyAsBool("VS_WINRT_EXTENSIONS"))
     {
     this->WriteString("<CharacterSet>Unicode</CharacterSet>\n", 2);
@@ -611,7 +612,8 @@ void cmVisualStudio10TargetGenerator
     pts += "</PlatformToolset>\n";
     this->WriteString(pts.c_str(), 2);
     }
-  if(this->Target->GetPropertyAsBool("VS_WINRT_EXTENSIONS"))
+  if(this->Target->GetPropertyAsBool("VS_WINRT_COMPONENT") ||
+     this->Target->GetPropertyAsBool("VS_WINRT_EXTENSIONS"))
     {
     this->WriteString("<WindowsAppContainer>true"
                       "</WindowsAppContainer>\n", 2);
@@ -1604,6 +1606,29 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
     clOptions.AddDefine(exportMacro);
     }
 
+  if (this->MSTools)
+    {
+    // If we have the VS_WINRT_COMPONENT set then force Compile as WinRT.
+    if (this->Target->GetPropertyAsBool("VS_WINRT_COMPONENT"))
+      {
+      clOptions.AddFlag("CompileAsWinRT", "true");
+      // For WinRT components, add the _WINRT_DLL define to produce a lib
+      if (this->Target->GetType() == cmTarget::SHARED_LIBRARY ||
+          this->Target->GetType() == cmTarget::MODULE_LIBRARY )
+        {
+        clOptions.AddDefine("_WINRT_DLL");
+        }
+      }
+    else if (this->GlobalGenerator->TargetsWindowsStore() ||
+             this->GlobalGenerator->TargetsWindowsPhone())
+      {
+      if (!clOptions.IsWinRt())
+        {
+        clOptions.AddFlag("CompileAsWinRT", "false");
+        }
+      }
+    }
+
   this->ClOptions[configName] = pOptions.release();
   return true;
 }
diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx
index b14fc45..eeaf126 100644
--- a/Source/cmVisualStudioGeneratorOptions.cxx
+++ b/Source/cmVisualStudioGeneratorOptions.cxx
@@ -107,6 +107,12 @@ bool cmVisualStudioGeneratorOptions::IsDebug() const
 }
 
 //----------------------------------------------------------------------------
+bool cmVisualStudioGeneratorOptions::IsWinRt() const
+{
+  return this->FlagMap.find("CompileAsWinRT") != this->FlagMap.end();
+}
+
+//----------------------------------------------------------------------------
 bool cmVisualStudioGeneratorOptions::UsingUnicode() const
 {
   // Look for the a _UNICODE definition.
diff --git a/Source/cmVisualStudioGeneratorOptions.h b/Source/cmVisualStudioGeneratorOptions.h
index 47a7c62..5829e17 100644
--- a/Source/cmVisualStudioGeneratorOptions.h
+++ b/Source/cmVisualStudioGeneratorOptions.h
@@ -52,6 +52,7 @@ public:
   bool UsingSBCS() const;
 
   bool IsDebug() const;
+  bool IsWinRt() const;
   // Write options to output.
   void OutputPreprocessorDefinitions(std::ostream& fout,
                                      const char* prefix,

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b1ac434fd02b065e3c5721a0db807074b087d651
commit b1ac434fd02b065e3c5721a0db807074b087d651
Author:     Gilles Khouzam <gillesk at microsoft.com>
AuthorDate: Mon Aug 11 14:17:12 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Aug 18 15:14:36 2014 -0400

    VS: Handle .pfx files explicitly in generator
    
    Teach cmGeneratorTarget to classify .pfx files as package
    certificate key files.  Teach cmVisualStudio10TargetGenerator
    to write them as PackageCertificateKeyFile in .vcxproj files.
    
    Inspired-by: Minmin Gong <minmin.gong at gmail.com>

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 2df259b..9a42ca2 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -54,6 +54,7 @@ struct IDLSourcesTag {};
 struct ResxTag {};
 struct ModuleDefinitionFileTag {};
 struct AppManifestTag{};
+struct CertificatesTag{};
 
 #if !defined(_MSC_VER) || _MSC_VER >= 1310
 template<typename Tag, typename OtherTag>
@@ -200,6 +201,10 @@ struct TagVisitor
       {
       DoAccept<IsSameTag<Tag, AppManifestTag>::Result>::Do(this->Data, sf);
       }
+    else if (ext == "pfx")
+      {
+      DoAccept<IsSameTag<Tag, CertificatesTag>::Result>::Do(this->Data, sf);
+      }
     else if(this->Header.find(sf->GetFullPath().c_str()))
       {
       DoAccept<IsSameTag<Tag, HeaderSourcesTag>::Result>::Do(this->Data, sf);
@@ -443,6 +448,15 @@ cmGeneratorTarget
 }
 
 //----------------------------------------------------------------------------
+void
+cmGeneratorTarget
+::GetCertificates(std::vector<cmSourceFile const*>& data,
+                  const std::string& config) const
+{
+  IMPLEMENT_VISIT(Certificates);
+}
+
+//----------------------------------------------------------------------------
 bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir,
                                               const std::string& config) const
 {
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index c2c4801..2083b88 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -56,6 +56,8 @@ public:
                               const std::string& config) const;
   void GetAppManifest(std::vector<cmSourceFile const*>&,
                       const std::string& config) const;
+  void GetCertificates(std::vector<cmSourceFile const*>&,
+                       const std::string& config) const;
 
   void ComputeObjectMapping();
 
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 3b7f981..b1dec64 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -384,6 +384,7 @@ void cmVisualStudio10TargetGenerator::Generate()
                     " Label=\"LocalAppDataPlatform\" />\n", 2);
   this->WriteString("</ImportGroup>\n", 1);
   this->WriteString("<PropertyGroup Label=\"UserMacros\" />\n", 1);
+  this->WriteWinRTPackageCertificateKeyFile();
   this->WritePathAndIncrementalLinkOptions();
   this->WriteItemDefinitionGroups();
   this->WriteCustomCommands();
@@ -2164,6 +2165,34 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences()
   this->WriteString("</ItemGroup>\n", 1);
 }
 
+void cmVisualStudio10TargetGenerator::WriteWinRTPackageCertificateKeyFile()
+{
+  if((this->GlobalGenerator->TargetsWindowsStore() ||
+      this->GlobalGenerator->TargetsWindowsPhone())
+      && (cmTarget::EXECUTABLE == this->Target->GetType()))
+    {
+    std::string pfxFile;
+    std::vector<cmSourceFile const*> certificates;
+    this->GeneratorTarget->GetCertificates(certificates, "");
+    for(std::vector<cmSourceFile const*>::const_iterator si =
+        certificates.begin(); si != certificates.end(); ++si)
+      {
+      pfxFile = this->ConvertPath((*si)->GetFullPath(), false);
+      this->ConvertToWindowsSlash(pfxFile);
+      break;
+      }
+
+    if(!pfxFile.empty())
+      {
+      this->WriteString("<PropertyGroup>\n", 1);
+      this->WriteString("<", 2);
+      (*this->BuildFileStream) << "PackageCertificateKeyFile>"
+        << pfxFile << "</PackageCertificateKeyFile>\n";
+      this->WriteString("</PropertyGroup>\n", 1);
+      }
+    }
+}
+
 bool cmVisualStudio10TargetGenerator::
   IsResxHeader(const std::string& headerFile)
 {
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index 2bbdb8c..827287b 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -67,6 +67,7 @@ private:
   void WriteDotNetReferences();
   void WriteEmbeddedResourceGroup();
   void WriteWinRTReferences();
+  void WriteWinRTPackageCertificateKeyFile();
   void WritePathAndIncrementalLinkOptions();
   void WriteItemDefinitionGroups();
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bb170d36c2c980c4aaa278c151d1a4ea2d80291c
commit bb170d36c2c980c4aaa278c151d1a4ea2d80291c
Author:     Gilles Khouzam <gillesk at microsoft.com>
AuthorDate: Mon Aug 11 14:08:49 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Aug 18 15:14:33 2014 -0400

    VS: Handle AppxManifest sources explicitly in generator
    
    Teach cmGeneratorTarget to extract .appxmanifest sources separately.
    Teach cmVisualStudio10TargetGenerator to write them with the
    AppxManifest tool in .vcxproj files.  This will allow us to detect
    whether the project provides an application manfiest explicitly.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index f9b68d4..2df259b 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -53,6 +53,7 @@ struct ExternalObjectsTag {};
 struct IDLSourcesTag {};
 struct ResxTag {};
 struct ModuleDefinitionFileTag {};
+struct AppManifestTag{};
 
 #if !defined(_MSC_VER) || _MSC_VER >= 1310
 template<typename Tag, typename OtherTag>
@@ -195,6 +196,10 @@ struct TagVisitor
       {
       DoAccept<IsSameTag<Tag, ResxTag>::Result>::Do(this->Data, sf);
       }
+    else if (ext == "appxmanifest")
+      {
+      DoAccept<IsSameTag<Tag, AppManifestTag>::Result>::Do(this->Data, sf);
+      }
     else if(this->Header.find(sf->GetFullPath().c_str()))
       {
       DoAccept<IsSameTag<Tag, HeaderSourcesTag>::Result>::Do(this->Data, sf);
@@ -429,6 +434,15 @@ void cmGeneratorTarget
 }
 
 //----------------------------------------------------------------------------
+void
+cmGeneratorTarget
+::GetAppManifest(std::vector<cmSourceFile const*>& data,
+                 const std::string& config) const
+{
+  IMPLEMENT_VISIT(AppManifest);
+}
+
+//----------------------------------------------------------------------------
 bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir,
                                               const std::string& config) const
 {
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 29aa410..c2c4801 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -54,6 +54,8 @@ public:
                          const std::string& config) const;
   void GetExpectedResxHeaders(std::set<std::string>&,
                               const std::string& config) const;
+  void GetAppManifest(std::vector<cmSourceFile const*>&,
+                      const std::string& config) const;
 
   void ComputeObjectMapping();
 
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 4927d6b..3b7f981 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1022,11 +1022,7 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
   std::string tool = "None";
   std::string shaderType;
   std::string const& ext = sf->GetExtension();
-  if(ext == "appxmanifest")
-    {
-    tool = "AppxManifest";
-    }
-  else if(ext == "hlsl")
+  if(ext == "hlsl")
     {
     tool = "FXCompile";
     // Figure out the type of shader compiler to use.
@@ -1221,6 +1217,10 @@ void cmVisualStudio10TargetGenerator::WriteAllSources()
       }
     }
 
+  std::vector<cmSourceFile const*> manifestSources;
+  this->GeneratorTarget->GetAppManifest(manifestSources, "");
+  this->WriteSources("AppxManifest", manifestSources);
+
   std::vector<cmSourceFile const*> externalObjects;
   this->GeneratorTarget->GetExternalObjects(externalObjects, "");
   for(std::vector<cmSourceFile const*>::iterator

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6b02cb0cf171f1668ca450efbab756b05da5c573
commit 6b02cb0cf171f1668ca450efbab756b05da5c573
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Aug 18 15:12:24 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Aug 18 15:14:31 2014 -0400

    VS: Set Window Phone/Store app type in CMake-generated targets
    
    Generate the ApplicationType and ApplicationTypeRevision elements in
    .vcxproj files for CMake-generated targets like 'INSTALL' and
    'RUN_TESTS'.  This was accidentally left out of commit 709cebde (VS:
    Generate WindowsPhone and WindowsStore application types, 2014-07-31).

diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 8aa3090..4927d6b 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -286,7 +286,7 @@ void cmVisualStudio10TargetGenerator::Generate()
   this->WriteString("<ProjectGUID>", 2);
   (*this->BuildFileStream) <<  "{" << this->GUID << "}</ProjectGUID>\n";
 
-  if(this->MSTools && this->Target->GetType() <= cmTarget::UTILITY)
+  if(this->MSTools && this->Target->GetType() <= cmTarget::GLOBAL_TARGET)
     {
     this->WriteApplicationTypeSettings();
     }

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dd980e8b87f2e09681c645495812d1606b1f9ffc
commit dd980e8b87f2e09681c645495812d1606b1f9ffc
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Aug 18 15:03:13 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Aug 18 15:14:29 2014 -0400

    VS: Mark CMake-generated targets as Utility in .vcxproj files
    
    Targets like 'INSTALL' and 'RUN_TESTS' are Utility targets.
    Fix the VS >= 10 generator to set this correctly.  We already
    do so for VS < 10.

diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 6989c51..8aa3090 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -546,9 +546,9 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues()
         configType += "Application";
         break;
       case cmTarget::UTILITY:
+      case cmTarget::GLOBAL_TARGET:
         configType += "Utility";
         break;
-      case cmTarget::GLOBAL_TARGET:
       case cmTarget::UNKNOWN_LIBRARY:
       case cmTarget::INTERFACE_LIBRARY:
         break;

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

Summary of changes:
 .gitattributes                             |    2 +
 Help/manual/cmake-properties.7.rst         |    1 +
 Help/prop_tgt/VS_WINRT_COMPONENT.rst       |   14 +
 Help/prop_tgt/VS_WINRT_EXTENSIONS.rst      |    5 +-
 Source/cmGeneratorTarget.cxx               |   28 ++
 Source/cmGeneratorTarget.h                 |    4 +
 Source/cmVisualStudio10TargetGenerator.cxx |  631 +++++++++++++++++++++++++++-
 Source/cmVisualStudio10TargetGenerator.h   |   11 +
 Source/cmVisualStudioGeneratorOptions.cxx  |    6 +
 Source/cmVisualStudioGeneratorOptions.h    |    1 +
 Templates/Windows/ApplicationIcon.png      |  Bin 0 -> 3392 bytes
 Templates/Windows/Logo.png                 |  Bin 0 -> 801 bytes
 Templates/Windows/SmallLogo.png            |  Bin 0 -> 329 bytes
 Templates/Windows/SplashScreen.png         |  Bin 0 -> 2146 bytes
 Templates/Windows/StoreLogo.png            |  Bin 0 -> 429 bytes
 Templates/Windows/Windows_TemporaryKey.pfx |  Bin 0 -> 2512 bytes
 16 files changed, 690 insertions(+), 13 deletions(-)
 create mode 100644 Help/prop_tgt/VS_WINRT_COMPONENT.rst
 create mode 100644 Templates/Windows/ApplicationIcon.png
 create mode 100644 Templates/Windows/Logo.png
 create mode 100644 Templates/Windows/SmallLogo.png
 create mode 100644 Templates/Windows/SplashScreen.png
 create mode 100644 Templates/Windows/StoreLogo.png
 create mode 100644 Templates/Windows/Windows_TemporaryKey.pfx


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list