cmCPackDragNDropGenerator.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 cmCPackDragNDropGenerator_h
  11. #define cmCPackDragNDropGenerator_h
  12. #include "cmCPackGenerator.h"
  13. class cmGeneratedFileStream;
  14. /** \class cmCPackDragNDropGenerator
  15. * \brief A generator for OSX drag-n-drop installs
  16. */
  17. class cmCPackDragNDropGenerator : public cmCPackGenerator
  18. {
  19. public:
  20. cmCPackTypeMacro(cmCPackDragNDropGenerator, cmCPackGenerator);
  21. cmCPackDragNDropGenerator();
  22. virtual ~cmCPackDragNDropGenerator();
  23. protected:
  24. virtual int InitializeInternal();
  25. virtual const char* GetOutputExtension();
  26. int PackageFiles();
  27. bool SupportsComponentInstallation() const;
  28. bool CopyFile(std::ostringstream& source, std::ostringstream& target);
  29. bool CreateEmptyFile(std::ostringstream& target, size_t size);
  30. bool RunCommand(std::ostringstream& command, std::string* output = 0);
  31. std::string GetComponentInstallDirNameSuffix(
  32. const std::string& componentName);
  33. int CreateDMG(const std::string& src_dir, const std::string& output_file);
  34. std::string InstallPrefix;
  35. private:
  36. std::string slaDirectory;
  37. bool singleLicense;
  38. bool WriteLicense(cmGeneratedFileStream& outputStream, int licenseNumber,
  39. std::string licenseLanguage, std::string licenseFile,
  40. std::string* error);
  41. bool BreakLongLine(const std::string& line, std::vector<std::string>& lines,
  42. std::string* error);
  43. void EscapeQuotesAndBackslashes(std::string& line);
  44. };
  45. #endif