cmCPackNSISGenerator.h 2.7 KB

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