diff options
author | Michael Stürmer <michael.stuermer@schaeffler.com> | 2016-09-06 10:11:00 (GMT) |
---|---|---|
committer | Nils Gladitz <nilsgladitz@gmail.com> | 2016-09-06 15:44:48 (GMT) |
commit | 1bc33257d48bb4b54333b755951967c6c3fa1df6 (patch) | |
tree | 9279d779c344357821f3a5e199e8ca0410cec39d /Source/CPack/WiX/cmWIXSourceWriter.cxx | |
parent | 8317ea01aa3cf9319ef907e127fa6dbf9666cc53 (diff) | |
download | CMake-1bc33257d48bb4b54333b755951967c6c3fa1df6.zip CMake-1bc33257d48bb4b54333b755951967c6c3fa1df6.tar.gz CMake-1bc33257d48bb4b54333b755951967c6c3fa1df6.tar.bz2 |
CPackWIX: Fix incomplete CPACK_WIX_SKIP_PROGRAM_FOLDER implementation
Commit 17bbf6af (CPackWIX: Implement new CPACK_WIX_SKIP_PROGRAM_FOLDER
feature) generates GUIDs for most but not all components
when the feature is active.
Generate the remaining GUIDs as well.
Co-Author: Nils Gladitz <nilsgladitz@gmail.com>
Diffstat (limited to 'Source/CPack/WiX/cmWIXSourceWriter.cxx')
-rw-r--r-- | Source/CPack/WiX/cmWIXSourceWriter.cxx | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/Source/CPack/WiX/cmWIXSourceWriter.cxx b/Source/CPack/WiX/cmWIXSourceWriter.cxx index 2c0384e..a287424 100644 --- a/Source/CPack/WiX/cmWIXSourceWriter.cxx +++ b/Source/CPack/WiX/cmWIXSourceWriter.cxx @@ -14,19 +14,23 @@ #include <CPack/cmCPackGenerator.h> +#include <cmUuid.h> + #include <windows.h> cmWIXSourceWriter::cmWIXSourceWriter(cmCPackLog* logger, std::string const& filename, - bool isIncludeFile) + GuidType componentGuidType, + RootElementType rootElementType) : Logger(logger) , File(filename.c_str()) , State(DEFAULT) , SourceFilename(filename) + , ComponentGuidType(componentGuidType) { WriteXMLDeclaration(); - if (isIncludeFile) { + if (rootElementType == INCLUDE_ELEMENT_ROOT) { BeginElement("Include"); } else { BeginElement("Wix"); @@ -173,6 +177,19 @@ std::string cmWIXSourceWriter::CMakeEncodingToUtf8(std::string const& value) #endif } +std::string cmWIXSourceWriter::CreateGuidFromComponentId( + std::string const& componentId) +{ + std::string guid = "*"; + if (this->ComponentGuidType == CMAKE_GENERATED_GUID) { + std::string md5 = cmSystemTools::ComputeStringMD5(componentId); + cmUuid uuid; + std::vector<unsigned char> ns; + guid = uuid.FromMd5(ns, md5); + } + return guid; +} + void cmWIXSourceWriter::WriteXMLDeclaration() { File << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << std::endl; |