summaryrefslogtreecommitdiffstats
path: root/Source/CPack/WiX/cmWIXSourceWriter.h
diff options
context:
space:
mode:
authorNils Gladitz <gladitz@scivis.de>2012-10-03 14:08:49 (GMT)
committerDavid Cole <david.cole@kitware.com>2012-12-03 16:00:31 (GMT)
commit85baac1503c638756211ba07c4c25128e6d3d845 (patch)
treec10451adf45938e9bc6573d9edd09d4e3a67de67 /Source/CPack/WiX/cmWIXSourceWriter.h
parent581b0c0d078b5f07f68a53b118f44fc6e8313601 (diff)
downloadCMake-85baac1503c638756211ba07c4c25128e6d3d845.zip
CMake-85baac1503c638756211ba07c4c25128e6d3d845.tar.gz
CMake-85baac1503c638756211ba07c4c25128e6d3d845.tar.bz2
CPack: Add a WiX Generator (#11575)
This new CPack generator produces an *.msi installer file. Requires having the WiX Toolset installed in order to work properly. Download the WiX Toolset installer "WiX36.exe" here: http://wix.codeplex.com/releases/view/93929
Diffstat (limited to 'Source/CPack/WiX/cmWIXSourceWriter.h')
-rw-r--r--Source/CPack/WiX/cmWIXSourceWriter.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/Source/CPack/WiX/cmWIXSourceWriter.h b/Source/CPack/WiX/cmWIXSourceWriter.h
new file mode 100644
index 0000000..582554d
--- /dev/null
+++ b/Source/CPack/WiX/cmWIXSourceWriter.h
@@ -0,0 +1,67 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2012 Kitware, Inc.
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+
+#ifndef cmWIXSourceWriter_h
+#define cmWIXSourceWriter_h
+
+#include <vector>
+#include <string>
+#include <fstream>
+
+#include <CPack/cmCPackLog.h>
+
+/** \class cmWIXSourceWriter
+ * \brief Helper class to generate XML WiX source files
+ */
+class cmWIXSourceWriter
+{
+public:
+ cmWIXSourceWriter(cmCPackLog* logger,
+ const std::string& filename, bool isIncludeFile = false);
+
+ ~cmWIXSourceWriter();
+
+ void BeginElement(const std::string& name);
+
+ void EndElement();
+
+ void AddProcessingInstruction(
+ const std::string& target, const std::string& content);
+
+ void AddAttribute(
+ const std::string& key, const std::string& value);
+
+ static std::string WindowsCodepageToUtf8(const std::string& value);
+
+private:
+ enum State
+ {
+ DEFAULT,
+ BEGIN
+ };
+
+ void WriteXMLDeclaration();
+
+ void Indent(std::size_t count);
+
+ static std::string EscapeAttributeValue(const std::string& value);
+
+ std::ofstream file;
+
+ std::vector<std::string> elements;
+
+ State state;
+
+ cmCPackLog* Logger;
+};
+
+#endif