summaryrefslogtreecommitdiff
path: root/Source/CPack
diff options
context:
space:
mode:
Diffstat (limited to 'Source/CPack')
-rw-r--r--Source/CPack/IFW/cmCPackIFWCommon.cxx8
-rw-r--r--Source/CPack/IFW/cmCPackIFWCommon.h8
-rw-r--r--Source/CPack/IFW/cmCPackIFWInstaller.cxx51
-rw-r--r--Source/CPack/IFW/cmCPackIFWInstaller.h4
-rw-r--r--Source/CPack/IFW/cmCPackIFWPackage.cxx8
-rw-r--r--Source/CPack/IFW/cmCPackIFWPackage.h2
-rw-r--r--Source/CPack/IFW/cmCPackIFWRepository.cxx10
-rw-r--r--Source/CPack/IFW/cmCPackIFWRepository.h4
-rw-r--r--Source/CPack/cmCPackArchiveGenerator.cxx67
-rw-r--r--Source/CPack/cmCPackComponentGroup.cxx2
-rw-r--r--Source/CPack/cmCPackDebGenerator.cxx221
-rw-r--r--Source/CPack/cmCPackExternalGenerator.cxx10
-rw-r--r--Source/CPack/cmCPackGenerator.cxx67
-rw-r--r--Source/CPack/cmCPackNSISGenerator.cxx51
-rw-r--r--Source/CPack/cmCPackNuGetGenerator.cxx23
-rw-r--r--Source/CPack/cmCPackRPMGenerator.cxx65
-rw-r--r--Source/CPack/cmCPackSTGZGenerator.cxx2
17 files changed, 358 insertions, 245 deletions
diff --git a/Source/CPack/IFW/cmCPackIFWCommon.cxx b/Source/CPack/IFW/cmCPackIFWCommon.cxx
index 20d392d211..87ebbfeb9c 100644
--- a/Source/CPack/IFW/cmCPackIFWCommon.cxx
+++ b/Source/CPack/IFW/cmCPackIFWCommon.cxx
@@ -44,7 +44,7 @@ bool cmCPackIFWCommon::IsSetToEmpty(const std::string& op) const
: false;
}
-bool cmCPackIFWCommon::IsVersionLess(const char* version)
+bool cmCPackIFWCommon::IsVersionLess(const char* version) const
{
if (!this->Generator) {
return false;
@@ -54,7 +54,7 @@ bool cmCPackIFWCommon::IsVersionLess(const char* version)
cmSystemTools::OP_LESS, this->Generator->FrameworkVersion.data(), version);
}
-bool cmCPackIFWCommon::IsVersionGreater(const char* version)
+bool cmCPackIFWCommon::IsVersionGreater(const char* version) const
{
if (!this->Generator) {
return false;
@@ -65,7 +65,7 @@ bool cmCPackIFWCommon::IsVersionGreater(const char* version)
version);
}
-bool cmCPackIFWCommon::IsVersionEqual(const char* version)
+bool cmCPackIFWCommon::IsVersionEqual(const char* version) const
{
if (!this->Generator) {
return false;
@@ -118,7 +118,7 @@ void cmCPackIFWCommon::ExpandListArgument(
}
}
-void cmCPackIFWCommon::WriteGeneratedByToStrim(cmXMLWriter& xout)
+void cmCPackIFWCommon::WriteGeneratedByToStrim(cmXMLWriter& xout) const
{
if (!this->Generator) {
return;
diff --git a/Source/CPack/IFW/cmCPackIFWCommon.h b/Source/CPack/IFW/cmCPackIFWCommon.h
index 95ed21370e..42deda4eab 100644
--- a/Source/CPack/IFW/cmCPackIFWCommon.h
+++ b/Source/CPack/IFW/cmCPackIFWCommon.h
@@ -34,17 +34,17 @@ public:
/**
* Compare \a version with QtIFW framework version
*/
- bool IsVersionLess(const char* version);
+ bool IsVersionLess(const char* version) const;
/**
* Compare \a version with QtIFW framework version
*/
- bool IsVersionGreater(const char* version);
+ bool IsVersionGreater(const char* version) const;
/**
* Compare \a version with QtIFW framework version
*/
- bool IsVersionEqual(const char* version);
+ bool IsVersionEqual(const char* version) const;
/** Expand the list argument containing the map of the key-value pairs.
* If the number of elements is odd, then the first value is used as the
@@ -64,7 +64,7 @@ public:
cmCPackIFWGenerator* Generator;
protected:
- void WriteGeneratedByToStrim(cmXMLWriter& xout);
+ void WriteGeneratedByToStrim(cmXMLWriter& xout) const;
};
#define cmCPackIFWLogger(logType, msg) \
diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.cxx b/Source/CPack/IFW/cmCPackIFWInstaller.cxx
index 4bad598e97..bf8b457b4a 100644
--- a/Source/CPack/IFW/cmCPackIFWInstaller.cxx
+++ b/Source/CPack/IFW/cmCPackIFWInstaller.cxx
@@ -66,7 +66,7 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
this->GetOption("CPACK_IFW_PACKAGE_PUBLISHER")) {
this->Publisher = optIFW_PACKAGE_PUBLISHER;
} else if (const char* optPACKAGE_VENDOR =
- GetOption("CPACK_PACKAGE_VENDOR")) {
+ this->GetOption("CPACK_PACKAGE_VENDOR")) {
this->Publisher = optPACKAGE_VENDOR;
}
@@ -174,6 +174,35 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
this->WizardDefaultHeight = option;
}
+ // WizardShowPageList
+ if (const char* option =
+ this->GetOption("CPACK_IFW_PACKAGE_WIZARD_SHOW_PAGE_LIST")) {
+ if (!this->IsVersionLess("4.0")) {
+ if (this->IsSetToOff("CPACK_IFW_PACKAGE_WIZARD_SHOW_PAGE_LIST")) {
+ this->WizardShowPageList = "false";
+ } else if (this->IsOn("CPACK_IFW_PACKAGE_WIZARD_SHOW_PAGE_LIST")) {
+ this->WizardShowPageList = "true";
+ } else {
+ this->WizardShowPageList.clear();
+ }
+ } else {
+ std::string currentVersionMsg;
+ if (this->Generator) {
+ currentVersionMsg =
+ "QtIFW version " + this->Generator->FrameworkVersion;
+ } else {
+ currentVersionMsg = "an older QtIFW version";
+ }
+ cmCPackIFWLogger(
+ WARNING,
+ "Option CPACK_IFW_PACKAGE_WIZARD_SHOW_PAGE_LIST is set to \""
+ << option
+ << "\", but it is only supported with QtIFW version 4.0 or later. "
+ "It is being ignored because you are using "
+ << currentVersionMsg << std::endl);
+ }
+ }
+
// TitleColor
if (const char* option = this->GetOption("CPACK_IFW_PACKAGE_TITLE_COLOR")) {
this->TitleColor = option;
@@ -184,7 +213,7 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
this->GetOption("CPACK_IFW_PACKAGE_START_MENU_DIRECTORY")) {
this->StartMenuDir = optIFW_START_MENU_DIR;
} else {
- this->StartMenuDir = Name;
+ this->StartMenuDir = this->Name;
}
// Default target directory for installation
@@ -255,9 +284,8 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
class cmCPackIFWResourcesParser : public cmXMLParser
{
public:
- cmCPackIFWResourcesParser(cmCPackIFWInstaller* i)
+ explicit cmCPackIFWResourcesParser(cmCPackIFWInstaller* i)
: installer(i)
- , file(false)
{
this->path = i->Directory + "/resources";
}
@@ -276,14 +304,16 @@ public:
}
cmCPackIFWInstaller* installer;
- bool file, hasFiles, hasErrors;
+ bool file = false;
+ bool hasFiles = false;
+ bool hasErrors = false;
std::string path, basePath;
protected:
void StartElement(const std::string& name, const char** /*atts*/) override
{
this->file = name == "file";
- if (file) {
+ if (this->file) {
this->hasFiles = true;
}
}
@@ -317,7 +347,7 @@ void cmCPackIFWInstaller::GenerateInstallerFile()
xout.StartDocument();
- WriteGeneratedByToStrim(xout);
+ this->WriteGeneratedByToStrim(xout);
xout.StartElement("Installer");
@@ -408,6 +438,11 @@ void cmCPackIFWInstaller::GenerateInstallerFile()
xout.Element("WizardDefaultHeight", this->WizardDefaultHeight);
}
+ // WizardShowPageList
+ if (!this->IsVersionLess("4.0") && !this->WizardShowPageList.empty()) {
+ xout.Element("WizardShowPageList", this->WizardShowPageList);
+ }
+
// TitleColor
if (!this->TitleColor.empty()) {
xout.Element("TitleColor", this->TitleColor);
@@ -510,7 +545,7 @@ void cmCPackIFWInstaller::GeneratePackageFiles()
package.ConfigureFromGroup(option);
std::string forcedOption = "CPACK_IFW_COMPONENT_GROUP_" +
cmsys::SystemTools::UpperCase(option) + "_FORCED_INSTALLATION";
- if (!GetOption(forcedOption)) {
+ if (!this->GetOption(forcedOption)) {
package.ForcedInstallation = "true";
}
} else {
diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.h b/Source/CPack/IFW/cmCPackIFWInstaller.h
index 6f398e308b..a031fc268b 100644
--- a/Source/CPack/IFW/cmCPackIFWInstaller.h
+++ b/Source/CPack/IFW/cmCPackIFWInstaller.h
@@ -80,6 +80,10 @@ public:
/// Wizard height
std::string WizardDefaultHeight;
+ /// Set to false if the widget listing installer pages on the left side
+ /// of the wizard should not be shown
+ std::string WizardShowPageList;
+
/// Title color
std::string TitleColor;
diff --git a/Source/CPack/IFW/cmCPackIFWPackage.cxx b/Source/CPack/IFW/cmCPackIFWPackage.cxx
index 56a74c58b9..c4bd7f115b 100644
--- a/Source/CPack/IFW/cmCPackIFWPackage.cxx
+++ b/Source/CPack/IFW/cmCPackIFWPackage.cxx
@@ -337,7 +337,7 @@ int cmCPackIFWPackage::ConfigureFromGroup(const std::string& groupName)
group.Name = groupName;
- if (Generator) {
+ if (this->Generator) {
this->Name = this->Generator->GetGroupPackageName(&group);
} else {
this->Name = group.Name;
@@ -530,7 +530,7 @@ void cmCPackIFWPackage::GeneratePackageFile()
xout.StartDocument();
- WriteGeneratedByToStrim(xout);
+ this->WriteGeneratedByToStrim(xout);
xout.StartElement("Package");
@@ -577,7 +577,7 @@ void cmCPackIFWPackage::GeneratePackageFile()
}
// User Interfaces (copy to meta dir)
- std::vector<std::string> userInterfaces = UserInterfaces;
+ std::vector<std::string> userInterfaces = this->UserInterfaces;
for (std::string& userInterface : userInterfaces) {
std::string name = cmSystemTools::GetFilenameName(userInterface);
std::string path = this->Directory + "/meta/" + name;
@@ -593,7 +593,7 @@ void cmCPackIFWPackage::GeneratePackageFile()
}
// Translations (copy to meta dir)
- std::vector<std::string> translations = Translations;
+ std::vector<std::string> translations = this->Translations;
for (std::string& translation : translations) {
std::string name = cmSystemTools::GetFilenameName(translation);
std::string path = this->Directory + "/meta/" + name;
diff --git a/Source/CPack/IFW/cmCPackIFWPackage.h b/Source/CPack/IFW/cmCPackIFWPackage.h
index dbd554054a..0cc6f2fdf8 100644
--- a/Source/CPack/IFW/cmCPackIFWPackage.h
+++ b/Source/CPack/IFW/cmCPackIFWPackage.h
@@ -53,7 +53,7 @@ public:
bool operator<(const DependenceStruct& other) const
{
- return Name < other.Name;
+ return this->Name < other.Name;
}
};
diff --git a/Source/CPack/IFW/cmCPackIFWRepository.cxx b/Source/CPack/IFW/cmCPackIFWRepository.cxx
index f5e87443be..7ec2256860 100644
--- a/Source/CPack/IFW/cmCPackIFWRepository.cxx
+++ b/Source/CPack/IFW/cmCPackIFWRepository.cxx
@@ -46,9 +46,9 @@ bool cmCPackIFWRepository::ConfigureFromOptions()
// Update
if (this->IsOn(prefix + "ADD")) {
this->Update = cmCPackIFWRepository::Add;
- } else if (IsOn(prefix + "REMOVE")) {
+ } else if (this->IsOn(prefix + "REMOVE")) {
this->Update = cmCPackIFWRepository::Remove;
- } else if (IsOn(prefix + "REPLACE")) {
+ } else if (this->IsOn(prefix + "REPLACE")) {
this->Update = cmCPackIFWRepository::Replace;
} else {
this->Update = cmCPackIFWRepository::None;
@@ -199,7 +199,7 @@ bool cmCPackIFWRepository::PatchUpdatesXml()
return cmSystemTools::RenameFile(updatesPatchXml, updatesXml);
}
-void cmCPackIFWRepository::WriteRepositoryConfig(cmXMLWriter& xout)
+void cmCPackIFWRepository::WriteRepositoryConfig(cmXMLWriter& xout) const
{
xout.StartElement("Repository");
@@ -225,7 +225,7 @@ void cmCPackIFWRepository::WriteRepositoryConfig(cmXMLWriter& xout)
xout.EndElement();
}
-void cmCPackIFWRepository::WriteRepositoryUpdate(cmXMLWriter& xout)
+void cmCPackIFWRepository::WriteRepositoryUpdate(cmXMLWriter& xout) const
{
xout.StartElement("Repository");
@@ -247,7 +247,7 @@ void cmCPackIFWRepository::WriteRepositoryUpdate(cmXMLWriter& xout)
if (this->Update == cmCPackIFWRepository::Add ||
this->Update == cmCPackIFWRepository::Remove) {
xout.Attribute("url", this->Url);
- } else if (Update == cmCPackIFWRepository::Replace) {
+ } else if (this->Update == cmCPackIFWRepository::Replace) {
xout.Attribute("oldUrl", this->OldUrl);
xout.Attribute("newUrl", this->NewUrl);
}
diff --git a/Source/CPack/IFW/cmCPackIFWRepository.h b/Source/CPack/IFW/cmCPackIFWRepository.h
index 21afd8bdb1..015345240f 100644
--- a/Source/CPack/IFW/cmCPackIFWRepository.h
+++ b/Source/CPack/IFW/cmCPackIFWRepository.h
@@ -76,8 +76,8 @@ public:
bool PatchUpdatesXml();
- void WriteRepositoryConfig(cmXMLWriter& xout);
- void WriteRepositoryUpdate(cmXMLWriter& xout);
+ void WriteRepositoryConfig(cmXMLWriter& xout) const;
+ void WriteRepositoryUpdate(cmXMLWriter& xout) const;
void WriteRepositoryUpdates(cmXMLWriter& xout);
RepositoriesVector RepositoryUpdate;
diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx
index 967cc6060f..7fd12dd4c1 100644
--- a/Source/CPack/cmCPackArchiveGenerator.cxx
+++ b/Source/CPack/cmCPackArchiveGenerator.cxx
@@ -80,10 +80,10 @@ std::string cmCPackArchiveGenerator::GetArchiveComponentFileName(
packageFileName +=
this->GetOption("CPACK_ARCHIVE_" + componentUpper + "_FILE_NAME");
} else if (this->IsSet("CPACK_ARCHIVE_FILE_NAME")) {
- packageFileName += GetComponentPackageFileName(
+ packageFileName += this->GetComponentPackageFileName(
this->GetOption("CPACK_ARCHIVE_FILE_NAME"), component, isGroupName);
} else {
- packageFileName += GetComponentPackageFileName(
+ packageFileName += this->GetComponentPackageFileName(
this->GetOption("CPACK_PACKAGE_FILE_NAME"), component, isGroupName);
}
@@ -181,7 +181,7 @@ int cmCPackArchiveGenerator::addOneComponentToArchive(
int cmCPackArchiveGenerator::PackageComponents(bool ignoreGroup)
{
- packageFileNames.clear();
+ this->packageFileNames.clear();
// The default behavior is to have one package by component group
// unless CPACK_COMPONENTS_IGNORE_GROUP is specified.
if (!ignoreGroup) {
@@ -189,7 +189,7 @@ int cmCPackArchiveGenerator::PackageComponents(bool ignoreGroup)
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"Packaging component group: " << compG.first << std::endl);
// Begin the archive for this group
- std::string packageFileName = std::string(toplevel) + "/" +
+ std::string packageFileName = std::string(this->toplevel) + "/" +
this->GetArchiveComponentFileName(compG.first, true);
// open a block in order to automatically close archive
@@ -199,11 +199,11 @@ int cmCPackArchiveGenerator::PackageComponents(bool ignoreGroup)
// now iterate over the component of this group
for (cmCPackComponent* comp : (compG.second).Components) {
// Add the files of this component to the archive
- addOneComponentToArchive(archive, comp);
+ this->addOneComponentToArchive(archive, comp);
}
}
// add the generated package to package file names list
- packageFileNames.push_back(std::move(packageFileName));
+ this->packageFileNames.push_back(std::move(packageFileName));
}
// Handle Orphan components (components not belonging to any groups)
for (auto& comp : this->Components) {
@@ -217,7 +217,7 @@ int cmCPackArchiveGenerator::PackageComponents(bool ignoreGroup)
<< std::endl);
std::string localToplevel(
this->GetOption("CPACK_TEMPORARY_DIRECTORY"));
- std::string packageFileName = std::string(toplevel);
+ std::string packageFileName = std::string(this->toplevel);
localToplevel += "/" + comp.first;
packageFileName +=
@@ -226,10 +226,10 @@ int cmCPackArchiveGenerator::PackageComponents(bool ignoreGroup)
{
DECLARE_AND_OPEN_ARCHIVE(packageFileName, archive);
// Add the files of this component to the archive
- addOneComponentToArchive(archive, &(comp.second));
+ this->addOneComponentToArchive(archive, &(comp.second));
}
// add the generated package to package file names list
- packageFileNames.push_back(std::move(packageFileName));
+ this->packageFileNames.push_back(std::move(packageFileName));
}
}
}
@@ -238,7 +238,7 @@ int cmCPackArchiveGenerator::PackageComponents(bool ignoreGroup)
else {
for (auto& comp : this->Components) {
std::string localToplevel(this->GetOption("CPACK_TEMPORARY_DIRECTORY"));
- std::string packageFileName = std::string(toplevel);
+ std::string packageFileName = std::string(this->toplevel);
localToplevel += "/" + comp.first;
packageFileName +=
@@ -247,10 +247,10 @@ int cmCPackArchiveGenerator::PackageComponents(bool ignoreGroup)
{
DECLARE_AND_OPEN_ARCHIVE(packageFileName, archive);
// Add the files of this component to the archive
- addOneComponentToArchive(archive, &(comp.second));
+ this->addOneComponentToArchive(archive, &(comp.second));
}
// add the generated package to package file names list
- packageFileNames.push_back(std::move(packageFileName));
+ this->packageFileNames.push_back(std::move(packageFileName));
}
}
return 1;
@@ -259,17 +259,17 @@ int cmCPackArchiveGenerator::PackageComponents(bool ignoreGroup)
int cmCPackArchiveGenerator::PackageComponentsAllInOne()
{
// reset the package file names
- packageFileNames.clear();
- packageFileNames.emplace_back(toplevel);
- packageFileNames[0] += "/";
+ this->packageFileNames.clear();
+ this->packageFileNames.emplace_back(this->toplevel);
+ this->packageFileNames[0] += "/";
if (this->IsSet("CPACK_ARCHIVE_FILE_NAME")) {
- packageFileNames[0] += this->GetOption("CPACK_ARCHIVE_FILE_NAME");
+ this->packageFileNames[0] += this->GetOption("CPACK_ARCHIVE_FILE_NAME");
} else {
- packageFileNames[0] += this->GetOption("CPACK_PACKAGE_FILE_NAME");
+ this->packageFileNames[0] += this->GetOption("CPACK_PACKAGE_FILE_NAME");
}
- packageFileNames[0] += this->GetOutputExtension();
+ this->packageFileNames[0] += this->GetOutputExtension();
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"Packaging all groups in one package..."
@@ -280,7 +280,7 @@ int cmCPackArchiveGenerator::PackageComponentsAllInOne()
// The ALL COMPONENTS in ONE package case
for (auto& comp : this->Components) {
// Add the files of this component to the archive
- addOneComponentToArchive(archive, &(comp.second));
+ this->addOneComponentToArchive(archive, &(comp.second));
}
// archive goes out of scope so it will finalized and closed.
@@ -289,41 +289,42 @@ int cmCPackArchiveGenerator::PackageComponentsAllInOne()
int cmCPackArchiveGenerator::PackageFiles()
{
- cmCPackLogger(cmCPackLog::LOG_DEBUG, "Toplevel: " << toplevel << std::endl);
+ cmCPackLogger(cmCPackLog::LOG_DEBUG,
+ "Toplevel: " << this->toplevel << std::endl);
- if (WantsComponentInstallation()) {
+ if (this->WantsComponentInstallation()) {
// CASE 1 : COMPONENT ALL-IN-ONE package
// If ALL COMPONENTS in ONE package has been requested
// then the package file is unique and should be open here.
- if (componentPackageMethod == ONE_PACKAGE) {
- return PackageComponentsAllInOne();
+ if (this->componentPackageMethod == ONE_PACKAGE) {
+ return this->PackageComponentsAllInOne();
}
// CASE 2 : COMPONENT CLASSICAL package(s) (i.e. not all-in-one)
// There will be 1 package for each component group
// however one may require to ignore component group and
// in this case you'll get 1 package for each component.
- return PackageComponents(componentPackageMethod ==
- ONE_PACKAGE_PER_COMPONENT);
+ return this->PackageComponents(this->componentPackageMethod ==
+ ONE_PACKAGE_PER_COMPONENT);
}
// CASE 3 : NON COMPONENT package.
DECLARE_AND_OPEN_ARCHIVE(packageFileNames[0], archive);
- cmWorkingDirectory workdir(toplevel);
+ cmWorkingDirectory workdir(this->toplevel);
if (workdir.Failed()) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Failed to change working directory to "
- << toplevel << " : "
+ << this->toplevel << " : "
<< std::strerror(workdir.GetLastResult()) << std::endl);
return 0;
}
- for (std::string const& file : files) {
+ for (std::string const& file : this->files) {
// Get the relative path to the file
- std::string rp = cmSystemTools::RelativePath(toplevel, file);
+ std::string rp = cmSystemTools::RelativePath(this->toplevel, file);
archive.Add(rp, 0, nullptr, false);
if (!archive) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem while adding file <"
- << file << "> to archive <" << packageFileNames[0]
+ << file << "> to archive <" << this->packageFileNames[0]
<< ">, ERROR = " << archive.GetError() << std::endl);
return 0;
}
@@ -342,7 +343,7 @@ bool cmCPackArchiveGenerator::SupportsComponentInstallation() const
// The Component installation support should only
// be activated if explicitly requested by the user
// (for backward compatibility reason)
- return IsOn("CPACK_ARCHIVE_COMPONENT_INSTALL");
+ return this->IsOn("CPACK_ARCHIVE_COMPONENT_INSTALL");
}
bool cmCPackArchiveGenerator::SetArchiveOptions(cmArchiveWrite* archive)
@@ -352,8 +353,12 @@ bool cmCPackArchiveGenerator::SetArchiveOptions(cmArchiveWrite* archive)
// cause spurious errors to be raised from `strtoull`.
if (this->Compress == cmArchiveWrite::CompressXZ) {
const char* threads = "1";
+
+ // CPACK_ARCHIVE_THREADS overrides CPACK_THREADS
if (this->IsSet("CPACK_ARCHIVE_THREADS")) {
threads = this->GetOption("CPACK_ARCHIVE_THREADS");
+ } else if (this->IsSet("CPACK_THREADS")) {
+ threads = this->GetOption("CPACK_THREADS");
}
if (!archive->SetFilterOption("xz", "threads", threads)) {
diff --git a/Source/CPack/cmCPackComponentGroup.cxx b/Source/CPack/cmCPackComponentGroup.cxx
index d40e5fcf84..4305c7eb2d 100644
--- a/Source/CPack/cmCPackComponentGroup.cxx
+++ b/Source/CPack/cmCPackComponentGroup.cxx
@@ -25,6 +25,6 @@ unsigned long cmCPackComponent::GetInstalledSize(
unsigned long cmCPackComponent::GetInstalledSizeInKbytes(
const std::string& installDir) const
{
- unsigned long result = (GetInstalledSize(installDir) + 512) / 1024;
+ unsigned long result = (this->GetInstalledSize(installDir) + 512) / 1024;
return result ? result : 1;
}
diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx
index 560e5c1dc5..e7bcfaca4f 100644
--- a/Source/CPack/cmCPackDebGenerator.cxx
+++ b/Source/CPack/cmCPackDebGenerator.cxx
@@ -2,6 +2,7 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCPackDebGenerator.h"
+#include <cstdlib>
#include <cstring>
#include <map>
#include <ostream>
@@ -28,7 +29,7 @@ class DebGenerator
public:
DebGenerator(cmCPackLog* logger, std::string outputName, std::string workDir,
std::string topLevelDir, std::string temporaryDir,
- const char* debianCompressionType,
+ const char* debianCompressionType, const char* numThreads,
const char* debianArchiveType,
std::map<std::string, std::string> controlValues,
bool genShLibs, std::string shLibsFilename, bool genPostInst,
@@ -53,6 +54,7 @@ private:
const std::string TopLevelDir;
const std::string TemporaryDir;
const char* DebianArchiveType;
+ int NumThreads;
const std::map<std::string, std::string> ControlValues;
const bool GenShLibs;
const std::string ShLibsFilename;
@@ -69,7 +71,8 @@ private:
DebGenerator::DebGenerator(
cmCPackLog* logger, std::string outputName, std::string workDir,
std::string topLevelDir, std::string temporaryDir,
- const char* debianCompressionType, const char* debianArchiveType,
+ const char* debianCompressionType, const char* numThreads,
+ const char* debianArchiveType,
std::map<std::string, std::string> controlValues, bool genShLibs,
std::string shLibsFilename, bool genPostInst, std::string postInst,
bool genPostRm, std::string postRm, const char* controlExtra,
@@ -96,45 +99,62 @@ DebGenerator::DebGenerator(
}
if (!strcmp(debianCompressionType, "lzma")) {
- CompressionSuffix = ".lzma";
- TarCompressionType = cmArchiveWrite::CompressLZMA;
+ this->CompressionSuffix = ".lzma";
+ this->TarCompressionType = cmArchiveWrite::CompressLZMA;
} else if (!strcmp(debianCompressionType, "xz")) {
- CompressionSuffix = ".xz";
- TarCompressionType = cmArchiveWrite::CompressXZ;
+ this->CompressionSuffix = ".xz";
+ this->TarCompressionType = cmArchiveWrite::CompressXZ;
} else if (!strcmp(debianCompressionType, "bzip2")) {
- CompressionSuffix = ".bz2";
- TarCompressionType = cmArchiveWrite::CompressBZip2;
+ this->CompressionSuffix = ".bz2";
+ this->TarCompressionType = cmArchiveWrite::CompressBZip2;
} else if (!strcmp(debianCompressionType, "gzip")) {
- CompressionSuffix = ".gz";
- TarCompressionType = cmArchiveWrite::CompressGZip;
+ this->CompressionSuffix = ".gz";
+ this->TarCompressionType = cmArchiveWrite::CompressGZip;
} else if (!strcmp(debianCompressionType, "none")) {
- CompressionSuffix.clear();
- TarCompressionType = cmArchiveWrite::CompressNone;
+ this->CompressionSuffix.clear();
+ this->TarCompressionType = cmArchiveWrite::CompressNone;
} else {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Error unrecognized compression type: "
<< debianCompressionType << std::endl);
}
+
+ if (numThreads == nullptr) {
+ numThreads = "1";
+ }
+
+ char* endptr;
+ this->NumThreads = static_cast<int>(strtol(numThreads, &endptr, 10));
+ if (numThreads != endptr && *endptr != '\0') {
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "Unrecognized number of threads: " << numThreads
+ << std::endl);
+ }
+
+ if (this->NumThreads < 0) {
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "Number of threads cannot be negative" << std::endl);
+ }
}
bool DebGenerator::generate() const
{
- generateDebianBinaryFile();
- generateControlFile();
- if (!generateDataTar()) {
+ this->generateDebianBinaryFile();
+ this->generateControlFile();
+ if (!this->generateDataTar()) {
return false;
}
- std::string md5Filename = generateMD5File();
- if (!generateControlTar(md5Filename)) {
+ std::string md5Filename = this->generateMD5File();
+ if (!this->generateControlTar(md5Filename)) {
return false;
}
- return generateDeb();
+ return this->generateDeb();
}
void DebGenerator::generateDebianBinaryFile() const
{
// debian-binary file
- const std::string dbfilename = WorkDir + "/debian-binary";
+ const std::string dbfilename = this->WorkDir + "/debian-binary";
cmGeneratedFileStream out;
out.Open(dbfilename, false, true);
out << "2.0\n"; // required for valid debian package
@@ -142,18 +162,18 @@ void DebGenerator::generateDebianBinaryFile() const
void DebGenerator::generateControlFile() const
{
- std::string ctlfilename = WorkDir + "/control";
+ std::string ctlfilename = this->WorkDir + "/control";
cmGeneratedFileStream out;
out.Open(ctlfilename, false, true);
- for (auto const& kv : ControlValues) {
+ for (auto const& kv : this->ControlValues) {
out << kv.first << ": " << kv.second << "\n";
}
unsigned long totalSize = 0;
{
- std::string dirName = cmStrCat(TemporaryDir, '/');
- for (std::string const& file : PackageFiles) {
+ std::string dirName = cmStrCat(this->TemporaryDir, '/');
+ for (std::string const& file : this->PackageFiles) {
totalSize += cmSystemTools::FileLength(file);
}
}
@@ -162,7 +182,8 @@ void DebGenerator::generateControlFile() const
bool DebGenerator::generateDataTar() const
{
- std::string filename_data_tar = WorkDir + "/data.tar" + CompressionSuffix;
+ std::string filename_data_tar =
+ this->WorkDir + "/data.tar" + this->CompressionSuffix;
cmGeneratedFileStream fileStream_data_tar;
fileStream_data_tar.Open(filename_data_tar, false, true);
if (!fileStream_data_tar) {
@@ -171,8 +192,8 @@ bool DebGenerator::generateDataTar() const
<< filename_data_tar << "\" for writing" << std::endl);
return false;
}
- cmArchiveWrite data_tar(fileStream_data_tar, TarCompressionType,
- DebianArchiveType);
+ cmArchiveWrite data_tar(fileStream_data_tar, this->TarCompressionType,
+ this->DebianArchiveType, 0, this->NumThreads);
data_tar.Open();
// uid/gid should be the one of the root user, and this root user has
@@ -184,16 +205,16 @@ bool DebGenerator::generateDataTar() const
// collect all top level install dirs for that
// e.g. /opt/bin/foo, /usr/bin/bar and /usr/bin/baz would
// give /usr and /opt
- size_t topLevelLength = WorkDir.length();
+ size_t topLevelLength = this->WorkDir.length();
cmCPackLogger(cmCPackLog::LOG_DEBUG,
- "WDIR: \"" << WorkDir << "\", length = " << topLevelLength
- << std::endl);
+ "WDIR: \"" << this->WorkDir
+ << "\", length = " << topLevelLength << std::endl);
std::set<std::string> orderedFiles;
// we have to reconstruct the parent folders as well
- for (std::string currentPath : PackageFiles) {
- while (currentPath != WorkDir) {
+ for (std::string currentPath : this->PackageFiles) {
+ while (currentPath != this->WorkDir) {
// the last one IS WorkDir, but we do not want this one:
// XXX/application/usr/bin/myprogram with GEN_WDIR=XXX/application
// should not add XXX/application
@@ -235,7 +256,7 @@ bool DebGenerator::generateDataTar() const
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem adding file to tar:"
<< std::endl
- << "#top level directory: " << WorkDir << std::endl
+ << "#top level directory: " << this->WorkDir << std::endl
<< "#file: " << file << std::endl
<< "#error:" << data_tar.GetError() << std::endl);
return false;
@@ -246,13 +267,13 @@ bool DebGenerator::generateDataTar() const
std::string DebGenerator::generateMD5File() const
{
- std::string md5filename = WorkDir + "/md5sums";
+ std::string md5filename = this->WorkDir + "/md5sums";
cmGeneratedFileStream out;
out.Open(md5filename, false, true);
- std::string topLevelWithTrailingSlash = cmStrCat(TemporaryDir, '/');
- for (std::string const& file : PackageFiles) {
+ std::string topLevelWithTrailingSlash = cmStrCat(this->TemporaryDir, '/');
+ for (std::string const& file : this->PackageFiles) {
// hash only regular files
if (cmSystemTools::FileIsDirectory(file) ||
cmSystemTools::FileIsSymlink(file)) {
@@ -281,7 +302,7 @@ std::string DebGenerator::generateMD5File() const
bool DebGenerator::generateControlTar(std::string const& md5Filename) const
{
- std::string filename_control_tar = WorkDir + "/control.tar.gz";
+ std::string filename_control_tar = this->WorkDir + "/control.tar.gz";
cmGeneratedFileStream fileStream_control_tar;
fileStream_control_tar.Open(filename_control_tar, false, true);
@@ -292,7 +313,8 @@ bool DebGenerator::generateControlTar(std::string const& md5Filename) const
return false;
}
cmArchiveWrite control_tar(fileStream_control_tar,
- cmArchiveWrite::CompressGZip, DebianArchiveType);
+ cmArchiveWrite::CompressGZip,
+ this->DebianArchiveType);
control_tar.Open();
// sets permissions and uid/gid for the files
@@ -314,24 +336,25 @@ bool DebGenerator::generateControlTar(std::string const& md5Filename) const
control_tar.SetPermissions(permission644);
// adds control and md5sums
- if (!control_tar.Add(md5Filename, WorkDir.length(), ".") ||
- !control_tar.Add(WorkDir + "/control", WorkDir.length(), ".")) {
+ if (!control_tar.Add(md5Filename, this->WorkDir.length(), ".") ||
+ !control_tar.Add(this->WorkDir + "/control", this->WorkDir.length(),
+ ".")) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Error adding file to tar:"
<< std::endl
- << "#top level directory: " << WorkDir << std::endl
+ << "#top level directory: " << this->WorkDir << std::endl
<< "#file: \"control\" or \"md5sums\"" << std::endl
<< "#error:" << control_tar.GetError() << std::endl);
return false;
}
// adds generated shlibs file
- if (GenShLibs) {
- if (!control_tar.Add(ShLibsFilename, WorkDir.length(), ".")) {
+ if (this->GenShLibs) {
+ if (!control_tar.Add(this->ShLibsFilename, this->WorkDir.length(), ".")) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Error adding file to tar:"
<< std::endl
- << "#top level directory: " << WorkDir << std::endl
+ << "#top level directory: " << this->WorkDir << std::endl
<< "#file: \"shlibs\"" << std::endl
<< "#error:" << control_tar.GetError() << std::endl);
return false;
@@ -339,13 +362,13 @@ bool DebGenerator::generateControlTar(std::string const& md5Filename) const
}
// adds LDCONFIG related files
- if (GenPostInst) {
+ if (this->GenPostInst) {
control_tar.SetPermissions(permission755);
- if (!control_tar.Add(PostInst, WorkDir.length(), ".")) {
+ if (!control_tar.Add(this->PostInst, this->WorkDir.length(), ".")) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Error adding file to tar:"
<< std::endl
- << "#top level directory: " << WorkDir << std::endl
+ << "#top level directory: " << this->WorkDir << std::endl
<< "#file: \"postinst\"" << std::endl
<< "#error:" << control_tar.GetError() << std::endl);
return false;
@@ -353,13 +376,13 @@ bool DebGenerator::generateControlTar(std::string const& md5Filename) const
control_tar.SetPermissions(permission644);
}
- if (GenPostRm) {
+ if (this->GenPostRm) {
control_tar.SetPermissions(permission755);
- if (!control_tar.Add(PostRm, WorkDir.length(), ".")) {
+ if (!control_tar.Add(this->PostRm, this->WorkDir.length(), ".")) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Error adding file to tar:"
<< std::endl
- << "#top level directory: " << WorkDir << std::endl
+ << "#top level directory: " << this->WorkDir << std::endl
<< "#file: \"postinst\"" << std::endl
<< "#error:" << control_tar.GetError() << std::endl);
return false;
@@ -370,7 +393,7 @@ bool DebGenerator::generateControlTar(std::string const& md5Filename) const
// for the other files, we use
// -either the original permission on the files
// -either a permission strictly defined by the Debian policies
- if (ControlExtra) {
+ if (this->ControlExtra) {
// permissions are now controlled by the original file permissions
static const char* strictFiles[] = { "config", "postinst", "postrm",
@@ -381,19 +404,29 @@ bool DebGenerator::generateControlTar(std::string const& md5Filename) const
// default
control_tar.ClearPermissions();
- std::vector<std::string> controlExtraList = cmExpandedList(ControlExtra);
+ std::vector<std::string> controlExtraList =
+ cmExpandedList(this->ControlExtra);
for (std::string const& i : controlExtraList) {
std::string filenamename = cmsys::SystemTools::GetFilenameName(i);
- std::string localcopy = WorkDir + "/" + filenamename;
+ std::string localcopy = this->WorkDir + "/" + filenamename;
- if (PermissionStrictPolicy) {
+ if (this->PermissionStrictPolicy) {
control_tar.SetPermissions(
setStrictFiles.count(filenamename) ? permission755 : permission644);
}
// if we can copy the file, it means it does exist, let's add it:
+ if (!cmsys::SystemTools::FileExists(i)) {
+ cmCPackLogger(cmCPackLog::LOG_WARNING,
+ "Adding file to tar:" << std::endl
+ << "#top level directory: "
+ << this->WorkDir << std::endl
+ << "#missing file: " << i
+ << std::endl);
+ }
+
if (cmsys::SystemTools::CopyFileIfDifferent(i, localcopy)) {
- control_tar.Add(localcopy, WorkDir.length(), ".");
+ control_tar.Add(localcopy, this->WorkDir.length(), ".");
}
}
}
@@ -408,8 +441,8 @@ bool DebGenerator::generateDeb() const
// difference is that debian uses the BSD ar style archive whereas most
// Linux distro have a GNU ar.
// See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=161593 for more info
- std::string const outputPath = TopLevelDir + "/" + OutputName;
- std::string const tlDir = WorkDir + "/";
+ std::string const outputPath = this->TopLevelDir + "/" + this->OutputName;
+ std::string const tlDir = this->WorkDir + "/";
cmGeneratedFileStream debStream;
debStream.Open(outputPath, false, true);
cmArchiveWrite deb(debStream, cmArchiveWrite::CompressNone, "arbsd");
@@ -422,12 +455,13 @@ bool DebGenerator::generateDeb() const
if (!deb.Add(tlDir + "debian-binary", tlDir.length()) ||
!deb.Add(tlDir + "control.tar.gz", tlDir.length()) ||
- !deb.Add(tlDir + "data.tar" + CompressionSuffix, tlDir.length())) {
+ !deb.Add(tlDir + "data.tar" + this->CompressionSuffix, tlDir.length())) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Error creating debian package:"
<< std::endl
- << "#top level directory: " << TopLevelDir << std::endl
- << "#file: " << OutputName << std::endl
+ << "#top level directory: " << this->TopLevelDir
+ << std::endl
+ << "#file: " << this->OutputName << std::endl
<< "#error:" << deb.GetError() << std::endl);
return false;
}
@@ -455,7 +489,8 @@ int cmCPackDebGenerator::PackageOnePack(std::string const& initialTopLevel,
int retval = 1;
// Begin the archive for this pack
std::string localToplevel(initialTopLevel);
- std::string packageFileName(cmSystemTools::GetParentDirectory(toplevel));
+ std::string packageFileName(
+ cmSystemTools::GetParentDirectory(this->toplevel));
std::string outputFileName(
std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME")) + "-" +
packageName + this->GetOutputExtension());
@@ -495,19 +530,20 @@ int cmCPackDebGenerator::PackageOnePack(std::string const& initialTopLevel,
<< std::endl);
return 0;
}
- packageFiles = gl.GetFiles();
+ this->packageFiles = gl.GetFiles();
}
- int res = createDeb();
+ int res = this->createDeb();
if (res != 1) {
retval = 0;
}
// add the generated package to package file names list
packageFileName = cmStrCat(this->GetOption("CPACK_TOPLEVEL_DIRECTORY"), '/',
this->GetOption("GEN_CPACK_OUTPUT_FILE_NAME"));
- packageFileNames.push_back(std::move(packageFileName));
+ this->packageFileNames.push_back(std::move(packageFileName));
- if (this->IsOn("GEN_CPACK_DEBIAN_DEBUGINFO_PACKAGE")) {
+ if (this->IsOn("GEN_CPACK_DEBIAN_DEBUGINFO_PACKAGE") &&
+ this->GetOption("GEN_DBGSYMDIR")) {
cmsys::Glob gl;
std::string findExpr(this->GetOption("GEN_DBGSYMDIR"));
findExpr += "/*";
@@ -520,9 +556,9 @@ int cmCPackDebGenerator::PackageOnePack(std::string const& initialTopLevel,
<< std::endl);
return 0;
}
- packageFiles = gl.GetFiles();
+ this->packageFiles = gl.GetFiles();
- res = createDbgsymDDeb();
+ res = this->createDbgsymDDeb();
if (res != 1) {
retval = 0;
}
@@ -530,7 +566,7 @@ int cmCPackDebGenerator::PackageOnePack(std::string const& initialTopLevel,
packageFileName =
cmStrCat(this->GetOption("CPACK_TOPLEVEL_DIRECTORY"), '/',
this->GetOption("GEN_CPACK_DBGSYM_OUTPUT_FILE_NAME"));
- packageFileNames.push_back(std::move(packageFileName));
+ this->packageFileNames.push_back(std::move(packageFileName));
}
return retval;
@@ -541,7 +577,7 @@ int cmCPackDebGenerator::PackageComponents(bool ignoreGroup)
int retval = 1;
/* Reset package file name list it will be populated during the
* component packaging run*/
- packageFileNames.clear();
+ this->packageFileNames.clear();
std::string initialTopLevel(this->GetOption("CPACK_TEMPORARY_DIRECTORY"));
// The default behavior is to have one package by component group
@@ -551,7 +587,7 @@ int cmCPackDebGenerator::PackageComponents(bool ignoreGroup)
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"Packaging component group: " << compG.first << std::endl);
// Begin the archive for this group
- retval &= PackageOnePack(initialTopLevel, compG.first);
+ retval &= this->PackageOnePack(initialTopLevel, compG.first);
}
// Handle Orphan components (components not belonging to any groups)
for (auto const& comp : this->Components) {
@@ -564,7 +600,7 @@ int cmCPackDebGenerator::PackageComponents(bool ignoreGroup)
<< "> does not belong to any group, package it separately."
<< std::endl);
// Begin the archive for this orphan component
- retval &= PackageOnePack(initialTopLevel, comp.first);
+ retval &= this->PackageOnePack(initialTopLevel, comp.first);
}
}
}
@@ -572,7 +608,7 @@ int cmCPackDebGenerator::PackageComponents(bool ignoreGroup)
// We build 1 package per component
else {
for (auto const& comp : this->Components) {
- retval &= PackageOnePack(initialTopLevel, comp.first);
+ retval &= this->PackageOnePack(initialTopLevel, comp.first);
}
}
return retval;
@@ -585,7 +621,7 @@ int cmCPackDebGenerator::PackageComponentsAllInOne(
int retval = 1;
/* Reset package file name list it will be populated during the
* component packaging run*/
- packageFileNames.clear();
+ this->packageFileNames.clear();
std::string initialTopLevel(this->GetOption("CPACK_TEMPORARY_DIRECTORY"));
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
@@ -595,7 +631,8 @@ int cmCPackDebGenerator::PackageComponentsAllInOne(
// The ALL GROUPS in ONE package case
std::string localToplevel(initialTopLevel);
- std::string packageFileName(cmSystemTools::GetParentDirectory(toplevel));
+ std::string packageFileName(
+ cmSystemTools::GetParentDirectory(this->toplevel));
std::string outputFileName(
std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME")) +
this->GetOutputExtension());
@@ -640,38 +677,38 @@ int cmCPackDebGenerator::PackageComponentsAllInOne(
<< std::endl);
return 0;
}
- packageFiles = gl.GetFiles();
+ this->packageFiles = gl.GetFiles();
- int res = createDeb();
+ int res = this->createDeb();
if (res != 1) {
retval = 0;
}
// add the generated package to package file names list
packageFileName = cmStrCat(this->GetOption("CPACK_TOPLEVEL_DIRECTORY"), '/',
this->GetOption("GEN_CPACK_OUTPUT_FILE_NAME"));
- packageFileNames.push_back(std::move(packageFileName));
+ this->packageFileNames.push_back(std::move(packageFileName));
return retval;
}
int cmCPackDebGenerator::PackageFiles()
{
/* Are we in the component packaging case */
- if (WantsComponentInstallation()) {
+ if (this->WantsComponentInstallation()) {
// CASE 1 : COMPONENT ALL-IN-ONE package
// If ALL GROUPS or ALL COMPONENTS in ONE package has been requested
// then the package file is unique and should be open here.
- if (componentPackageMethod == ONE_PACKAGE) {
- return PackageComponentsAllInOne("ALL_COMPONENTS_IN_ONE");
+ if (this->componentPackageMethod == ONE_PACKAGE) {
+ return this->PackageComponentsAllInOne("ALL_COMPONENTS_IN_ONE");
}
// CASE 2 : COMPONENT CLASSICAL package(s) (i.e. not all-in-one)
// There will be 1 package for each component group
// however one may require to ignore component group and
// in this case you'll get 1 package for each component.
- return PackageComponents(componentPackageMethod ==
- ONE_PACKAGE_PER_COMPONENT);
+ return this->PackageComponents(this->componentPackageMethod ==
+ ONE_PACKAGE_PER_COMPONENT);
}
// CASE 3 : NON COMPONENT package.
- return PackageComponentsAllInOne("");
+ return this->PackageComponentsAllInOne("");
}
int cmCPackDebGenerator::createDeb()
@@ -786,16 +823,17 @@ int cmCPackDebGenerator::createDeb()
}
DebGenerator gen(
- Logger, this->GetOption("GEN_CPACK_OUTPUT_FILE_NAME"), strGenWDIR,
+ this->Logger, this->GetOption("GEN_CPACK_OUTPUT_FILE_NAME"), strGenWDIR,
this->GetOption("CPACK_TOPLEVEL_DIRECTORY"),
this->GetOption("CPACK_TEMPORARY_DIRECTORY"),
this->GetOption("GEN_CPACK_DEBIAN_COMPRESSION_TYPE"),
+ this->GetOption("CPACK_THREADS"),
this->GetOption("GEN_CPACK_DEBIAN_ARCHIVE_TYPE"), controlValues, gen_shibs,
shlibsfilename, this->IsOn("GEN_CPACK_DEBIAN_GENERATE_POSTINST"), postinst,
this->IsOn("GEN_CPACK_DEBIAN_GENERATE_POSTRM"), postrm,
this->GetOption("GEN_CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA"),
this->IsSet("GEN_CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION"),
- packageFiles);
+ this->packageFiles);
if (!gen.generate()) {
return 0;
@@ -841,16 +879,17 @@ int cmCPackDebGenerator::createDbgsymDDeb()
}
DebGenerator gen(
- Logger, this->GetOption("GEN_CPACK_DBGSYM_OUTPUT_FILE_NAME"),
+ this->Logger, this->GetOption("GEN_CPACK_DBGSYM_OUTPUT_FILE_NAME"),
this->GetOption("GEN_DBGSYMDIR"),
this->GetOption("CPACK_TOPLEVEL_DIRECTORY"),
this->GetOption("CPACK_TEMPORARY_DIRECTORY"),
this->GetOption("GEN_CPACK_DEBIAN_COMPRESSION_TYPE"),
+ this->GetOption("CPACK_THREADS"),
this->GetOption("GEN_CPACK_DEBIAN_ARCHIVE_TYPE"), controlValues, false, "",
false, "", false, "", nullptr,
this->IsSet("GEN_CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION"),
- packageFiles);
+ this->packageFiles);
if (!gen.generate()) {
return 0;
@@ -860,25 +899,25 @@ int cmCPackDebGenerator::createDbgsymDDeb()
bool cmCPackDebGenerator::SupportsComponentInstallation() const
{
- return IsOn("CPACK_DEB_COMPONENT_INSTALL");
+ return this->IsOn("CPACK_DEB_COMPONENT_INSTALL");
}
std::string cmCPackDebGenerator::GetComponentInstallDirNameSuffix(
const std::string& componentName)
{
- if (componentPackageMethod == ONE_PACKAGE_PER_COMPONENT) {
+ if (this->componentPackageMethod == ONE_PACKAGE_PER_COMPONENT) {
return componentName;
}
- if (componentPackageMethod == ONE_PACKAGE) {
+ if (this->componentPackageMethod == ONE_PACKAGE) {
return std::string("ALL_COMPONENTS_IN_ONE");
}
// We have to find the name of the COMPONENT GROUP
// the current COMPONENT belongs to.
std::string groupVar =
"CPACK_COMPONENT_" + cmSystemTools::UpperCase(componentName) + "_GROUP";
- if (nullptr != GetOption(groupVar)) {
- return std::string(GetOption(groupVar));
+ if (nullptr != this->GetOption(groupVar)) {
+ return std::string(this->GetOption(groupVar));
}
return componentName;
}
diff --git a/Source/CPack/cmCPackExternalGenerator.cxx b/Source/CPack/cmCPackExternalGenerator.cxx
index 0bc8456710..e3521a0e5a 100644
--- a/Source/CPack/cmCPackExternalGenerator.cxx
+++ b/Source/CPack/cmCPackExternalGenerator.cxx
@@ -95,7 +95,7 @@ int cmCPackExternalGenerator::InstallProjectViaInstallCommands(
bool setDestDir, const std::string& tempInstallDirectory)
{
if (this->StagingEnabled()) {
- return cmCPackGenerator::InstallProjectViaInstallCommands(
+ return this->cmCPackGenerator::InstallProjectViaInstallCommands(
setDestDir, tempInstallDirectory);
}
@@ -106,7 +106,7 @@ int cmCPackExternalGenerator::InstallProjectViaInstallScript(
bool setDestDir, const std::string& tempInstallDirectory)
{
if (this->StagingEnabled()) {
- return cmCPackGenerator::InstallProjectViaInstallScript(
+ return this->cmCPackGenerator::InstallProjectViaInstallScript(
setDestDir, tempInstallDirectory);
}
@@ -118,7 +118,7 @@ int cmCPackExternalGenerator::InstallProjectViaInstalledDirectories(
const mode_t* default_dir_mode)
{
if (this->StagingEnabled()) {
- return cmCPackGenerator::InstallProjectViaInstalledDirectories(
+ return this->cmCPackGenerator::InstallProjectViaInstalledDirectories(
setDestDir, tempInstallDirectory, default_dir_mode);
}
@@ -130,7 +130,7 @@ int cmCPackExternalGenerator::RunPreinstallTarget(
cmGlobalGenerator* globalGenerator, const std::string& buildConfig)
{
if (this->StagingEnabled()) {
- return cmCPackGenerator::RunPreinstallTarget(
+ return this->cmCPackGenerator::RunPreinstallTarget(
installProjectName, installDirectory, globalGenerator, buildConfig);
}
@@ -145,7 +145,7 @@ int cmCPackExternalGenerator::InstallCMakeProject(
std::string& absoluteDestFiles)
{
if (this->StagingEnabled()) {
- return cmCPackGenerator::InstallCMakeProject(
+ return this->cmCPackGenerator::InstallCMakeProject(
setDestDir, installDirectory, baseTempInstallDirectory, default_dir_mode,
component, componentInstall, installSubDirectory, buildConfig,
absoluteDestFiles);
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index a9fe91cd16..3db4162c92 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -60,18 +60,18 @@ int cmCPackGenerator::PrepareNames()
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Create temp directory." << std::endl);
// checks CPACK_SET_DESTDIR support
- if (IsOn("CPACK_SET_DESTDIR")) {
- if (SETDESTDIR_UNSUPPORTED == SupportsSetDestdir()) {
+ if (this->IsOn("CPACK_SET_DESTDIR")) {
+ if (SETDESTDIR_UNSUPPORTED == this->SupportsSetDestdir()) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPACK_SET_DESTDIR is set to ON but the '"
- << Name << "' generator does NOT support it."
+ << this->Name << "' generator does NOT support it."
<< std::endl);
return 0;
}
- if (SETDESTDIR_SHOULD_NOT_BE_USED == SupportsSetDestdir()) {
+ if (SETDESTDIR_SHOULD_NOT_BE_USED == this->SupportsSetDestdir()) {
cmCPackLogger(cmCPackLog::LOG_WARNING,
"CPACK_SET_DESTDIR is set to ON but it is "
- << "usually a bad idea to do that with '" << Name
+ << "usually a bad idea to do that with '" << this->Name
<< "' generator. Use at your own risk." << std::endl);
}
}
@@ -380,8 +380,8 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
<< std::endl);
return 0;
}
- files = gl.GetFiles();
- for (std::string const& gf : files) {
+ this->files = gl.GetFiles();
+ for (std::string const& gf : this->files) {
bool skip = false;
std::string inFile = gf;
if (cmSystemTools::FileIsDirectory(gf)) {
@@ -763,7 +763,7 @@ int cmCPackGenerator::InstallCMakeProject(
// one install directory for each component **GROUP**
// instead of the default
// one install directory for each component.
- tempInstallDirectory += GetComponentInstallDirNameSuffix(component);
+ tempInstallDirectory += this->GetComponentInstallDirNameSuffix(component);
if (this->IsOn("CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY")) {
tempInstallDirectory += "/";
tempInstallDirectory += this->GetOption("CPACK_PACKAGE_FILE_NAME");
@@ -897,7 +897,7 @@ int cmCPackGenerator::InstallCMakeProject(
// ABSOLUTE INSTALL DESTINATION or CPack has been asked for
// then ask cmake_install.cmake script to error out
// as soon as it occurs (before installing file)
- if (!SupportsAbsoluteDestination() ||
+ if (!this->SupportsAbsoluteDestination() ||
this->IsOn("CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION")) {
mf.AddDefinition("CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION", "1");
}
@@ -933,7 +933,7 @@ int cmCPackGenerator::InstallCMakeProject(
localFileName = cmSystemTools::RelativePath(InstallPrefix, *fit);
localFileName =
localFileName.substr(localFileName.find_first_not_of('/'));
- Components[component].Files.push_back(localFileName);
+ this->Components[component].Files.push_back(localFileName);
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"Adding file <" << localFileName << "> to component <"
<< component << ">" << std::endl);
@@ -952,7 +952,7 @@ int cmCPackGenerator::InstallCMakeProject(
if (componentInstall) {
std::string absoluteDestFileComponent =
std::string("CPACK_ABSOLUTE_DESTINATION_FILES") + "_" +
- GetComponentInstallDirNameSuffix(component);
+ this->GetComponentInstallDirNameSuffix(component);
if (nullptr != this->GetOption(absoluteDestFileComponent)) {
std::string absoluteDestFilesListComponent =
cmStrCat(this->GetOption(absoluteDestFileComponent), ';', *d);
@@ -1073,17 +1073,17 @@ int cmCPackGenerator::DoPackage()
}
// The files to be installed
- files = gl.GetFiles();
+ this->files = gl.GetFiles();
- packageFileNames.clear();
+ this->packageFileNames.clear();
/* Put at least one file name into the list of
* wanted packageFileNames. The specific generator
* may update this during PackageFiles.
* (either putting several names or updating the provided one)
*/
- packageFileNames.emplace_back(tempPackageFileName ? tempPackageFileName
- : "");
- toplevel = tempDirectory;
+ this->packageFileNames.emplace_back(tempPackageFileName ? tempPackageFileName
+ : "");
+ this->toplevel = tempDirectory;
{ // scope that enables package generators to run internal scripts with
// latest CMake policies enabled
cmMakefile::ScopePushPop pp{ this->MakefileMap };
@@ -1127,10 +1127,10 @@ int cmCPackGenerator::DoPackage()
* (because the specific generator did 'normalize' it)
*/
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
- "Copying final package(s) [" << packageFileNames.size()
+ "Copying final package(s) [" << this->packageFileNames.size()
<< "]:" << std::endl);
/* now copy package one by one */
- for (std::string const& pkgFileName : packageFileNames) {
+ for (std::string const& pkgFileName : this->packageFileNames) {
std::string tmpPF(this->GetOption("CPACK_OUTPUT_FILE_PREFIX"));
std::string filename(cmSystemTools::GetFilenameName(pkgFileName));
tempPackageFileName = pkgFileName.c_str();
@@ -1211,7 +1211,7 @@ bool cmCPackGenerator::IsSet(const std::string& name) const
bool cmCPackGenerator::IsOn(const std::string& name) const
{
- return cmIsOn(GetOption(name));
+ return cmIsOn(this->GetOption(name));
}
bool cmCPackGenerator::IsSetToOff(const std::string& op) const
@@ -1329,7 +1329,7 @@ bool cmCPackGenerator::ConfigureFile(const std::string& inName,
bool copyOnly /* = false */)
{
return this->MakefileMap->ConfigureFile(inName, outName, copyOnly, true,
- false, true) == 1;
+ false) == 1;
}
int cmCPackGenerator::CleanTemporaryDirectory()
@@ -1405,7 +1405,7 @@ int cmCPackGenerator::PrepareGroupingKind()
// fallback to default if not group based
if (method == ONE_PACKAGE_PER_GROUP && this->ComponentGroups.empty() &&
!this->Components.empty()) {
- if (componentPackageMethod == ONE_PACKAGE) {
+ if (this->componentPackageMethod == ONE_PACKAGE) {
method = ONE_PACKAGE;
} else {
method = ONE_PACKAGE_PER_COMPONENT;
@@ -1421,7 +1421,7 @@ int cmCPackGenerator::PrepareGroupingKind()
// if user specified packaging method, override the default packaging
// method
if (method != UNKNOWN_COMPONENT_PACKAGE_METHOD) {
- componentPackageMethod = method;
+ this->componentPackageMethod = method;
}
const char* method_names[] = { "ALL_COMPONENTS_IN_ONE", "IGNORE_GROUPS",
@@ -1430,7 +1430,8 @@ int cmCPackGenerator::PrepareGroupingKind()
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"[" << this->Name << "]"
<< " requested component grouping = "
- << method_names[componentPackageMethod] << std::endl);
+ << method_names[this->componentPackageMethod]
+ << std::endl);
return 1;
}
@@ -1451,13 +1452,14 @@ std::string cmCPackGenerator::GetComponentPackageFileName(
*/
std::string suffix = "-" + groupOrComponentName;
/* check if we should use DISPLAY name */
- std::string dispNameVar = "CPACK_" + Name + "_USE_DISPLAY_NAME_IN_FILENAME";
- if (IsOn(dispNameVar)) {
+ std::string dispNameVar =
+ "CPACK_" + this->Name + "_USE_DISPLAY_NAME_IN_FILENAME";
+ if (this->IsOn(dispNameVar)) {
/* the component Group case */
if (isGroupName) {
std::string groupDispVar = "CPACK_COMPONENT_GROUP_" +
cmSystemTools::UpperCase(groupOrComponentName) + "_DISPLAY_NAME";
- const char* groupDispName = GetOption(groupDispVar);
+ const char* groupDispName = this->GetOption(groupDispVar);
if (groupDispName) {
suffix = "-" + std::string(groupDispName);
}
@@ -1466,7 +1468,7 @@ std::string cmCPackGenerator::GetComponentPackageFileName(
else {
std::string dispVar = "CPACK_COMPONENT_" +
cmSystemTools::UpperCase(groupOrComponentName) + "_DISPLAY_NAME";
- const char* dispName = GetOption(dispVar);
+ const char* dispName = this->GetOption(dispVar);
if (dispName) {
suffix = "-" + std::string(dispName);
}
@@ -1493,8 +1495,8 @@ bool cmCPackGenerator::SupportsComponentInstallation() const
bool cmCPackGenerator::WantsComponentInstallation() const
{
- return (!IsOn("CPACK_MONOLITHIC_INSTALL") &&
- SupportsComponentInstallation()
+ return (!this->IsOn("CPACK_MONOLITHIC_INSTALL") &&
+ this->SupportsComponentInstallation()
// check that we have at least one group or component
&& (!this->ComponentGroups.empty() || !this->Components.empty()));
}
@@ -1557,7 +1559,7 @@ cmCPackComponent* cmCPackGenerator::GetComponent(
const char* groupName = this->GetOption(macroPrefix + "_GROUP");
if (cmNonempty(groupName)) {
- component->Group = GetComponentGroup(projectName, groupName);
+ component->Group = this->GetComponentGroup(projectName, groupName);
component->Group->Components.push_back(component);
} else {
component->Group = nullptr;
@@ -1584,7 +1586,7 @@ cmCPackComponent* cmCPackGenerator::GetComponent(
if (cmNonempty(depends)) {
std::vector<std::string> dependsVector = cmExpandedList(depends);
for (std::string const& depend : dependsVector) {
- cmCPackComponent* child = GetComponent(projectName, depend);
+ cmCPackComponent* child = this->GetComponent(projectName, depend);
component->Dependencies.push_back(child);
child->ReverseDependencies.push_back(component);
}
@@ -1620,7 +1622,8 @@ cmCPackComponentGroup* cmCPackGenerator::GetComponentGroup(
const char* parentGroupName =
this->GetOption(macroPrefix + "_PARENT_GROUP");
if (cmNonempty(parentGroupName)) {
- group->ParentGroup = GetComponentGroup(projectName, parentGroupName);
+ group->ParentGroup =
+ this->GetComponentGroup(projectName, parentGroupName);
group->ParentGroup->Subgroups.push_back(group);
} else {
group->ParentGroup = nullptr;
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx
index 2109b4e349..263adfdf77 100644
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -31,7 +31,7 @@
cmCPackNSISGenerator::cmCPackNSISGenerator(bool nsis64)
{
- Nsis64 = nsis64;
+ this->Nsis64 = nsis64;
}
cmCPackNSISGenerator::~cmCPackNSISGenerator() = default;
@@ -61,18 +61,18 @@ int cmCPackNSISGenerator::PackageFiles()
std::string nsisInstallOptions = nsisFileName + "/NSIS.InstallOptions.ini";
nsisFileName += "/project.nsi";
std::ostringstream str;
- for (std::string const& file : files) {
+ for (std::string const& file : this->files) {
std::string outputDir = "$INSTDIR";
- std::string fileN = cmSystemTools::RelativePath(toplevel, file);
+ std::string fileN = cmSystemTools::RelativePath(this->toplevel, file);
if (!this->Components.empty()) {
const std::string::size_type pos = fileN.find('/');
// Use the custom component install directory if we have one
if (pos != std::string::npos) {
auto componentName = cm::string_view(fileN).substr(0, pos);
- outputDir = CustomComponentInstallDirectory(componentName);
+ outputDir = this->CustomComponentInstallDirectory(componentName);
} else {
- outputDir = CustomComponentInstallDirectory(fileN);
+ outputDir = this->CustomComponentInstallDirectory(fileN);
}
// Strip off the component part of the path.
@@ -86,15 +86,15 @@ int cmCPackNSISGenerator::PackageFiles()
"Uninstall Files: " << str.str() << std::endl);
this->SetOptionIfNotSet("CPACK_NSIS_DELETE_FILES", str.str().c_str());
std::vector<std::string> dirs;
- this->GetListOfSubdirectories(toplevel.c_str(), dirs);
+ this->GetListOfSubdirectories(this->toplevel.c_str(), dirs);
std::ostringstream dstr;
for (std::string const& dir : dirs) {
std::string componentName;
- std::string fileN = cmSystemTools::RelativePath(toplevel, dir);
+ std::string fileN = cmSystemTools::RelativePath(this->toplevel, dir);
if (fileN.empty()) {
continue;
}
- if (!Components.empty()) {
+ if (!this->Components.empty()) {
// If this is a component installation, strip off the component
// part of the path.
std::string::size_type slash = fileN.find('/');
@@ -110,7 +110,7 @@ int cmCPackNSISGenerator::PackageFiles()
std::replace(fileN.begin(), fileN.end(), '/', '\\');
const std::string componentOutputDir =
- CustomComponentInstallDirectory(componentName);
+ this->CustomComponentInstallDirectory(componentName);
dstr << " RMDir \"" << componentOutputDir << "\\" << fileN << "\""
<< std::endl;
@@ -209,6 +209,25 @@ int cmCPackNSISGenerator::PackageFiles()
"ManifestDPIAware true");
}
+ if (this->IsSet("CPACK_NSIS_BRANDING_TEXT")) {
+ // Default position to LEFT
+ std::string brandingTextPosition = "LEFT";
+ if (this->IsSet("CPACK_NSIS_BRANDING_TEXT_TRIM_POSITION")) {
+ std::string wantedPosition =
+ this->GetOption("CPACK_NSIS_BRANDING_TEXT_TRIM_POSITION");
+ const std::set<std::string> possiblePositions{ "CENTER", "LEFT",
+ "RIGHT" };
+ if (possiblePositions.find(wantedPosition) != possiblePositions.end()) {
+ brandingTextPosition = wantedPosition;
+ }
+ }
+ std::string brandingTextCode =
+ cmStrCat("BrandingText /TRIM", brandingTextPosition, " \"",
+ this->GetOption("CPACK_NSIS_BRANDING_TEXT"), "\"\n");
+ this->SetOptionIfNotSet("CPACK_NSIS_BRANDING_TEXT_CODE",
+ brandingTextCode.c_str());
+ }
+
// Setup all of the component sections
if (this->Components.empty()) {
this->SetOptionIfNotSet("CPACK_NSIS_INSTALLATION_TYPES", "");
@@ -677,7 +696,7 @@ std::string cmCPackNSISGenerator::CreateComponentDescription(
}
const std::string componentOutputDir =
- CustomComponentInstallDirectory(component->Name);
+ this->CustomComponentInstallDirectory(component->Name);
componentCode += cmStrCat(" SetOutPath \"", componentOutputDir, "\"\n");
// Create the actual installation commands
@@ -833,14 +852,16 @@ std::string cmCPackNSISGenerator::CreateComponentDescription(
// depends on.
std::set<cmCPackComponent*> visited;
macrosOut << "!macro Select_" << component->Name << "_depends\n";
- macrosOut << CreateSelectionDependenciesDescription(component, visited);
+ macrosOut << this->CreateSelectionDependenciesDescription(component,
+ visited);
macrosOut << "!macroend\n";
// Macro used to deselect each of the components that depend on this
// component.
visited.clear();
macrosOut << "!macro Deselect_required_by_" << component->Name << "\n";
- macrosOut << CreateDeselectionDependenciesDescription(component, visited);
+ macrosOut << this->CreateDeselectionDependenciesDescription(component,
+ visited);
macrosOut << "!macroend\n";
return componentCode;
}
@@ -862,7 +883,8 @@ std::string cmCPackNSISGenerator::CreateSelectionDependenciesDescription(
out << " SectionSetFlags ${" << depend->Name << "} $0\n";
out << " IntOp $" << depend->Name << "_selected 0 + ${SF_SELECTED}\n";
// Recurse
- out << CreateSelectionDependenciesDescription(depend, visited).c_str();
+ out
+ << this->CreateSelectionDependenciesDescription(depend, visited).c_str();
}
return out.str();
@@ -887,7 +909,8 @@ std::string cmCPackNSISGenerator::CreateDeselectionDependenciesDescription(
out << " IntOp $" << depend->Name << "_selected 0 + 0\n";
// Recurse
- out << CreateDeselectionDependenciesDescription(depend, visited).c_str();
+ out << this->CreateDeselectionDependenciesDescription(depend, visited)
+ .c_str();
}
return out.str();
diff --git a/Source/CPack/cmCPackNuGetGenerator.cxx b/Source/CPack/cmCPackNuGetGenerator.cxx
index 60faecd0bb..98dc8906f0 100644
--- a/Source/CPack/cmCPackNuGetGenerator.cxx
+++ b/Source/CPack/cmCPackNuGetGenerator.cxx
@@ -17,32 +17,33 @@
bool cmCPackNuGetGenerator::SupportsComponentInstallation() const
{
- return IsOn("CPACK_NUGET_COMPONENT_INSTALL");
+ return this->IsOn("CPACK_NUGET_COMPONENT_INSTALL");
}
int cmCPackNuGetGenerator::PackageFiles()
{
- cmCPackLogger(cmCPackLog::LOG_DEBUG, "Toplevel: " << toplevel << std::endl);
+ cmCPackLogger(cmCPackLog::LOG_DEBUG,
+ "Toplevel: " << this->toplevel << std::endl);
/* Reset package file name list it will be populated after the
* `CPackNuGet.cmake` run */
- packageFileNames.clear();
+ this->packageFileNames.clear();
/* Are we in the component packaging case */
- if (WantsComponentInstallation()) {
- if (componentPackageMethod == ONE_PACKAGE) {
+ if (this->WantsComponentInstallation()) {
+ if (this->componentPackageMethod == ONE_PACKAGE) {
// CASE 1 : COMPONENT ALL-IN-ONE package
// Meaning that all per-component pre-installed files
// goes into the single package.
this->SetOption("CPACK_NUGET_ALL_IN_ONE", "TRUE");
- SetupGroupComponentVariables(true);
+ this->SetupGroupComponentVariables(true);
} else {
// CASE 2 : COMPONENT CLASSICAL package(s) (i.e. not all-in-one)
// There will be 1 package for each component group
// however one may require to ignore component group and
// in this case you'll get 1 package for each component.
- SetupGroupComponentVariables(componentPackageMethod ==
- ONE_PACKAGE_PER_COMPONENT);
+ this->SetupGroupComponentVariables(this->componentPackageMethod ==
+ ONE_PACKAGE_PER_COMPONENT);
}
} else {
// CASE 3 : NON COMPONENT package.
@@ -51,7 +52,7 @@ int cmCPackNuGetGenerator::PackageFiles()
auto retval = this->ReadListFile("Internal/CPack/CPackNuGet.cmake");
if (retval) {
- AddGeneratedPackageNames();
+ this->AddGeneratedPackageNames();
} else {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Error while execution CPackNuGet.cmake" << std::endl);
@@ -133,9 +134,9 @@ void cmCPackNuGetGenerator::AddGeneratedPackageNames()
std::string::size_type pos1 = 0;
std::string::size_type pos2 = fileNames.find(sep, pos1 + 1);
while (pos2 != std::string::npos) {
- packageFileNames.push_back(fileNames.substr(pos1, pos2 - pos1));
+ this->packageFileNames.push_back(fileNames.substr(pos1, pos2 - pos1));
pos1 = pos2 + 1;
pos2 = fileNames.find(sep, pos1 + 1);
}
- packageFileNames.push_back(fileNames.substr(pos1, pos2 - pos1));
+ this->packageFileNames.push_back(fileNames.substr(pos1, pos2 - pos1));
}
diff --git a/Source/CPack/cmCPackRPMGenerator.cxx b/Source/CPack/cmCPackRPMGenerator.cxx
index 0c1cecf39c..c3f6d594b5 100644
--- a/Source/CPack/cmCPackRPMGenerator.cxx
+++ b/Source/CPack/cmCPackRPMGenerator.cxx
@@ -51,11 +51,11 @@ void cmCPackRPMGenerator::AddGeneratedPackageNames()
std::string::size_type pos1 = 0;
std::string::size_type pos2 = fileNames.find(sep, pos1 + 1);
while (pos2 != std::string::npos) {
- packageFileNames.push_back(fileNames.substr(pos1, pos2 - pos1));
+ this->packageFileNames.push_back(fileNames.substr(pos1, pos2 - pos1));
pos1 = pos2 + 1;
pos2 = fileNames.find(sep, pos1 + 1);
}
- packageFileNames.push_back(fileNames.substr(pos1, pos2 - pos1));
+ this->packageFileNames.push_back(fileNames.substr(pos1, pos2 - pos1));
}
int cmCPackRPMGenerator::PackageOnePack(std::string const& initialToplevel,
@@ -64,10 +64,11 @@ int cmCPackRPMGenerator::PackageOnePack(std::string const& initialToplevel,
int retval = 1;
// Begin the archive for this pack
std::string localToplevel(initialToplevel);
- std::string packageFileName(cmSystemTools::GetParentDirectory(toplevel));
+ std::string packageFileName(
+ cmSystemTools::GetParentDirectory(this->toplevel));
std::string outputFileName(
- GetComponentPackageFileName(this->GetOption("CPACK_PACKAGE_FILE_NAME"),
- packageName, true) +
+ this->GetComponentPackageFileName(
+ this->GetOption("CPACK_PACKAGE_FILE_NAME"), packageName, true) +
this->GetOutputExtension());
localToplevel += "/" + packageName;
@@ -99,7 +100,7 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup)
int retval = 1;
/* Reset package file name list it will be populated during the
* component packaging run*/
- packageFileNames.clear();
+ this->packageFileNames.clear();
std::string initialTopLevel(this->GetOption("CPACK_TEMPORARY_DIRECTORY"));
const char* mainComponent = this->GetOption("CPACK_RPM_MAIN_COMPONENT");
@@ -202,7 +203,7 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup)
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"Packaging component group: " << compGIt->first
<< std::endl);
- retval &= PackageOnePack(initialTopLevel, compGIt->first);
+ retval &= this->PackageOnePack(initialTopLevel, compGIt->first);
}
// Handle Orphan components (components not belonging to any groups)
auto mainCompIt = this->Components.end();
@@ -227,7 +228,7 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup)
<< compIt->second.Name
<< "> does not belong to any group, package it separately."
<< std::endl);
- retval &= PackageOnePack(initialTopLevel, compIt->first);
+ retval &= this->PackageOnePack(initialTopLevel, compIt->first);
}
}
@@ -235,9 +236,9 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup)
this->SetOption("GENERATE_SPEC_PARTS", "OFF");
if (mainCompGIt != this->ComponentGroups.end()) {
- retval &= PackageOnePack(initialTopLevel, mainCompGIt->first);
+ retval &= this->PackageOnePack(initialTopLevel, mainCompGIt->first);
} else if (mainCompIt != this->Components.end()) {
- retval &= PackageOnePack(initialTopLevel, mainCompIt->first);
+ retval &= this->PackageOnePack(initialTopLevel, mainCompIt->first);
} else {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPACK_RPM_MAIN_COMPONENT set"
@@ -264,14 +265,14 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup)
continue;
}
- retval &= PackageOnePack(initialTopLevel, compIt->first);
+ retval &= this->PackageOnePack(initialTopLevel, compIt->first);
}
if (retval) {
this->SetOption("GENERATE_SPEC_PARTS", "OFF");
if (mainCompIt != this->Components.end()) {
- retval &= PackageOnePack(initialTopLevel, mainCompIt->first);
+ retval &= this->PackageOnePack(initialTopLevel, mainCompIt->first);
} else {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"CPACK_RPM_MAIN_COMPONENT set"
@@ -291,7 +292,7 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup)
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"Packaging component group: " << compGIt->first
<< std::endl);
- retval &= PackageOnePack(initialTopLevel, compGIt->first);
+ retval &= this->PackageOnePack(initialTopLevel, compGIt->first);
}
// Handle Orphan components (components not belonging to any groups)
std::map<std::string, cmCPackComponent>::iterator compIt;
@@ -305,7 +306,7 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup)
<< compIt->second.Name
<< "> does not belong to any group, package it separately."
<< std::endl);
- retval &= PackageOnePack(initialTopLevel, compIt->first);
+ retval &= this->PackageOnePack(initialTopLevel, compIt->first);
}
}
}
@@ -315,7 +316,7 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup)
std::map<std::string, cmCPackComponent>::iterator compIt;
for (compIt = this->Components.begin(); compIt != this->Components.end();
++compIt) {
- retval &= PackageOnePack(initialTopLevel, compIt->first);
+ retval &= this->PackageOnePack(initialTopLevel, compIt->first);
}
}
} else {
@@ -328,7 +329,7 @@ int cmCPackRPMGenerator::PackageComponents(bool ignoreGroup)
}
if (retval) {
- AddGeneratedPackageNames();
+ this->AddGeneratedPackageNames();
}
return retval;
@@ -340,7 +341,7 @@ int cmCPackRPMGenerator::PackageComponentsAllInOne(
int retval = 1;
/* Reset package file name list it will be populated during the
* component packaging run*/
- packageFileNames.clear();
+ this->packageFileNames.clear();
std::string initialTopLevel(this->GetOption("CPACK_TEMPORARY_DIRECTORY"));
if (this->IsOn("CPACK_RPM_DEBUGINFO_SINGLE_PACKAGE")) {
@@ -354,7 +355,8 @@ int cmCPackRPMGenerator::PackageComponentsAllInOne(
// The ALL GROUPS in ONE package case
std::string localToplevel(initialTopLevel);
- std::string packageFileName(cmSystemTools::GetParentDirectory(toplevel));
+ std::string packageFileName(
+ cmSystemTools::GetParentDirectory(this->toplevel));
std::string outputFileName(
std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME")) +
this->GetOutputExtension());
@@ -378,7 +380,7 @@ int cmCPackRPMGenerator::PackageComponentsAllInOne(
}
if (this->ReadListFile("Internal/CPack/CPackRPM.cmake")) {
- AddGeneratedPackageNames();
+ this->AddGeneratedPackageNames();
} else {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Error while execution CPackRPM.cmake" << std::endl);
@@ -390,48 +392,49 @@ int cmCPackRPMGenerator::PackageComponentsAllInOne(
int cmCPackRPMGenerator::PackageFiles()
{
- cmCPackLogger(cmCPackLog::LOG_DEBUG, "Toplevel: " << toplevel << std::endl);
+ cmCPackLogger(cmCPackLog::LOG_DEBUG,
+ "Toplevel: " << this->toplevel << std::endl);
/* Are we in the component packaging case */
- if (WantsComponentInstallation()) {
+ if (this->WantsComponentInstallation()) {
// CASE 1 : COMPONENT ALL-IN-ONE package
// If ALL COMPONENTS in ONE package has been requested
// then the package file is unique and should be open here.
- if (componentPackageMethod == ONE_PACKAGE) {
- return PackageComponentsAllInOne("ALL_COMPONENTS_IN_ONE");
+ if (this->componentPackageMethod == ONE_PACKAGE) {
+ return this->PackageComponentsAllInOne("ALL_COMPONENTS_IN_ONE");
}
// CASE 2 : COMPONENT CLASSICAL package(s) (i.e. not all-in-one)
// There will be 1 package for each component group
// however one may require to ignore component group and
// in this case you'll get 1 package for each component.
- return PackageComponents(componentPackageMethod ==
- ONE_PACKAGE_PER_COMPONENT);
+ return this->PackageComponents(this->componentPackageMethod ==
+ ONE_PACKAGE_PER_COMPONENT);
}
// CASE 3 : NON COMPONENT package.
- return PackageComponentsAllInOne("");
+ return this->PackageComponentsAllInOne("");
}
bool cmCPackRPMGenerator::SupportsComponentInstallation() const
{
- return IsOn("CPACK_RPM_COMPONENT_INSTALL");
+ return this->IsOn("CPACK_RPM_COMPONENT_INSTALL");
}
std::string cmCPackRPMGenerator::GetComponentInstallDirNameSuffix(
const std::string& componentName)
{
- if (componentPackageMethod == ONE_PACKAGE_PER_COMPONENT) {
+ if (this->componentPackageMethod == ONE_PACKAGE_PER_COMPONENT) {
return componentName;
}
- if (componentPackageMethod == ONE_PACKAGE) {
+ if (this->componentPackageMethod == ONE_PACKAGE) {
return std::string("ALL_COMPONENTS_IN_ONE");
}
// We have to find the name of the COMPONENT GROUP
// the current COMPONENT belongs to.
std::string groupVar =
"CPACK_COMPONENT_" + cmSystemTools::UpperCase(componentName) + "_GROUP";
- if (nullptr != GetOption(groupVar)) {
- return std::string(GetOption(groupVar));
+ if (nullptr != this->GetOption(groupVar)) {
+ return std::string(this->GetOption(groupVar));
}
return componentName;
}
diff --git a/Source/CPack/cmCPackSTGZGenerator.cxx b/Source/CPack/cmCPackSTGZGenerator.cxx
index a4a5e6fcd0..3e36e8cc18 100644
--- a/Source/CPack/cmCPackSTGZGenerator.cxx
+++ b/Source/CPack/cmCPackSTGZGenerator.cxx
@@ -50,7 +50,7 @@ int cmCPackSTGZGenerator::PackageFiles()
* have generated several packages (component packaging)
* so we must iterate over generated packages.
*/
- for (std::string const& pfn : packageFileNames) {
+ for (std::string const& pfn : this->packageFileNames) {
retval &= cmSystemTools::SetPermissions(pfn.c_str(),
#if defined(_MSC_VER) || defined(__MINGW32__)
S_IREAD | S_IWRITE | S_IEXEC