2016-10-30 18:24:19 +01:00
|
|
|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
2009-02-07 16:14:30 +02:00
|
|
|
#ifndef cmCPackDragNDropGenerator_h
|
|
|
|
#define cmCPackDragNDropGenerator_h
|
|
|
|
|
2018-01-26 17:06:56 +01:00
|
|
|
#include "cmConfigure.h" // IWYU pragma: keep
|
2017-07-20 19:35:53 +02:00
|
|
|
|
2017-04-14 19:02:05 +02:00
|
|
|
#include <sstream>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
2020-02-01 23:06:01 +01:00
|
|
|
#include <stddef.h>
|
|
|
|
|
2009-02-07 16:14:30 +02:00
|
|
|
#include "cmCPackGenerator.h"
|
|
|
|
|
2016-03-13 13:35:51 +01:00
|
|
|
class cmGeneratedFileStream;
|
|
|
|
|
2009-02-07 16:14:30 +02:00
|
|
|
/** \class cmCPackDragNDropGenerator
|
|
|
|
* \brief A generator for OSX drag-n-drop installs
|
|
|
|
*/
|
|
|
|
class cmCPackDragNDropGenerator : public cmCPackGenerator
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
cmCPackTypeMacro(cmCPackDragNDropGenerator, cmCPackGenerator);
|
|
|
|
|
|
|
|
cmCPackDragNDropGenerator();
|
2018-01-26 17:06:56 +01:00
|
|
|
~cmCPackDragNDropGenerator() override;
|
2009-02-07 16:14:30 +02:00
|
|
|
|
|
|
|
protected:
|
2018-01-26 17:06:56 +01:00
|
|
|
int InitializeInternal() override;
|
|
|
|
const char* GetOutputExtension() override;
|
|
|
|
int PackageFiles() override;
|
|
|
|
bool SupportsComponentInstallation() const override;
|
2011-06-19 15:41:06 +03:00
|
|
|
|
2015-04-27 22:25:09 +02:00
|
|
|
bool CopyFile(std::ostringstream& source, std::ostringstream& target);
|
2016-03-13 13:35:51 +01:00
|
|
|
bool CreateEmptyFile(std::ostringstream& target, size_t size);
|
2015-04-27 22:25:09 +02:00
|
|
|
bool RunCommand(std::ostringstream& command, std::string* output = 0);
|
2009-02-07 16:14:30 +02:00
|
|
|
|
2016-07-09 11:21:54 +02:00
|
|
|
std::string GetComponentInstallDirNameSuffix(
|
2018-01-26 17:06:56 +01:00
|
|
|
const std::string& componentName) override;
|
2011-06-19 15:41:06 +03:00
|
|
|
|
|
|
|
int CreateDMG(const std::string& src_dir, const std::string& output_file);
|
2009-10-04 10:30:41 +03:00
|
|
|
|
2016-03-13 13:35:51 +01:00
|
|
|
private:
|
|
|
|
std::string slaDirectory;
|
|
|
|
bool singleLicense;
|
|
|
|
|
|
|
|
bool WriteLicense(cmGeneratedFileStream& outputStream, int licenseNumber,
|
2018-01-26 17:06:56 +01:00
|
|
|
std::string licenseLanguage,
|
|
|
|
const std::string& licenseFile, std::string* error);
|
2016-07-09 11:21:54 +02:00
|
|
|
bool BreakLongLine(const std::string& line, std::vector<std::string>& lines,
|
|
|
|
std::string* error);
|
2016-03-13 13:35:51 +01:00
|
|
|
void EscapeQuotesAndBackslashes(std::string& line);
|
2009-02-07 16:14:30 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|