[Cmake-commits] CMake branch, next, updated. v3.0.1-5010-g73c5a58
Brad King
brad.king at kitware.com
Thu Aug 21 09:29:01 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 73c5a58100f075a22068da3689c0e7313adc1c87 (commit)
via 806d3542a0ad7b964b3918ff14310c88d1a51f28 (commit)
via 0432f0620d58997cd80fd5283af3afc510482d2c (commit)
via e6ff2f8bb4308b055b1f6b193b9cabb9f45c65ae (commit)
via ee48f4c7ae2c63fc565b1c112f887965b7c3b248 (commit)
via cb1aceed8ceb29d5f01f6444133060e603297fec (commit)
via 401269e43b49ce25e247efb1fa3503b32eafa411 (commit)
via 23782171ad900dc6eac6a4b8fa4e44f96ffb94bf (commit)
via bc373c6d321bee84aa8c4c4bf87c8b2d41b763c4 (commit)
via d89b28893dda8fb299e91795aba320b6b519cfd9 (commit)
via 03ad8f28c88dbd04c41c7f6b7cc96740e8a486a4 (commit)
from e7ddfa0a3c874b315260c8f6331f708747a292f3 (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=73c5a58100f075a22068da3689c0e7313adc1c87
commit 73c5a58100f075a22068da3689c0e7313adc1c87
Merge: e7ddfa0 806d354
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Aug 21 09:28:59 2014 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Aug 21 09:28:59 2014 -0400
Merge topic 'vs-windows-apps' into next
806d3542 VS: Mark Windows Phone and Store targets as App Containers
0432f062 VS: Always ignore ole32 on Windows Phone 8.0
e6ff2f8b VS: Generate Windows Metadata for WinRT components
ee48f4c7 VS: Generate Windows Phone and Windows Store projects as Unicode
cb1aceed VS: Add VS_WINRT_COMPONENT property to enable CompileAsWinRT
401269e4 VS: Handle .pfx files explicitly in generator
23782171 VS: Handle AppxManifest sources explicitly in generator
bc373c6d VS: Set Window Phone/Store app type in CMake-generated targets
d89b2889 VS: Mark CMake-generated targets as Utility in .vcxproj files
03ad8f28 CMakeDetermineCompilerABI: Link with standard libraries on MSVC
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=806d3542a0ad7b964b3918ff14310c88d1a51f28
commit 806d3542a0ad7b964b3918ff14310c88d1a51f28
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: Thu Aug 21 09:28:21 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.
Place them in a per-target directory to avoid clashes.
* 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..a1dd7ab 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -160,6 +160,10 @@ cmVisualStudio10TargetGenerator(cmTarget* target,
this->Platform = gg->GetPlatformName();
this->MSTools = true;
this->BuildFileStream = 0;
+ this->IsMissingFiles = false;
+ this->DefaultArtifactDir =
+ this->Makefile->GetStartOutputDirectory() + std::string("/") +
+ this->LocalGenerator->GetTargetDirectory(*this->Target);
}
cmVisualStudio10TargetGenerator::~cmVisualStudio10TargetGenerator()
@@ -289,6 +293,7 @@ void cmVisualStudio10TargetGenerator::Generate()
if(this->MSTools && this->Target->GetType() <= cmTarget::GLOBAL_TARGET)
{
this->WriteApplicationTypeSettings();
+ this->VerifyNecessaryFiles();
}
const char* vsProjectTypes =
@@ -325,6 +330,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 +406,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 +486,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 +510,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 +859,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 +975,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 +1358,11 @@ void cmVisualStudio10TargetGenerator::WriteAllSources()
(*this->BuildFileStream ) << cmVS10EscapeXML(obj) << "\" />\n";
}
+ if (this->IsMissingFiles)
+ {
+ this->WriteMissingFiles();
+ }
+
this->WriteString("</ItemGroup>\n", 1);
}
@@ -2243,12 +2325,40 @@ void cmVisualStudio10TargetGenerator::WriteWinRTPackageCertificateKeyFile()
break;
}
- if(!pfxFile.empty())
+ if(this->IsMissingFiles &&
+ !(this->GlobalGenerator->TargetsWindowsPhone() &&
+ this->GlobalGenerator->GetSystemVersion() == "8.0"))
{
+ // Move the manifest to a project directory to avoid clashes
+ std::string artifactDir =
+ this->LocalGenerator->GetTargetDirectory(*this->Target);
+ this->ConvertToWindowsSlash(artifactDir);
this->WriteString("<PropertyGroup>\n", 1);
- this->WriteString("<", 2);
- (*this->BuildFileStream) << "PackageCertificateKeyFile>"
- << pfxFile << "</PackageCertificateKeyFile>\n";
+ this->WriteString("<AppxPackageArtifactsDir>", 2);
+ (*this->BuildFileStream) << cmVS10EscapeXML(artifactDir) <<
+ "\\</AppxPackageArtifactsDir>\n";
+ this->WriteString("<ProjectPriFullPath>"
+ "$(TargetDir)resources.pri</ProjectPriFullPath>", 2);
+
+ // 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())
+ {
+ std::string templateFolder = cmSystemTools::GetCMakeRoot() +
+ "/Templates/Windows";
+ pfxFile = this->DefaultArtifactDir + "/Windows_TemporaryKey.pfx";
+ cmSystemTools::CopyAFile(templateFolder + "/Windows_TemporaryKey.pfx",
+ pfxFile, false);
+ this->ConvertToWindowsSlash(pfxFile);
+ this->AddedFiles.push_back(pfxFile);
+ }
+
+ if(!pfxFile.empty())
+ {
+ this->WriteString("<", 2);
+ (*this->BuildFileStream) << "PackageCertificateKeyFile>"
+ << pfxFile << "</PackageCertificateKeyFile>\n";
+ }
this->WriteString("</PropertyGroup>\n", 1);
}
}
@@ -2267,6 +2377,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 +2395,439 @@ 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 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");
+ 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"
+ "<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\">"
+ << artifactDirXML << "\\ApplicationIcon.png</IconPath>\n"
+ "\t\t<Capabilities/>\n"
+ "\t\t<Tasks>\n"
+ "\t\t\t<DefaultTask Name=\"_default\""
+ " ImagePath=\"" << targetNameXML << ".exe\" ImageParams=\"\" />\n"
+ "\t\t</Tasks>\n"
+ "\t\t<Tokens>\n"
+ "\t\t\t<PrimaryToken TokenID=\"" << targetNameXML << "Token\""
+ " TaskName=\"_default\">\n"
+ "\t\t\t\t<TemplateFlip>\n"
+ "\t\t\t\t\t<SmallImageURI IsRelative=\"true\" IsResource=\"false\">"
+ << artifactDirXML << "\\SmallLogo.png</SmallImageURI>\n"
+ "\t\t\t\t\t<Count>0</Count>\n"
+ "\t\t\t\t\t<BackgroundImageURI IsRelative=\"true\" IsResource=\"false\">"
+ << artifactDirXML << "\\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);
+ this->ConvertToWindowsSlash(sourceFile);
+ this->WriteString("<Xml Include=\"", 2);
+ (*this->BuildFileStream) << cmVS10EscapeXML(sourceFile) << "\">\n";
+ this->WriteString("<SubType>Designer</SubType>\n", 3);
+ this->WriteString("</Xml>\n", 2);
+ this->AddedFiles.push_back(sourceFile);
+
+ std::string smallLogo = this->DefaultArtifactDir + "/SmallLogo.png";
+ cmSystemTools::CopyAFile(templateFolder + "/SmallLogo.png",
+ smallLogo, false);
+ this->ConvertToWindowsSlash(smallLogo);
+ this->WriteString("<Image Include=\"", 2);
+ (*this->BuildFileStream) << cmVS10EscapeXML(smallLogo) << "\" />\n";
+ this->AddedFiles.push_back(smallLogo);
+
+ std::string logo = this->DefaultArtifactDir + "/Logo.png";
+ cmSystemTools::CopyAFile(templateFolder + "/Logo.png",
+ logo, false);
+ this->ConvertToWindowsSlash(logo);
+ this->WriteString("<Image Include=\"", 2);
+ (*this->BuildFileStream) << cmVS10EscapeXML(logo) << "\" />\n";
+ this->AddedFiles.push_back(logo);
+
+ std::string applicationIcon =
+ this->DefaultArtifactDir + "/ApplicationIcon.png";
+ cmSystemTools::CopyAFile(templateFolder + "/ApplicationIcon.png",
+ applicationIcon, false);
+ this->ConvertToWindowsSlash(applicationIcon);
+ this->WriteString("<Image Include=\"", 2);
+ (*this->BuildFileStream) << cmVS10EscapeXML(applicationIcon) << "\" />\n";
+ this->AddedFiles.push_back(applicationIcon);
+}
+
+void cmVisualStudio10TargetGenerator::WriteMissingFilesWP81()
+{
+ 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 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>" << targetNameXML << "</DisplayName>\n"
+ "\t\t<PublisherDisplayName>CMake</PublisherDisplayName>\n"
+ "\t\t<Logo>" << artifactDirXML << "\\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=\"" << targetNameXML << ".exe\""
+ " EntryPoint=\"" << targetNameXML << ".App\">\n"
+ "\t\t\t<m2:VisualElements\n"
+ "\t\t\t\tDisplayName=\"" << targetNameXML << "\"\n"
+ "\t\t\t\tDescription=\"" << targetNameXML << "\"\n"
+ "\t\t\t\tBackgroundColor=\"#336699\"\n"
+ "\t\t\t\tForegroundText=\"light\"\n"
+ "\t\t\t\tSquare150x150Logo=\"" << artifactDirXML << "\\Logo.png\"\n"
+ "\t\t\t\tSquare30x30Logo=\"" << artifactDirXML << "\\SmallLogo.png\">\n"
+ "\t\t\t\t<m2:DefaultTile ShortName=\"" << targetNameXML << "\">\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=\"" << artifactDirXML << "\\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 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 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>" << targetNameXML << "</DisplayName>\n"
+ "\t\t<PublisherDisplayName>CMake</PublisherDisplayName>\n"
+ "\t\t<Logo>" << artifactDirXML << "\\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=\"" << targetNameXML << ".exe\""
+ " EntryPoint=\"" << targetNameXML << ".App\">\n"
+ "\t\t\t<VisualElements"
+ " DisplayName=\"" << targetNameXML << "\""
+ " Description=\"" << targetNameXML << "\""
+ " BackgroundColor=\"#336699\" ForegroundText=\"light\""
+ " Logo=\"" << artifactDirXML << "\\Logo.png\""
+ " SmallLogo=\"" << artifactDirXML << "\\SmallLogo.png\">\n"
+ "\t\t\t\t<DefaultTile ShowName=\"allLogos\""
+ " ShortName=\"" << targetNameXML << "\" />\n"
+ "\t\t\t\t<SplashScreen"
+ " Image=\"" << artifactDirXML << "\\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 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 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>" << targetNameXML << "</DisplayName>\n"
+ "\t\t<PublisherDisplayName>CMake</PublisherDisplayName>\n"
+ "\t\t<Logo>" << artifactDirXML << "\\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=\"" << targetNameXML << ".exe\""
+ " EntryPoint=\"" << targetNameXML << ".App\">\n"
+ "\t\t\t<m2:VisualElements\n"
+ "\t\t\t\tDisplayName=\"" << targetNameXML << "\"\n"
+ "\t\t\t\tDescription=\"" << targetNameXML << "\"\n"
+ "\t\t\t\tBackgroundColor=\"#336699\"\n"
+ "\t\t\t\tForegroundText=\"light\"\n"
+ "\t\t\t\tSquare150x150Logo=\"" << artifactDirXML << "\\Logo.png\"\n"
+ "\t\t\t\tSquare30x30Logo=\"" << artifactDirXML << "\\SmallLogo.png\">\n"
+ "\t\t\t\t<m2:DefaultTile ShortName=\"" << targetNameXML << "\">\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=\"" << artifactDirXML << "\\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 templateFolder = cmSystemTools::GetCMakeRoot() +
+ "/Templates/Windows";
+
+ std::string sourceFile = this->ConvertPath(manifestFile, false);
+ this->ConvertToWindowsSlash(sourceFile);
+ this->WriteString("<AppxManifest Include=\"", 2);
+ (*this->BuildFileStream) << cmVS10EscapeXML(sourceFile) << "\">\n";
+ this->WriteString("<SubType>Designer</SubType>\n", 3);
+ this->WriteString("</AppxManifest>\n", 2);
+ this->AddedFiles.push_back(sourceFile);
+
+ std::string smallLogo = this->DefaultArtifactDir + "/SmallLogo.png";
+ cmSystemTools::CopyAFile(templateFolder + "/SmallLogo.png",
+ smallLogo, false);
+ this->ConvertToWindowsSlash(smallLogo);
+ this->WriteString("<Image Include=\"", 2);
+ (*this->BuildFileStream) << cmVS10EscapeXML(smallLogo) << "\" />\n";
+ this->AddedFiles.push_back(smallLogo);
+
+ std::string logo = this->DefaultArtifactDir + "/Logo.png";
+ cmSystemTools::CopyAFile(templateFolder + "/Logo.png",
+ logo, false);
+ this->ConvertToWindowsSlash(logo);
+ this->WriteString("<Image Include=\"", 2);
+ (*this->BuildFileStream) << cmVS10EscapeXML(logo) << "\" />\n";
+ this->AddedFiles.push_back(logo);
+
+ std::string storeLogo = this->DefaultArtifactDir + "/StoreLogo.png";
+ cmSystemTools::CopyAFile(templateFolder + "/StoreLogo.png",
+ storeLogo, false);
+ this->ConvertToWindowsSlash(storeLogo);
+ this->WriteString("<Image Include=\"", 2);
+ (*this->BuildFileStream) << cmVS10EscapeXML(storeLogo) << "\" />\n";
+ this->AddedFiles.push_back(storeLogo);
+
+ std::string splashScreen = this->DefaultArtifactDir + "/SplashScreen.png";
+ cmSystemTools::CopyAFile(templateFolder + "/SplashScreen.png",
+ splashScreen, false);
+ this->ConvertToWindowsSlash(splashScreen);
+ this->WriteString("<Image Include=\"", 2);
+ (*this->BuildFileStream) << cmVS10EscapeXML(splashScreen) << "\" />\n";
+ this->AddedFiles.push_back(splashScreen);
+
+ // This file has already been added to the build so don't copy it
+ std::string keyFile = this->DefaultArtifactDir + "/Windows_TemporaryKey.pfx";
+ this->ConvertToWindowsSlash(keyFile);
+ this->WriteString("<None Include=\"", 2);
+ (*this->BuildFileStream) << cmVS10EscapeXML(keyFile) << "\" />\n";
+}
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index 827287b..9d94365 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,9 @@ private:
cmGeneratedFileStream* BuildFileStream;
cmLocalVisualStudio7Generator* LocalGenerator;
std::set<cmSourceFile const*> SourcesVisited;
+ bool IsMissingFiles;
+ std::vector<std::string> AddedFiles;
+ std::string DefaultArtifactDir;
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=0432f0620d58997cd80fd5283af3afc510482d2c
commit 0432f0620d58997cd80fd5283af3afc510482d2c
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: Thu Aug 21 09:28:21 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=e6ff2f8bb4308b055b1f6b193b9cabb9f45c65ae
commit e6ff2f8bb4308b055b1f6b193b9cabb9f45c65ae
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: Thu Aug 21 09:28:20 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=ee48f4c7ae2c63fc565b1c112f887965b7c3b248
commit ee48f4c7ae2c63fc565b1c112f887965b7c3b248
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: Thu Aug 21 09:28:20 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=cb1aceed8ceb29d5f01f6444133060e603297fec
commit cb1aceed8ceb29d5f01f6444133060e603297fec
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: Thu Aug 21 09:28:20 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=401269e43b49ce25e247efb1fa3503b32eafa411
commit 401269e43b49ce25e247efb1fa3503b32eafa411
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: Thu Aug 21 09:28:20 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=23782171ad900dc6eac6a4b8fa4e44f96ffb94bf
commit 23782171ad900dc6eac6a4b8fa4e44f96ffb94bf
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: Thu Aug 21 09:28:20 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=bc373c6d321bee84aa8c4c4bf87c8b2d41b763c4
commit bc373c6d321bee84aa8c4c4bf87c8b2d41b763c4
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: Thu Aug 21 09:28:19 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=d89b28893dda8fb299e91795aba320b6b519cfd9
commit d89b28893dda8fb299e91795aba320b6b519cfd9
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: Thu Aug 21 09:28:19 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;
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=03ad8f28c88dbd04c41c7f6b7cc96740e8a486a4
commit 03ad8f28c88dbd04c41c7f6b7cc96740e8a486a4
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Aug 19 09:04:25 2014 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Thu Aug 21 09:28:19 2014 -0400
CMakeDetermineCompilerABI: Link with standard libraries on MSVC
In commit v2.8.0~395 (Implicit link info for C, CXX, and Fortran,
2009-07-23) we added a '-DCMAKE_${lang}_STANDARD_LIBRARIES=' flag to the
try_compile used to build the ABI detection project. It is needed when
detecting the implicit libraries added by the GNU compiler on Windows
(MinGW tools) to avoid contaminating the list with standard Windows
libraries. However, with MSVC we do not detect such implicit link
libraries anyway, and for some target platforms (e.g. Windows Phone) we
may need the standard libraries to link the ABI detection executable.
Drop the flag when detecting the ABI using MSVC.
diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake
index 8595b97..4b7ec30 100644
--- a/Modules/CMakeDetermineCompilerABI.cmake
+++ b/Modules/CMakeDetermineCompilerABI.cmake
@@ -28,13 +28,15 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src)
if(DEFINED CMAKE_${lang}_VERBOSE_FLAG)
set(CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS=${CMAKE_${lang}_VERBOSE_FLAG}")
endif()
+ if(NOT "x${CMAKE_${lang}_COMPILER_ID}" STREQUAL "xMSVC")
+ # Avoid adding our own platform standard libraries for compilers
+ # from which we might detect implicit link libraries.
+ list(APPEND CMAKE_FLAGS "-DCMAKE_${lang}_STANDARD_LIBRARIES=")
+ endif()
try_compile(CMAKE_${lang}_ABI_COMPILED
${CMAKE_BINARY_DIR} ${src}
- CMAKE_FLAGS "${CMAKE_FLAGS}"
- "-DCMAKE_${lang}_STANDARD_LIBRARIES="
- # We need ignore these warnings because some platforms need
- # CMAKE_${lang}_STANDARD_LIBRARIES to link properly and we
- # don't care when we are just determining the ABI.
+ CMAKE_FLAGS ${CMAKE_FLAGS}
+ # Ignore unused flags when we are just determining the ABI.
"--no-warn-unused-cli"
OUTPUT_VARIABLE OUTPUT
COPY_FILE "${BIN}"
-----------------------------------------------------------------------
Summary of changes:
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list