cmCPackNSISGenerator.h 2.8 KB

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