cmCPackNSISGenerator.h 3.0 KB

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