1 /*============================================================================
2 CMake - Cross Platform Makefile Generator
3 Copyright 2000-2009 Kitware, Inc.
5 Distributed under the OSI-approved BSD License (the "License");
6 see accompanying file Copyright.txt for details.
8 This software is distributed WITHOUT ANY WARRANTY; without even the
9 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 See the License for more information.
11 ============================================================================*/
13 #ifndef cmCPackNSISGenerator_h
14 #define cmCPackNSISGenerator_h
17 #include "cmCPackGenerator.h"
20 /** \class cmCPackNSISGenerator
21 * \brief A generator for NSIS files
23 * http://people.freebsd.org/~kientzle/libarchive/
25 class cmCPackNSISGenerator : public cmCPackGenerator
28 cmCPackTypeMacro(cmCPackNSISGenerator, cmCPackGenerator);
33 cmCPackNSISGenerator();
34 virtual ~cmCPackNSISGenerator();
37 virtual int InitializeInternal();
38 void CreateMenuLinks( cmOStringStream& str,
39 cmOStringStream& deleteStr);
41 virtual const char* GetOutputExtension() { return ".exe"; }
42 virtual const char* GetOutputPostfix() { return "win32"; }
44 bool GetListOfSubdirectories(const char* dir,
45 std::vector<std::string>& dirs);
47 enum cmCPackGenerator::CPackSetDestdirSupport SupportsSetDestdir() const;
48 virtual bool SupportsAbsoluteDestination() const;
49 virtual bool SupportsComponentInstallation() const;
51 /// Produce a string that contains the NSIS code to describe a
52 /// particular component. Any added macros will be emitted via
55 CreateComponentDescription(cmCPackComponent *component,
56 cmOStringStream& macrosOut);
58 /// Produce NSIS code that selects all of the components that this component
59 /// depends on, recursively.
60 std::string CreateSelectionDependenciesDescription
61 (cmCPackComponent *component,
62 std::set<cmCPackComponent *>& visited);
64 /// Produce NSIS code that de-selects all of the components that are
65 /// dependent on this component, recursively.
66 std::string CreateDeselectionDependenciesDescription
67 (cmCPackComponent *component,
68 std::set<cmCPackComponent *>& visited);
70 /// Produce a string that contains the NSIS code to describe a
71 /// particular component group, including its components. Any
72 /// added macros will be emitted via macrosOut.
74 CreateComponentGroupDescription(cmCPackComponentGroup *group,
75 cmOStringStream& macrosOut);
77 /// Translations any newlines found in the string into \\r\\n, so that the
78 /// resulting string can be used within NSIS.
79 static std::string TranslateNewlines(std::string str);