cmCPackNSISGenerator.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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 PackageFiles();
  33. virtual const char* GetOutputExtension() { return ".exe"; }
  34. virtual const char* GetOutputPostfix() { return "win32"; }
  35. bool GetListOfSubdirectories(const char* dir,
  36. std::vector<std::string>& dirs);
  37. enum cmCPackGenerator::CPackSetDestdirSupport SupportsSetDestdir() const;
  38. virtual bool SupportsAbsoluteDestination() const;
  39. virtual bool SupportsComponentInstallation() const;
  40. /// Produce a string that contains the NSIS code to describe a
  41. /// particular component. Any added macros will be emitted via
  42. /// macrosOut.
  43. std::string
  44. CreateComponentDescription(cmCPackComponent *component,
  45. cmOStringStream& macrosOut);
  46. /// Produce NSIS code that selects all of the components that this component
  47. /// depends on, recursively.
  48. std::string CreateSelectionDependenciesDescription
  49. (cmCPackComponent *component,
  50. std::set<cmCPackComponent *>& visited);
  51. /// Produce NSIS code that de-selects all of the components that are
  52. /// dependent on this component, recursively.
  53. std::string CreateDeselectionDependenciesDescription
  54. (cmCPackComponent *component,
  55. std::set<cmCPackComponent *>& visited);
  56. /// Produce a string that contains the NSIS code to describe a
  57. /// particular component group, including its components. Any
  58. /// added macros will be emitted via macrosOut.
  59. std::string
  60. CreateComponentGroupDescription(cmCPackComponentGroup *group,
  61. cmOStringStream& macrosOut);
  62. /// Translations any newlines found in the string into \\r\\n, so that the
  63. /// resulting string can be used within NSIS.
  64. static std::string TranslateNewlines(std::string str);
  65. };
  66. #endif