summaryrefslogtreecommitdiffstats
path: root/Source/cmVisualStudio10TargetGenerator.cxx
diff options
context:
space:
mode:
authorGilles Khouzam <gillesk@microsoft.com>2014-08-11 18:17:12 (GMT)
committerBrad King <brad.king@kitware.com>2014-08-21 13:28:20 (GMT)
commit401269e43b49ce25e247efb1fa3503b32eafa411 (patch)
tree22065d953c5c7d1b0747911b2f9868b7cd8674a6 /Source/cmVisualStudio10TargetGenerator.cxx
parent23782171ad900dc6eac6a4b8fa4e44f96ffb94bf (diff)
downloadCMake-401269e43b49ce25e247efb1fa3503b32eafa411.zip
CMake-401269e43b49ce25e247efb1fa3503b32eafa411.tar.gz
CMake-401269e43b49ce25e247efb1fa3503b32eafa411.tar.bz2
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@gmail.com>
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx29
1 files changed, 29 insertions, 0 deletions
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)
{