1 /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2 file Copyright.txt or https://cmake.org/licensing for details. */
5 #include "cmConfigure.h" // IWYU pragma: keep
10 #include "cmCPackGenerator.h"
12 /** \class cmCPackDebGenerator
13 * \brief A generator for Debian packages
16 class cmCPackDebGenerator
: public cmCPackGenerator
19 cmCPackTypeMacro(cmCPackDebGenerator
, cmCPackGenerator
);
24 cmCPackDebGenerator();
25 ~cmCPackDebGenerator() override
;
27 static bool CanGenerate()
30 // on MacOS enable CPackDeb iff dpkg is found
31 std::vector
<std::string
> locations
;
32 locations
.emplace_back("/sw/bin"); // Fink
33 locations
.emplace_back("/opt/local/bin"); // MacPorts
34 return !cmSystemTools::FindProgram("dpkg", locations
).empty();
36 // legacy behavior on other systems
42 int InitializeInternal() override
;
44 * This method factors out the work done in component packaging case.
46 int PackageOnePack(std::string
const& initialToplevel
,
47 std::string
const& packageName
);
49 * The method used to package files when component
50 * install is used. This will create one
51 * archive for each component group.
53 int PackageComponents(bool ignoreGroup
);
55 * Special case of component install where all
56 * components will be put in a single installer.
58 int PackageComponentsAllInOne(const std::string
& compInstDirName
);
59 int PackageFiles() override
;
60 const char* GetOutputExtension() override
{ return ".deb"; }
61 bool SupportsComponentInstallation() const override
;
62 std::string
GetComponentInstallSuffix(
63 const std::string
& componentName
) override
;
64 std::string
GetComponentInstallDirNameSuffix(
65 const std::string
& componentName
) override
;
68 bool createDebPackages();
70 bool createDbgsymDDeb();
72 std::vector
<std::string
> packageFiles
;