mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
Code style: add missed explicit 'this->'
CMake uses explicit 'this->' style. Using custom clang-tidy check we can detect and fix places where 'this->' was missed.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -204,7 +204,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
|
||||
@@ -303,7 +303,7 @@ protected:
|
||||
void StartElement(const std::string& name, const char** /*atts*/) override
|
||||
{
|
||||
this->file = name == "file";
|
||||
if (file) {
|
||||
if (this->file) {
|
||||
this->hasFiles = true;
|
||||
}
|
||||
}
|
||||
@@ -337,7 +337,7 @@ void cmCPackIFWInstaller::GenerateInstallerFile()
|
||||
|
||||
xout.StartDocument();
|
||||
|
||||
WriteGeneratedByToStrim(xout);
|
||||
this->WriteGeneratedByToStrim(xout);
|
||||
|
||||
xout.StartElement("Installer");
|
||||
|
||||
@@ -535,7 +535,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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -53,7 +53,7 @@ public:
|
||||
|
||||
bool operator<(const DependenceStruct& other) const
|
||||
{
|
||||
return Name < other.Name;
|
||||
return this->Name < other.Name;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -96,20 +96,20 @@ 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: "
|
||||
@@ -119,22 +119,22 @@ DebGenerator::DebGenerator(
|
||||
|
||||
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 +142,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 +162,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 +172,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);
|
||||
data_tar.Open();
|
||||
|
||||
// uid/gid should be the one of the root user, and this root user has
|
||||
@@ -184,16 +185,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 +236,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 +247,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 +282,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 +293,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 +316,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 +342,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 +356,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 +373,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 +384,20 @@ 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::CopyFileIfDifferent(i, localcopy)) {
|
||||
control_tar.Add(localcopy, WorkDir.length(), ".");
|
||||
control_tar.Add(localcopy, this->WorkDir.length(), ".");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -408,8 +412,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 +426,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 +460,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,17 +501,17 @@ 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") &&
|
||||
this->GetOption("GEN_DBGSYMDIR")) {
|
||||
@@ -521,9 +527,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;
|
||||
}
|
||||
@@ -531,7 +537,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;
|
||||
@@ -542,7 +548,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
|
||||
@@ -552,7 +558,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) {
|
||||
@@ -565,7 +571,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -573,7 +579,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;
|
||||
@@ -586,7 +592,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,
|
||||
@@ -596,7 +602,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());
|
||||
@@ -641,38 +648,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()
|
||||
@@ -787,7 +794,7 @@ 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"),
|
||||
@@ -796,7 +803,7 @@ int cmCPackDebGenerator::createDeb()
|
||||
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;
|
||||
@@ -842,7 +849,7 @@ 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"),
|
||||
@@ -851,7 +858,7 @@ int cmCPackDebGenerator::createDbgsymDDeb()
|
||||
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;
|
||||
@@ -861,25 +868,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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
@@ -677,7 +677,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 +833,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 +864,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 +890,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();
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -104,8 +104,8 @@ private:
|
||||
{
|
||||
if (this->RegexCheckOut.find(this->Line)) {
|
||||
this->BZR->URL = this->RegexCheckOut.match(1);
|
||||
CheckOutFound = true;
|
||||
} else if (!CheckOutFound && this->RegexParent.find(this->Line)) {
|
||||
this->CheckOutFound = true;
|
||||
} else if (!this->CheckOutFound && this->RegexParent.find(this->Line)) {
|
||||
this->BZR->URL = this->RegexParent.match(1);
|
||||
}
|
||||
return true;
|
||||
@@ -191,7 +191,7 @@ public:
|
||||
|
||||
int InitializeParser() override
|
||||
{
|
||||
int res = cmXMLParser::InitializeParser();
|
||||
int res = this->cmXMLParser::InitializeParser();
|
||||
if (res) {
|
||||
XML_SetUnknownEncodingHandler(static_cast<XML_Parser>(this->Parser),
|
||||
cmBZRXMLParserUnknownEncodingHandler,
|
||||
|
||||
@@ -137,7 +137,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
|
||||
bool cmCTestBuildCommand::InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status)
|
||||
{
|
||||
bool ret = cmCTestHandlerCommand::InitialPass(args, status);
|
||||
bool ret = this->cmCTestHandlerCommand::InitialPass(args, status);
|
||||
if (!this->NumberErrors.empty()) {
|
||||
this->Makefile->AddDefinition(
|
||||
this->NumberErrors, std::to_string(this->Handler->GetTotalErrors()));
|
||||
|
||||
@@ -778,16 +778,16 @@ struct cmCTestCoverageHandlerLocale
|
||||
{
|
||||
std::string l;
|
||||
if (cmSystemTools::GetEnv("LC_ALL", l)) {
|
||||
lc_all = l;
|
||||
this->lc_all = l;
|
||||
}
|
||||
if (lc_all != "C") {
|
||||
if (this->lc_all != "C") {
|
||||
cmSystemTools::PutEnv("LC_ALL=C");
|
||||
}
|
||||
}
|
||||
~cmCTestCoverageHandlerLocale()
|
||||
{
|
||||
if (!lc_all.empty()) {
|
||||
cmSystemTools::PutEnv("LC_ALL=" + lc_all);
|
||||
if (!this->lc_all.empty()) {
|
||||
cmSystemTools::PutEnv("LC_ALL=" + this->lc_all);
|
||||
} else {
|
||||
cmSystemTools::UnsetEnv("LC_ALL");
|
||||
}
|
||||
|
||||
@@ -284,7 +284,7 @@ void cmCTestLaunchReporter::DumpFileToXML(cmXMLElement& e3, const char* tag,
|
||||
|
||||
cmXMLElement e4(e3, tag);
|
||||
while (cmSystemTools::GetLineFromStream(fin, line)) {
|
||||
if (MatchesFilterPrefix(line)) {
|
||||
if (this->MatchesFilterPrefix(line)) {
|
||||
continue;
|
||||
}
|
||||
if (this->Match(line, this->RegexWarningSuppress)) {
|
||||
|
||||
@@ -56,8 +56,8 @@ public:
|
||||
// Sorts tests in descending order of cost
|
||||
bool operator()(int index1, int index2) const
|
||||
{
|
||||
return Handler->Properties[index1]->Cost >
|
||||
Handler->Properties[index2]->Cost;
|
||||
return this->Handler->Properties[index1]->Cost >
|
||||
this->Handler->Properties[index2]->Cost;
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -169,7 +169,7 @@ bool cmCTestMultiProcessHandler::StartTestProcess(int test)
|
||||
this->TestRunningMap[test] = true; // mark the test as running
|
||||
// now remove the test itself
|
||||
this->EraseTest(test);
|
||||
this->RunningCount += GetProcessorsUsed(test);
|
||||
this->RunningCount += this->GetProcessorsUsed(test);
|
||||
|
||||
auto testRun = cm::make_unique<cmCTestRunTest>(*this);
|
||||
|
||||
@@ -552,12 +552,12 @@ void cmCTestMultiProcessHandler::StartNextTests()
|
||||
continue;
|
||||
}
|
||||
|
||||
size_t processors = GetProcessorsUsed(test);
|
||||
size_t processors = this->GetProcessorsUsed(test);
|
||||
bool testLoadOk = true;
|
||||
if (this->TestLoad > 0) {
|
||||
if (processors <= spareLoad) {
|
||||
cmCTestLog(this->CTest, DEBUG,
|
||||
"OK to run " << GetName(test) << ", it requires "
|
||||
"OK to run " << this->GetName(test) << ", it requires "
|
||||
<< processors << " procs & system load is: "
|
||||
<< systemLoad << std::endl);
|
||||
allTestsFailedTestLoadCheck = false;
|
||||
@@ -568,7 +568,7 @@ void cmCTestMultiProcessHandler::StartNextTests()
|
||||
|
||||
if (processors <= minProcessorsRequired) {
|
||||
minProcessorsRequired = processors;
|
||||
testWithMinProcessors = GetName(test);
|
||||
testWithMinProcessors = this->GetName(test);
|
||||
}
|
||||
|
||||
if (testLoadOk && processors <= numToStart && this->StartTest(test)) {
|
||||
@@ -660,7 +660,7 @@ void cmCTestMultiProcessHandler::FinishTestProcess(
|
||||
this->WriteCheckpoint(test);
|
||||
this->DeallocateResources(test);
|
||||
this->UnlockResources(test);
|
||||
this->RunningCount -= GetProcessorsUsed(test);
|
||||
this->RunningCount -= this->GetProcessorsUsed(test);
|
||||
|
||||
for (auto p : properties->Affinity) {
|
||||
this->ProcessorsAvailable.insert(p);
|
||||
@@ -793,9 +793,9 @@ int cmCTestMultiProcessHandler::SearchByName(std::string const& name)
|
||||
void cmCTestMultiProcessHandler::CreateTestCostList()
|
||||
{
|
||||
if (this->ParallelLevel > 1) {
|
||||
CreateParallelTestCostList();
|
||||
this->CreateParallelTestCostList();
|
||||
} else {
|
||||
CreateSerialTestCostList();
|
||||
this->CreateSerialTestCostList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -862,7 +862,7 @@ void cmCTestMultiProcessHandler::GetAllTestDependencies(int test,
|
||||
{
|
||||
TestSet const& dependencySet = this->Tests[test];
|
||||
for (int i : dependencySet) {
|
||||
GetAllTestDependencies(i, dependencies);
|
||||
this->GetAllTestDependencies(i, dependencies);
|
||||
dependencies.push_back(i);
|
||||
}
|
||||
}
|
||||
@@ -886,7 +886,7 @@ void cmCTestMultiProcessHandler::CreateSerialTestCostList()
|
||||
}
|
||||
|
||||
TestList dependencies;
|
||||
GetAllTestDependencies(test, dependencies);
|
||||
this->GetAllTestDependencies(test, dependencies);
|
||||
|
||||
for (int testDependency : dependencies) {
|
||||
if (!cm::contains(alreadySortedTests, testDependency)) {
|
||||
@@ -1274,7 +1274,7 @@ void cmCTestMultiProcessHandler::PrintOutputAsJson()
|
||||
void cmCTestMultiProcessHandler::PrintTestList()
|
||||
{
|
||||
if (this->CTest->GetOutputAsJson()) {
|
||||
PrintOutputAsJson();
|
||||
this->PrintOutputAsJson();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+36
-36
@@ -56,7 +56,7 @@ public:
|
||||
ChangesParser(cmCTestP4* p4, const char* prefix)
|
||||
: P4(p4)
|
||||
{
|
||||
this->SetLog(&P4->Log, prefix);
|
||||
this->SetLog(&this->P4->Log, prefix);
|
||||
this->RegexIdentify.compile("^Change ([0-9]+) on");
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ private:
|
||||
bool ProcessLine() override
|
||||
{
|
||||
if (this->RegexIdentify.find(this->Line)) {
|
||||
P4->ChangeLists.push_back(this->RegexIdentify.match(1));
|
||||
this->P4->ChangeLists.push_back(this->RegexIdentify.match(1));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -79,7 +79,7 @@ public:
|
||||
UserParser(cmCTestP4* p4, const char* prefix)
|
||||
: P4(p4)
|
||||
{
|
||||
this->SetLog(&P4->Log, prefix);
|
||||
this->SetLog(&this->P4->Log, prefix);
|
||||
this->RegexUser.compile("^(.+) <(.*)> \\((.*)\\) accessed (.*)$");
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ private:
|
||||
NewUser.EMail = this->RegexUser.match(2);
|
||||
NewUser.Name = this->RegexUser.match(3);
|
||||
NewUser.AccessTime = this->RegexUser.match(4);
|
||||
P4->Users[this->RegexUser.match(1)] = NewUser;
|
||||
this->P4->Users[this->RegexUser.match(1)] = NewUser;
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -120,7 +120,7 @@ public:
|
||||
: P4(p4)
|
||||
, AlreadyNotified(false)
|
||||
{
|
||||
this->SetLog(&P4->Log, prefix);
|
||||
this->SetLog(&this->P4->Log, prefix);
|
||||
this->RegexDiff.compile("^==== (.*)#[0-9]+ - (.*)");
|
||||
}
|
||||
|
||||
@@ -134,12 +134,12 @@ private:
|
||||
{
|
||||
if (!this->Line.empty() && this->Line[0] == '=' &&
|
||||
this->RegexDiff.find(this->Line)) {
|
||||
CurrentPath = this->RegexDiff.match(1);
|
||||
AlreadyNotified = false;
|
||||
this->CurrentPath = this->RegexDiff.match(1);
|
||||
this->AlreadyNotified = false;
|
||||
} else {
|
||||
if (!AlreadyNotified) {
|
||||
P4->DoModification(PathModified, CurrentPath);
|
||||
AlreadyNotified = true;
|
||||
if (!this->AlreadyNotified) {
|
||||
this->P4->DoModification(PathModified, this->CurrentPath);
|
||||
this->AlreadyNotified = true;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -148,11 +148,11 @@ private:
|
||||
|
||||
cmCTestP4::User cmCTestP4::GetUserData(const std::string& username)
|
||||
{
|
||||
auto it = Users.find(username);
|
||||
auto it = this->Users.find(username);
|
||||
|
||||
if (it == Users.end()) {
|
||||
if (it == this->Users.end()) {
|
||||
std::vector<char const*> p4_users;
|
||||
SetP4Options(p4_users);
|
||||
this->SetP4Options(p4_users);
|
||||
p4_users.push_back("users");
|
||||
p4_users.push_back("-m");
|
||||
p4_users.push_back("1");
|
||||
@@ -161,11 +161,11 @@ cmCTestP4::User cmCTestP4::GetUserData(const std::string& username)
|
||||
|
||||
UserParser out(this, "users-out> ");
|
||||
OutputLogger err(this->Log, "users-err> ");
|
||||
RunChild(&p4_users[0], &out, &err);
|
||||
this->RunChild(&p4_users[0], &out, &err);
|
||||
|
||||
// The user should now be added to the map. Search again.
|
||||
it = Users.find(username);
|
||||
if (it == Users.end()) {
|
||||
it = this->Users.find(username);
|
||||
if (it == this->Users.end()) {
|
||||
return cmCTestP4::User();
|
||||
}
|
||||
}
|
||||
@@ -195,7 +195,7 @@ public:
|
||||
, P4(p4)
|
||||
, Section(SectionHeader)
|
||||
{
|
||||
this->SetLog(&P4->Log, prefix);
|
||||
this->SetLog(&this->P4->Log, prefix);
|
||||
this->RegexHeader.compile("^Change ([0-9]+) by (.+)@(.+) on (.*)$");
|
||||
this->RegexDiff.compile(R"(^\.\.\. (.*)#[0-9]+ ([^ ]+)$)");
|
||||
}
|
||||
@@ -259,7 +259,7 @@ private:
|
||||
this->Rev.Rev = this->RegexHeader.match(1);
|
||||
this->Rev.Date = this->RegexHeader.match(4);
|
||||
|
||||
cmCTestP4::User user = P4->GetUserData(this->RegexHeader.match(2));
|
||||
cmCTestP4::User user = this->P4->GetUserData(this->RegexHeader.match(2));
|
||||
this->Rev.Author = user.Name;
|
||||
this->Rev.EMail = user.EMail;
|
||||
|
||||
@@ -300,38 +300,38 @@ private:
|
||||
change.Action = 'M';
|
||||
}
|
||||
|
||||
Changes.push_back(change);
|
||||
this->Changes.push_back(change);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
void cmCTestP4::SetP4Options(std::vector<char const*>& CommandOptions)
|
||||
{
|
||||
if (P4Options.empty()) {
|
||||
if (this->P4Options.empty()) {
|
||||
const char* p4 = this->CommandLineTool.c_str();
|
||||
P4Options.emplace_back(p4);
|
||||
this->P4Options.emplace_back(p4);
|
||||
|
||||
// The CTEST_P4_CLIENT variable sets the P4 client used when issuing
|
||||
// Perforce commands, if it's different from the default one.
|
||||
std::string client = this->CTest->GetCTestConfiguration("P4Client");
|
||||
if (!client.empty()) {
|
||||
P4Options.emplace_back("-c");
|
||||
P4Options.push_back(client);
|
||||
this->P4Options.emplace_back("-c");
|
||||
this->P4Options.push_back(client);
|
||||
}
|
||||
|
||||
// Set the message language to be English, in case the P4 admin
|
||||
// has localized them
|
||||
P4Options.emplace_back("-L");
|
||||
P4Options.emplace_back("en");
|
||||
this->P4Options.emplace_back("-L");
|
||||
this->P4Options.emplace_back("en");
|
||||
|
||||
// The CTEST_P4_OPTIONS variable adds additional Perforce command line
|
||||
// options before the main command
|
||||
std::string opts = this->CTest->GetCTestConfiguration("P4Options");
|
||||
cm::append(P4Options, cmSystemTools::ParseArguments(opts));
|
||||
cm::append(this->P4Options, cmSystemTools::ParseArguments(opts));
|
||||
}
|
||||
|
||||
CommandOptions.clear();
|
||||
for (std::string const& o : P4Options) {
|
||||
for (std::string const& o : this->P4Options) {
|
||||
CommandOptions.push_back(o.c_str());
|
||||
}
|
||||
}
|
||||
@@ -339,7 +339,7 @@ void cmCTestP4::SetP4Options(std::vector<char const*>& CommandOptions)
|
||||
std::string cmCTestP4::GetWorkingRevision()
|
||||
{
|
||||
std::vector<char const*> p4_identify;
|
||||
SetP4Options(p4_identify);
|
||||
this->SetP4Options(p4_identify);
|
||||
|
||||
p4_identify.push_back("changes");
|
||||
p4_identify.push_back("-m");
|
||||
@@ -354,7 +354,7 @@ std::string cmCTestP4::GetWorkingRevision()
|
||||
IdentifyParser out(this, "p4_changes-out> ", rev);
|
||||
OutputLogger err(this->Log, "p4_changes-err> ");
|
||||
|
||||
bool result = RunChild(&p4_identify[0], &out, &err);
|
||||
bool result = this->RunChild(&p4_identify[0], &out, &err);
|
||||
|
||||
// If there was a problem contacting the server return "<unknown>"
|
||||
if (!result) {
|
||||
@@ -391,7 +391,7 @@ bool cmCTestP4::NoteNewRevision()
|
||||
bool cmCTestP4::LoadRevisions()
|
||||
{
|
||||
std::vector<char const*> p4_changes;
|
||||
SetP4Options(p4_changes);
|
||||
this->SetP4Options(p4_changes);
|
||||
|
||||
// Use 'p4 changes ...@old,new' to get a list of changelists
|
||||
std::string range = this->SourceDirectory + "/...";
|
||||
@@ -417,17 +417,17 @@ bool cmCTestP4::LoadRevisions()
|
||||
ChangesParser out(this, "p4_changes-out> ");
|
||||
OutputLogger err(this->Log, "p4_changes-err> ");
|
||||
|
||||
ChangeLists.clear();
|
||||
this->ChangeLists.clear();
|
||||
this->RunChild(&p4_changes[0], &out, &err);
|
||||
|
||||
if (ChangeLists.empty()) {
|
||||
if (this->ChangeLists.empty()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// p4 describe -s ...@1111111,2222222
|
||||
std::vector<char const*> p4_describe;
|
||||
for (std::string const& i : cmReverseRange(ChangeLists)) {
|
||||
SetP4Options(p4_describe);
|
||||
for (std::string const& i : cmReverseRange(this->ChangeLists)) {
|
||||
this->SetP4Options(p4_describe);
|
||||
p4_describe.push_back("describe");
|
||||
p4_describe.push_back("-s");
|
||||
p4_describe.push_back(i.c_str());
|
||||
@@ -443,7 +443,7 @@ bool cmCTestP4::LoadRevisions()
|
||||
bool cmCTestP4::LoadModifications()
|
||||
{
|
||||
std::vector<char const*> p4_diff;
|
||||
SetP4Options(p4_diff);
|
||||
this->SetP4Options(p4_diff);
|
||||
|
||||
p4_diff.push_back("diff");
|
||||
|
||||
@@ -491,7 +491,7 @@ bool cmCTestP4::UpdateImpl()
|
||||
}
|
||||
|
||||
std::vector<char const*> p4_sync;
|
||||
SetP4Options(p4_sync);
|
||||
this->SetP4Options(p4_sync);
|
||||
|
||||
p4_sync.push_back("sync");
|
||||
|
||||
|
||||
@@ -198,7 +198,7 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
|
||||
if (this->CTest->GetTestProgressOutput()) {
|
||||
if (!passed) {
|
||||
// If the test did not pass, reprint test name and error
|
||||
std::string output = GetTestPrefix(completed, total);
|
||||
std::string output = this->GetTestPrefix(completed, total);
|
||||
std::string testName = this->TestProperties->Name;
|
||||
const int maxTestNameWidth = this->CTest->GetMaxTestNameWidth();
|
||||
testName.resize(maxTestNameWidth + 4, '.');
|
||||
@@ -211,8 +211,8 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
|
||||
cmCTestLog(this->CTest, HANDLER_TEST_PROGRESS_OUTPUT, "\n"); // flush
|
||||
}
|
||||
if (completed == total) {
|
||||
std::string testName =
|
||||
GetTestPrefix(completed, total) + this->TestProperties->Name + "\n";
|
||||
std::string testName = this->GetTestPrefix(completed, total) +
|
||||
this->TestProperties->Name + "\n";
|
||||
cmCTestLog(this->CTest, HANDLER_TEST_PROGRESS_OUTPUT, testName);
|
||||
}
|
||||
}
|
||||
@@ -485,8 +485,8 @@ bool cmCTestRunTest::StartTest(size_t completed, size_t total)
|
||||
<< this->TestProperties->Index << ": "
|
||||
<< this->TestProperties->Name << std::endl);
|
||||
} else {
|
||||
std::string testName =
|
||||
GetTestPrefix(completed, total) + this->TestProperties->Name + "\n";
|
||||
std::string testName = this->GetTestPrefix(completed, total) +
|
||||
this->TestProperties->Name + "\n";
|
||||
cmCTestLog(this->CTest, HANDLER_TEST_PROGRESS_OUTPUT, testName);
|
||||
}
|
||||
|
||||
|
||||
@@ -286,9 +286,9 @@ bool cmCTestSVN::RunSVNCommand(std::vector<char const*> const& parameters,
|
||||
args.push_back(nullptr);
|
||||
|
||||
if (strcmp(parameters[0], "update") == 0) {
|
||||
return RunUpdateCommand(&args[0], out, err);
|
||||
return this->RunUpdateCommand(&args[0], out, err);
|
||||
}
|
||||
return RunChild(&args[0], out, err);
|
||||
return this->RunChild(&args[0], out, err);
|
||||
}
|
||||
|
||||
class cmCTestSVN::LogParser
|
||||
@@ -328,7 +328,7 @@ private:
|
||||
this->CData.clear();
|
||||
if (name == "logentry") {
|
||||
this->Rev = Revision();
|
||||
this->Rev.SVNInfo = &SVNRepo;
|
||||
this->Rev.SVNInfo = &this->SVNRepo;
|
||||
if (const char* rev =
|
||||
cmCTestSVN::LogParser::FindAttribute(atts, "revision")) {
|
||||
this->Rev.Rev = rev;
|
||||
@@ -354,7 +354,7 @@ private:
|
||||
this->SVN->DoRevisionSVN(this->Rev, this->Changes);
|
||||
} else if (!this->CData.empty() && name == "path") {
|
||||
std::string orig_path(&this->CData[0], this->CData.size());
|
||||
std::string new_path = SVNRepo.BuildLocalPath(orig_path);
|
||||
std::string new_path = this->SVNRepo.BuildLocalPath(orig_path);
|
||||
this->CurChange.Path.assign(new_path);
|
||||
this->Changes.push_back(this->CurChange);
|
||||
} else if (!this->CData.empty() && name == "author") {
|
||||
|
||||
@@ -340,7 +340,7 @@ void cmCTestTestHandler::Initialize()
|
||||
this->ExcludeFixtureSetupRegExp.clear();
|
||||
this->ExcludeFixtureCleanupRegExp.clear();
|
||||
|
||||
TestsToRunString.clear();
|
||||
this->TestsToRunString.clear();
|
||||
this->UseUnion = false;
|
||||
this->TestList.clear();
|
||||
}
|
||||
@@ -877,7 +877,7 @@ bool cmCTestTestHandler::ComputeTestList()
|
||||
finalList.push_back(tp);
|
||||
}
|
||||
|
||||
UpdateForFixtures(finalList);
|
||||
this->UpdateForFixtures(finalList);
|
||||
|
||||
// Save the total number of tests before exclusions
|
||||
this->TotalNumberOfTests = this->TestList.size();
|
||||
@@ -906,7 +906,7 @@ void cmCTestTestHandler::ComputeTestListForRerunFailed()
|
||||
finalList.push_back(tp);
|
||||
}
|
||||
|
||||
UpdateForFixtures(finalList);
|
||||
this->UpdateForFixtures(finalList);
|
||||
|
||||
// Save the total number of tests before exclusions
|
||||
this->TotalNumberOfTests = this->TestList.size();
|
||||
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
}
|
||||
foundFile = true;
|
||||
inSource = false;
|
||||
filename = getValue(line, 0);
|
||||
filename = this->getValue(line, 0);
|
||||
} else if ((line.find("coverage") != std::string::npos) && foundFile &&
|
||||
inSource) {
|
||||
/*
|
||||
@@ -78,7 +78,7 @@ public:
|
||||
* FoundFile and foundSource ensure that
|
||||
* only the value of the line coverage is captured
|
||||
*/
|
||||
std::string result = getValue(line, 1);
|
||||
std::string result = this->getValue(line, 1);
|
||||
result = result.substr(2);
|
||||
if (result == "\"\"") {
|
||||
// Empty quotation marks indicate that the
|
||||
|
||||
@@ -66,7 +66,7 @@ protected:
|
||||
|
||||
// Check if this is an absolute path that falls within our
|
||||
// source or binary directories.
|
||||
for (std::string const& filePath : FilePaths) {
|
||||
for (std::string const& filePath : this->FilePaths) {
|
||||
if (cmHasPrefix(filename, filePath)) {
|
||||
this->CurFileName = filename;
|
||||
break;
|
||||
@@ -76,7 +76,7 @@ protected:
|
||||
if (this->CurFileName.empty()) {
|
||||
// Check if this is a path that is relative to our source or
|
||||
// binary directories.
|
||||
for (std::string const& filePath : FilePaths) {
|
||||
for (std::string const& filePath : this->FilePaths) {
|
||||
finalpath = cmStrCat(filePath, "/", filename);
|
||||
if (cmSystemTools::FileExists(finalpath)) {
|
||||
this->CurFileName = finalpath;
|
||||
|
||||
@@ -133,7 +133,7 @@ public:
|
||||
cmsys::Glob gl;
|
||||
gl.RecurseOn();
|
||||
gl.RecurseThroughSymlinksOff();
|
||||
std::string glob = Coverage.SourceDir + "*/" + filename;
|
||||
std::string glob = this->Coverage.SourceDir + "*/" + filename;
|
||||
gl.FindFiles(glob);
|
||||
std::vector<std::string> const& files = gl.GetFiles();
|
||||
if (files.empty()) {
|
||||
|
||||
@@ -177,7 +177,7 @@ bool cmProcess::Buffer::GetLine(std::string& line)
|
||||
|
||||
// Start a new range for the next line.
|
||||
++this->Last;
|
||||
this->First = Last;
|
||||
this->First = this->Last;
|
||||
|
||||
// Return the line extracted.
|
||||
return true;
|
||||
|
||||
@@ -467,7 +467,7 @@ bool DumpFile(std::string const& nmPath, const char* filename,
|
||||
|
||||
bool bindexplib::AddObjectFile(const char* filename)
|
||||
{
|
||||
return DumpFile(NmPath, filename, this->Symbols, this->DataSymbols);
|
||||
return DumpFile(this->NmPath, filename, this->Symbols, this->DataSymbols);
|
||||
}
|
||||
|
||||
bool bindexplib::AddDefinitionFile(const char* filename)
|
||||
@@ -511,5 +511,5 @@ void bindexplib::WriteFile(FILE* file)
|
||||
|
||||
void bindexplib::SetNmPath(std::string const& nm)
|
||||
{
|
||||
NmPath = nm;
|
||||
this->NmPath = nm;
|
||||
}
|
||||
|
||||
@@ -47,7 +47,8 @@ struct BinarySearcher
|
||||
|
||||
bool operator()(argument_type const& item) const
|
||||
{
|
||||
return std::binary_search(m_range.begin(), m_range.end(), item);
|
||||
return std::binary_search(this->m_range.begin(), this->m_range.end(),
|
||||
item);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -26,7 +26,7 @@ public:
|
||||
}
|
||||
void Clear() { this->IsValueSet = false; }
|
||||
bool IsSet() const { return this->IsValueSet; }
|
||||
T Get() const { return Value; }
|
||||
T Get() const { return this->Value; }
|
||||
|
||||
private:
|
||||
T Value;
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
template <typename T>
|
||||
CMakePathArgumentParser& Bind(cm::static_string_view name, T Result::*member)
|
||||
{
|
||||
cmArgumentParser<Result>::Bind(name, member);
|
||||
this->cmArgumentParser<Result>::Bind(name, member);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -48,12 +48,12 @@ public:
|
||||
{
|
||||
this->Inputs.clear();
|
||||
|
||||
return cmArgumentParser<Result>::Parse(cmMakeRange(args).advance(Advance),
|
||||
&this->Inputs, keywordsMissingValue,
|
||||
parsedKeywords);
|
||||
return this->cmArgumentParser<Result>::Parse(
|
||||
cmMakeRange(args).advance(Advance), &this->Inputs, keywordsMissingValue,
|
||||
parsedKeywords);
|
||||
}
|
||||
|
||||
const std::vector<std::string>& GetInputs() const { return Inputs; }
|
||||
const std::vector<std::string>& GetInputs() const { return this->Inputs; }
|
||||
|
||||
protected:
|
||||
mutable std::vector<std::string> Inputs;
|
||||
@@ -74,7 +74,7 @@ public:
|
||||
ArgumentParserWithOutputVariable& Bind(cm::static_string_view name,
|
||||
T Result::*member)
|
||||
{
|
||||
cmArgumentParser<Result>::Bind(name, member);
|
||||
this->cmArgumentParser<Result>::Bind(name, member);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ public:
|
||||
this->KeywordsMissingValue.clear();
|
||||
this->ParsedKeywords.clear();
|
||||
|
||||
return CMakePathArgumentParser<Result>::template Parse<Advance>(
|
||||
return this->CMakePathArgumentParser<Result>::template Parse<Advance>(
|
||||
args, &this->KeywordsMissingValue, &this->ParsedKeywords);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -1326,11 +1326,11 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output,
|
||||
if (result == cmsysProcess_State_Exited) {
|
||||
*retVal = cmsysProcess_GetExitValue(cp);
|
||||
if (*retVal != 0 && this->Impl->OutputTestOutputOnTestFailure) {
|
||||
OutputTestErrors(tempOutput);
|
||||
this->OutputTestErrors(tempOutput);
|
||||
}
|
||||
} else if (result == cmsysProcess_State_Exception) {
|
||||
if (this->Impl->OutputTestOutputOnTestFailure) {
|
||||
OutputTestErrors(tempOutput);
|
||||
this->OutputTestErrors(tempOutput);
|
||||
}
|
||||
*retVal = cmsysProcess_GetExitException(cp);
|
||||
std::string outerr = cmStrCat("\n*** Exception executing: ",
|
||||
|
||||
@@ -240,7 +240,7 @@ int cmCommandArgumentParserHelper::ParseString(std::string const& str,
|
||||
|
||||
this->CleanupParser();
|
||||
|
||||
if (Verbose) {
|
||||
if (this->Verbose) {
|
||||
std::cerr << "Expanding [" << str << "] produced: [" << this->Result << "]"
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ cmCommonTargetGenerator::cmCommonTargetGenerator(cmGeneratorTarget* gt)
|
||||
static_cast<cmLocalCommonGenerator*>(gt->LocalGenerator))
|
||||
, GlobalCommonGenerator(static_cast<cmGlobalCommonGenerator*>(
|
||||
gt->LocalGenerator->GetGlobalGenerator()))
|
||||
, ConfigNames(LocalCommonGenerator->GetConfigNames())
|
||||
, ConfigNames(this->LocalCommonGenerator->GetConfigNames())
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -525,7 +525,7 @@ void cmComputeTargetDepends::DisplayGraph(Graph const& graph,
|
||||
void cmComputeTargetDepends::DisplaySideEffects()
|
||||
{
|
||||
fprintf(stderr, "The side effects are:\n");
|
||||
int n = static_cast<int>(SideEffects.size());
|
||||
int n = static_cast<int>(this->SideEffects.size());
|
||||
for (int depender_index = 0; depender_index < n; ++depender_index) {
|
||||
cmGeneratorTarget const* depender = this->Targets[depender_index];
|
||||
fprintf(stderr, "target %d is [%s]\n", depender_index,
|
||||
|
||||
@@ -271,10 +271,10 @@ bool cmConditionEvaluator::GetBooleanValueWithAutoDereference(
|
||||
{
|
||||
// Use the policy if it is set.
|
||||
if (this->Policy12Status == cmPolicies::NEW) {
|
||||
return GetBooleanValue(newArg);
|
||||
return this->GetBooleanValue(newArg);
|
||||
}
|
||||
if (this->Policy12Status == cmPolicies::OLD) {
|
||||
return GetBooleanValueOld(newArg, oneArg);
|
||||
return this->GetBooleanValueOld(newArg, oneArg);
|
||||
}
|
||||
|
||||
// Check policy only if old and new results differ.
|
||||
@@ -367,7 +367,7 @@ bool cmConditionEvaluator::HandleLevel0(cmArgumentList& newArgs,
|
||||
reducible = 0;
|
||||
auto arg = newArgs.begin();
|
||||
while (arg != newArgs.end()) {
|
||||
if (IsKeyword(keyParenL, *arg)) {
|
||||
if (this->IsKeyword(keyParenL, *arg)) {
|
||||
// search for the closing paren for this opening one
|
||||
cmArgumentList::iterator argClose;
|
||||
argClose = arg;
|
||||
@@ -531,7 +531,7 @@ bool cmConditionEvaluator::HandleLevel2(cmArgumentList& newArgs,
|
||||
argP1 = arg;
|
||||
this->IncrementArguments(newArgs, argP1, argP2);
|
||||
if (argP1 != newArgs.end() && argP2 != newArgs.end() &&
|
||||
IsKeyword(keyMATCHES, *argP1)) {
|
||||
this->IsKeyword(keyMATCHES, *argP1)) {
|
||||
def = this->GetDefinitionIfUnquoted(*arg);
|
||||
if (!def) {
|
||||
def = &arg->GetValue();
|
||||
@@ -707,8 +707,8 @@ bool cmConditionEvaluator::HandleLevel3(cmArgumentList& newArgs,
|
||||
cmArgumentList::iterator argP2;
|
||||
while (arg != newArgs.end()) {
|
||||
argP1 = arg;
|
||||
IncrementArguments(newArgs, argP1, argP2);
|
||||
if (argP1 != newArgs.end() && IsKeyword(keyNOT, *arg)) {
|
||||
this->IncrementArguments(newArgs, argP1, argP2);
|
||||
if (argP1 != newArgs.end() && this->IsKeyword(keyNOT, *arg)) {
|
||||
bool rhs = this->GetBooleanValueWithAutoDereference(
|
||||
*argP1, errorString, status);
|
||||
this->HandlePredicate(!rhs, reducible, arg, newArgs, argP1, argP2);
|
||||
@@ -735,8 +735,8 @@ bool cmConditionEvaluator::HandleLevel4(cmArgumentList& newArgs,
|
||||
cmArgumentList::iterator argP2;
|
||||
while (arg != newArgs.end()) {
|
||||
argP1 = arg;
|
||||
IncrementArguments(newArgs, argP1, argP2);
|
||||
if (argP1 != newArgs.end() && IsKeyword(keyAND, *argP1) &&
|
||||
this->IncrementArguments(newArgs, argP1, argP2);
|
||||
if (argP1 != newArgs.end() && this->IsKeyword(keyAND, *argP1) &&
|
||||
argP2 != newArgs.end()) {
|
||||
lhs =
|
||||
this->GetBooleanValueWithAutoDereference(*arg, errorString, status);
|
||||
|
||||
@@ -36,7 +36,7 @@ static rhash cmCryptoHash_rhash_init(unsigned int id)
|
||||
|
||||
cmCryptoHash::cmCryptoHash(Algo algo)
|
||||
: Id(cmCryptoHashAlgoToId[algo])
|
||||
, CTX(cmCryptoHash_rhash_init(Id))
|
||||
, CTX(cmCryptoHash_rhash_init(this->Id))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -202,13 +202,13 @@ void cmDependsCompiler::WriteDependencies(
|
||||
|
||||
// external dependencies file
|
||||
for (auto& node : makeDependencies) {
|
||||
auto target = LocalGenerator->ConvertToMakefilePath(
|
||||
auto target = this->LocalGenerator->ConvertToMakefilePath(
|
||||
this->LocalGenerator->MaybeConvertToRelativePath(binDir, node.first));
|
||||
auto& deps = node.second;
|
||||
std::transform(
|
||||
deps.cbegin(), deps.cend(), deps.begin(),
|
||||
[this, &binDir](const std::string& dep) {
|
||||
return LocalGenerator->ConvertToMakefilePath(
|
||||
return this->LocalGenerator->ConvertToMakefilePath(
|
||||
this->LocalGenerator->MaybeConvertToRelativePath(binDir, dep));
|
||||
});
|
||||
|
||||
|
||||
@@ -194,7 +194,7 @@ void cmDocumentation::addCTestStandardDocSections()
|
||||
{
|
||||
// This is currently done for backward compatibility reason
|
||||
// We may suppress some of these.
|
||||
addCMakeStandardDocSections();
|
||||
this->addCMakeStandardDocSections();
|
||||
}
|
||||
|
||||
void cmDocumentation::addCPackStandardDocSections()
|
||||
|
||||
+4
-4
@@ -379,7 +379,7 @@ private:
|
||||
|
||||
// Fix the byte order of the header.
|
||||
if (this->NeedSwap) {
|
||||
ByteSwap(x);
|
||||
this->ByteSwap(x);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -387,7 +387,7 @@ private:
|
||||
{
|
||||
if (this->Stream->read(reinterpret_cast<char*>(&x), sizeof(x)) &&
|
||||
this->NeedSwap) {
|
||||
ByteSwap(x);
|
||||
this->ByteSwap(x);
|
||||
}
|
||||
return !this->Stream->fail();
|
||||
}
|
||||
@@ -395,7 +395,7 @@ private:
|
||||
{
|
||||
if (this->Stream->read(reinterpret_cast<char*>(&x), sizeof(x)) &&
|
||||
this->NeedSwap) {
|
||||
ByteSwap(x);
|
||||
this->ByteSwap(x);
|
||||
}
|
||||
return !this->Stream->fail();
|
||||
}
|
||||
@@ -573,7 +573,7 @@ std::vector<char> cmELFInternalImpl<Types>::EncodeDynamicEntries(
|
||||
dyn.d_un.d_val = static_cast<tagtype>(entry.second);
|
||||
|
||||
if (this->NeedSwap) {
|
||||
ByteSwap(dyn);
|
||||
this->ByteSwap(dyn);
|
||||
}
|
||||
|
||||
char* pdyn = reinterpret_cast<char*>(&dyn);
|
||||
|
||||
@@ -42,20 +42,22 @@ int cmExprParserHelper::ParseString(const char* str, int verb)
|
||||
try {
|
||||
int res = cmExpr_yyparse(yyscanner);
|
||||
if (res != 0) {
|
||||
std::string e = cmStrCat("cannot parse the expression: \"", InputBuffer,
|
||||
"\": ", ErrorString, '.');
|
||||
std::string e =
|
||||
cmStrCat("cannot parse the expression: \"", this->InputBuffer,
|
||||
"\": ", this->ErrorString, '.');
|
||||
this->SetError(std::move(e));
|
||||
}
|
||||
} catch (std::runtime_error const& fail) {
|
||||
std::string e = cmStrCat("cannot evaluate the expression: \"", InputBuffer,
|
||||
"\": ", fail.what(), '.');
|
||||
std::string e = cmStrCat("cannot evaluate the expression: \"",
|
||||
this->InputBuffer, "\": ", fail.what(), '.');
|
||||
this->SetError(std::move(e));
|
||||
} catch (std::out_of_range const&) {
|
||||
std::string e = "cannot evaluate the expression: \"" + InputBuffer +
|
||||
std::string e = "cannot evaluate the expression: \"" + this->InputBuffer +
|
||||
"\": a numeric value is out of range.";
|
||||
this->SetError(std::move(e));
|
||||
} catch (...) {
|
||||
std::string e = "cannot parse the expression: \"" + InputBuffer + "\".";
|
||||
std::string e =
|
||||
"cannot parse the expression: \"" + this->InputBuffer + "\".";
|
||||
this->SetError(std::move(e));
|
||||
}
|
||||
cmExpr_yylex_destroy(yyscanner);
|
||||
@@ -63,7 +65,7 @@ int cmExprParserHelper::ParseString(const char* str, int verb)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (Verbose) {
|
||||
if (this->Verbose) {
|
||||
std::cerr << "Expanding [" << str << "] produced: [" << this->Result << "]"
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
@@ -52,8 +52,8 @@ public:
|
||||
//! Generate the project files, the Makefiles have already been generated
|
||||
virtual void Generate() = 0;
|
||||
|
||||
void SetName(const std::string& n) { Name = n; }
|
||||
std::string GetName() const { return Name; }
|
||||
void SetName(const std::string& n) { this->Name = n; }
|
||||
std::string GetName() const { return this->Name; }
|
||||
|
||||
virtual bool Open(const std::string& bindir, const std::string& projectName,
|
||||
bool dryRun);
|
||||
@@ -104,7 +104,7 @@ public:
|
||||
CreateExternalMakefileProjectGenerator() const override
|
||||
{
|
||||
std::unique_ptr<cmExternalMakefileProjectGenerator> p(new T);
|
||||
p->SetName(GetName());
|
||||
p->SetName(this->GetName());
|
||||
return p;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -112,10 +112,10 @@ void Tree::InsertPath(const std::vector<std::string>& split,
|
||||
const std::string& fileName)
|
||||
{
|
||||
if (start == split.size()) {
|
||||
files.insert(fileName);
|
||||
this->files.insert(fileName);
|
||||
return;
|
||||
}
|
||||
for (Tree& folder : folders) {
|
||||
for (Tree& folder : this->folders) {
|
||||
if (folder.path == split[start]) {
|
||||
if (start + 1 < split.size()) {
|
||||
folder.InsertPath(split, start + 1, fileName);
|
||||
@@ -131,19 +131,19 @@ void Tree::InsertPath(const std::vector<std::string>& split,
|
||||
newFolder.path = split[start];
|
||||
if (start + 1 < split.size()) {
|
||||
newFolder.InsertPath(split, start + 1, fileName);
|
||||
folders.push_back(newFolder);
|
||||
this->folders.push_back(newFolder);
|
||||
return;
|
||||
}
|
||||
// last part of split
|
||||
newFolder.files.insert(fileName);
|
||||
folders.push_back(newFolder);
|
||||
this->folders.push_back(newFolder);
|
||||
}
|
||||
|
||||
void Tree::BuildVirtualFolder(cmXMLWriter& xml) const
|
||||
{
|
||||
xml.StartElement("Option");
|
||||
std::string virtualFolders = "CMake Files\\;";
|
||||
for (Tree const& folder : folders) {
|
||||
for (Tree const& folder : this->folders) {
|
||||
folder.BuildVirtualFolderImpl(virtualFolders, "");
|
||||
}
|
||||
xml.Attribute("virtualFolders", virtualFolders);
|
||||
@@ -153,15 +153,15 @@ void Tree::BuildVirtualFolder(cmXMLWriter& xml) const
|
||||
void Tree::BuildVirtualFolderImpl(std::string& virtualFolders,
|
||||
const std::string& prefix) const
|
||||
{
|
||||
virtualFolders += "CMake Files\\" + prefix + path + "\\;";
|
||||
for (Tree const& folder : folders) {
|
||||
folder.BuildVirtualFolderImpl(virtualFolders, prefix + path + "\\");
|
||||
virtualFolders += "CMake Files\\" + prefix + this->path + "\\;";
|
||||
for (Tree const& folder : this->folders) {
|
||||
folder.BuildVirtualFolderImpl(virtualFolders, prefix + this->path + "\\");
|
||||
}
|
||||
}
|
||||
|
||||
void Tree::BuildUnit(cmXMLWriter& xml, const std::string& fsPath) const
|
||||
{
|
||||
for (std::string const& f : files) {
|
||||
for (std::string const& f : this->files) {
|
||||
xml.StartElement("Unit");
|
||||
xml.Attribute("filename", fsPath + f);
|
||||
|
||||
@@ -171,7 +171,7 @@ void Tree::BuildUnit(cmXMLWriter& xml, const std::string& fsPath) const
|
||||
|
||||
xml.EndElement();
|
||||
}
|
||||
for (Tree const& folder : folders) {
|
||||
for (Tree const& folder : this->folders) {
|
||||
folder.BuildUnitImpl(xml, "", fsPath);
|
||||
}
|
||||
}
|
||||
@@ -180,20 +180,21 @@ void Tree::BuildUnitImpl(cmXMLWriter& xml,
|
||||
const std::string& virtualFolderPath,
|
||||
const std::string& fsPath) const
|
||||
{
|
||||
for (std::string const& f : files) {
|
||||
for (std::string const& f : this->files) {
|
||||
xml.StartElement("Unit");
|
||||
xml.Attribute("filename", cmStrCat(fsPath, path, "/", f));
|
||||
xml.Attribute("filename", cmStrCat(fsPath, this->path, "/", f));
|
||||
|
||||
xml.StartElement("Option");
|
||||
xml.Attribute("virtualFolder",
|
||||
cmStrCat("CMake Files\\", virtualFolderPath, path, "\\"));
|
||||
xml.Attribute(
|
||||
"virtualFolder",
|
||||
cmStrCat("CMake Files\\", virtualFolderPath, this->path, "\\"));
|
||||
xml.EndElement();
|
||||
|
||||
xml.EndElement();
|
||||
}
|
||||
for (Tree const& folder : folders) {
|
||||
folder.BuildUnitImpl(xml, cmStrCat(virtualFolderPath, path, "\\"),
|
||||
cmStrCat(fsPath, path, "/"));
|
||||
for (Tree const& folder : this->folders) {
|
||||
folder.BuildUnitImpl(xml, cmStrCat(virtualFolderPath, this->path, "\\"),
|
||||
cmStrCat(fsPath, this->path, "/"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ void cmExtraCodeLiteGenerator::Generate()
|
||||
for (auto const& it : projectMap) {
|
||||
cmLocalGenerator* lg = it.second[0];
|
||||
const cmMakefile* mf = lg->GetMakefile();
|
||||
this->ConfigName = GetConfigurationName(mf);
|
||||
this->ConfigName = this->GetConfigurationName(mf);
|
||||
|
||||
if (lg->GetCurrentBinaryDirectory() == lg->GetBinaryDirectory()) {
|
||||
workspaceOutputDir = lg->GetCurrentBinaryDirectory();
|
||||
@@ -89,9 +89,9 @@ void cmExtraCodeLiteGenerator::Generate()
|
||||
|
||||
std::vector<std::string> ProjectNames;
|
||||
if (targetsAreProjects) {
|
||||
ProjectNames = CreateProjectsByTarget(&xml);
|
||||
ProjectNames = this->CreateProjectsByTarget(&xml);
|
||||
} else {
|
||||
ProjectNames = CreateProjectsByProjectMaps(&xml);
|
||||
ProjectNames = this->CreateProjectsByProjectMaps(&xml);
|
||||
}
|
||||
|
||||
xml.StartElement("BuildMatrix");
|
||||
@@ -142,7 +142,7 @@ std::vector<std::string> cmExtraCodeLiteGenerator::CreateProjectsByTarget(
|
||||
xml->Attribute("Active", "No");
|
||||
xml->EndElement();
|
||||
|
||||
CreateNewProjectFile(lt.get(), filename);
|
||||
this->CreateNewProjectFile(lt.get(), filename);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -268,7 +268,7 @@ void cmExtraCodeLiteGenerator::CreateNewProjectFile(
|
||||
cmMakefile* makefile = lg->GetMakefile();
|
||||
for (const auto& target : lg->GetGeneratorTargets()) {
|
||||
projectType =
|
||||
CollectSourceFiles(makefile, target.get(), cFiles, otherFiles);
|
||||
this->CollectSourceFiles(makefile, target.get(), cFiles, otherFiles);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -276,8 +276,8 @@ void cmExtraCodeLiteGenerator::CreateNewProjectFile(
|
||||
// their relative path)
|
||||
std::string projectPath = cmSystemTools::GetFilenamePath(filename);
|
||||
|
||||
CreateProjectSourceEntries(cFiles, otherFiles, &xml, projectPath, mf,
|
||||
projectType, "");
|
||||
this->CreateProjectSourceEntries(cFiles, otherFiles, &xml, projectPath, mf,
|
||||
projectType, "");
|
||||
|
||||
xml.EndElement(); // CodeLite_Project
|
||||
}
|
||||
@@ -402,7 +402,7 @@ void cmExtraCodeLiteGenerator::CreateProjectSourceEntries(
|
||||
const std::string& projectType, const std::string& targetName)
|
||||
{
|
||||
cmXMLWriter& xml(*_xml);
|
||||
FindMatchingHeaderfiles(cFiles, otherFiles);
|
||||
this->FindMatchingHeaderfiles(cFiles, otherFiles);
|
||||
// Create 2 virtual folders: src and include
|
||||
// and place all the implementation files into the src
|
||||
// folder, the rest goes to the include folder
|
||||
@@ -498,10 +498,10 @@ void cmExtraCodeLiteGenerator::CreateProjectSourceEntries(
|
||||
|
||||
xml.StartElement("CustomBuild");
|
||||
xml.Attribute("Enabled", "yes");
|
||||
xml.Element("RebuildCommand", GetRebuildCommand(mf, targetName));
|
||||
xml.Element("CleanCommand", GetCleanCommand(mf, targetName));
|
||||
xml.Element("BuildCommand", GetBuildCommand(mf, targetName));
|
||||
xml.Element("SingleFileCommand", GetSingleFileBuildCommand(mf));
|
||||
xml.Element("RebuildCommand", this->GetRebuildCommand(mf, targetName));
|
||||
xml.Element("CleanCommand", this->GetCleanCommand(mf, targetName));
|
||||
xml.Element("BuildCommand", this->GetBuildCommand(mf, targetName));
|
||||
xml.Element("SingleFileCommand", this->GetSingleFileBuildCommand(mf));
|
||||
xml.Element("PreprocessFileCommand");
|
||||
xml.Element("WorkingDirectory", "$(WorkspacePath)");
|
||||
xml.EndElement(); // CustomBuild
|
||||
@@ -570,14 +570,14 @@ void cmExtraCodeLiteGenerator::CreateNewProjectFile(
|
||||
std::map<std::string, cmSourceFile*> cFiles;
|
||||
std::set<std::string> otherFiles;
|
||||
|
||||
projectType = CollectSourceFiles(mf, gt, cFiles, otherFiles);
|
||||
projectType = this->CollectSourceFiles(mf, gt, cFiles, otherFiles);
|
||||
|
||||
// Get the project path ( we need it later to convert files to
|
||||
// their relative path)
|
||||
std::string projectPath = cmSystemTools::GetFilenamePath(filename);
|
||||
|
||||
CreateProjectSourceEntries(cFiles, otherFiles, &xml, projectPath, mf,
|
||||
projectType, targetName);
|
||||
this->CreateProjectSourceEntries(cFiles, otherFiles, &xml, projectPath, mf,
|
||||
projectType, targetName);
|
||||
|
||||
xml.EndElement(); // CodeLite_Project
|
||||
}
|
||||
@@ -648,7 +648,7 @@ std::string cmExtraCodeLiteGenerator::GetCleanCommand(
|
||||
{
|
||||
std::string generator = mf->GetSafeDefinition("CMAKE_GENERATOR");
|
||||
std::ostringstream ss;
|
||||
std::string buildcommand = GetBuildCommand(mf, "");
|
||||
std::string buildcommand = this->GetBuildCommand(mf, "");
|
||||
if (!targetName.empty() && generator == "Ninja") {
|
||||
ss << buildcommand << " -t clean " << targetName;
|
||||
} else {
|
||||
@@ -660,8 +660,8 @@ std::string cmExtraCodeLiteGenerator::GetCleanCommand(
|
||||
std::string cmExtraCodeLiteGenerator::GetRebuildCommand(
|
||||
const cmMakefile* mf, const std::string& targetName) const
|
||||
{
|
||||
return GetCleanCommand(mf, targetName) + " && " +
|
||||
GetBuildCommand(mf, targetName);
|
||||
return this->GetCleanCommand(mf, targetName) + " && " +
|
||||
this->GetBuildCommand(mf, targetName);
|
||||
}
|
||||
|
||||
std::string cmExtraCodeLiteGenerator::GetSingleFileBuildCommand(
|
||||
|
||||
@@ -132,7 +132,7 @@ void cmExtraSublimeTextGenerator::CreateNewProjectFile(
|
||||
// doesn't currently support these settings per build system, only project
|
||||
// wide
|
||||
MapSourceFileFlags sourceFileFlags;
|
||||
AppendAllTargets(lgs, mf, fout, sourceFileFlags);
|
||||
this->AppendAllTargets(lgs, mf, fout, sourceFileFlags);
|
||||
|
||||
// End of build_systems
|
||||
fout << "\n\t]";
|
||||
|
||||
@@ -41,7 +41,7 @@ CMakeFiles::CMakeFiles(cmFileAPI& fileAPI, unsigned long version)
|
||||
, CMakeModules(cmSystemTools::GetCMakeRoot() + "/Modules")
|
||||
, TopSource(this->FileAPI.GetCMakeInstance()->GetHomeDirectory())
|
||||
, TopBuild(this->FileAPI.GetCMakeInstance()->GetHomeOutputDirectory())
|
||||
, OutOfSource(TopBuild != TopSource)
|
||||
, OutOfSource(this->TopBuild != this->TopSource)
|
||||
{
|
||||
static_cast<void>(this->Version);
|
||||
}
|
||||
@@ -50,7 +50,7 @@ Json::Value CMakeFiles::Dump()
|
||||
{
|
||||
Json::Value cmakeFiles = Json::objectValue;
|
||||
cmakeFiles["paths"] = this->DumpPaths();
|
||||
cmakeFiles["inputs"] = DumpInputs();
|
||||
cmakeFiles["inputs"] = this->DumpInputs();
|
||||
return cmakeFiles;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ Cache::Cache(cmFileAPI& fileAPI, unsigned long version)
|
||||
Json::Value Cache::Dump()
|
||||
{
|
||||
Json::Value cache = Json::objectValue;
|
||||
cache["entries"] = DumpEntries();
|
||||
cache["entries"] = this->DumpEntries();
|
||||
return cache;
|
||||
}
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ class JBTIndex
|
||||
{
|
||||
public:
|
||||
JBTIndex() = default;
|
||||
explicit operator bool() const { return Index != None; }
|
||||
explicit operator bool() const { return this->Index != None; }
|
||||
Json::ArrayIndex Index = None;
|
||||
static Json::ArrayIndex const None = static_cast<Json::ArrayIndex>(-1);
|
||||
};
|
||||
|
||||
@@ -16,15 +16,16 @@ cmFilePathChecksum::cmFilePathChecksum(std::string const& currentSrcDir,
|
||||
std::string const& projectSrcDir,
|
||||
std::string const& projectBinDir)
|
||||
{
|
||||
setupParentDirs(currentSrcDir, currentBinDir, projectSrcDir, projectBinDir);
|
||||
this->setupParentDirs(currentSrcDir, currentBinDir, projectSrcDir,
|
||||
projectBinDir);
|
||||
}
|
||||
|
||||
cmFilePathChecksum::cmFilePathChecksum(cmMakefile* makefile)
|
||||
{
|
||||
setupParentDirs(makefile->GetCurrentSourceDirectory(),
|
||||
makefile->GetCurrentBinaryDirectory(),
|
||||
makefile->GetHomeDirectory(),
|
||||
makefile->GetHomeOutputDirectory());
|
||||
this->setupParentDirs(makefile->GetCurrentSourceDirectory(),
|
||||
makefile->GetCurrentBinaryDirectory(),
|
||||
makefile->GetHomeDirectory(),
|
||||
makefile->GetHomeOutputDirectory());
|
||||
}
|
||||
|
||||
void cmFilePathChecksum::setupParentDirs(std::string const& currentSrcDir,
|
||||
@@ -81,5 +82,5 @@ std::string cmFilePathChecksum::get(std::string const& filePath) const
|
||||
std::string cmFilePathChecksum::getPart(std::string const& filePath,
|
||||
size_t length) const
|
||||
{
|
||||
return get(filePath).substr(0, length);
|
||||
return this->get(filePath).substr(0, length);
|
||||
}
|
||||
|
||||
@@ -62,14 +62,14 @@ public:
|
||||
cmFileTimes::cmFileTimes() = default;
|
||||
cmFileTimes::cmFileTimes(std::string const& fileName)
|
||||
{
|
||||
Load(fileName);
|
||||
this->Load(fileName);
|
||||
}
|
||||
cmFileTimes::~cmFileTimes() = default;
|
||||
|
||||
bool cmFileTimes::Load(std::string const& fileName)
|
||||
{
|
||||
std::unique_ptr<Times> ptr;
|
||||
if (IsValid()) {
|
||||
if (this->IsValid()) {
|
||||
// Invalidate this and re-use times
|
||||
ptr.swap(this->times);
|
||||
} else {
|
||||
@@ -103,7 +103,7 @@ bool cmFileTimes::Load(std::string const& fileName)
|
||||
|
||||
bool cmFileTimes::Store(std::string const& fileName) const
|
||||
{
|
||||
if (!IsValid()) {
|
||||
if (!this->IsValid()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ public:
|
||||
~cmFileTimes();
|
||||
|
||||
//! @return true, if file times were loaded successfully
|
||||
bool IsValid() const { return (times != nullptr); }
|
||||
bool IsValid() const { return (this->times != nullptr); }
|
||||
//! Try to load the file times from @a fileName and @return IsValid()
|
||||
bool Load(std::string const& fileName);
|
||||
//! Stores the file times at @a fileName (if IsValid())
|
||||
|
||||
@@ -289,7 +289,7 @@ void cmFindCommon::GetIgnoredPaths(std::vector<std::string>& ignore)
|
||||
void cmFindCommon::GetIgnoredPaths(std::set<std::string>& ignore)
|
||||
{
|
||||
std::vector<std::string> ignoreVec;
|
||||
GetIgnoredPaths(ignoreVec);
|
||||
this->GetIgnoredPaths(ignoreVec);
|
||||
ignore.insert(ignoreVec.begin(), ignoreVec.end());
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ cmFindLibraryCommand::cmFindLibraryCommand(cmExecutionStatus& status)
|
||||
// cmFindLibraryCommand
|
||||
bool cmFindLibraryCommand::InitialPass(std::vector<std::string> const& argsIn)
|
||||
{
|
||||
this->DebugMode = ComputeIfDebugModeWanted();
|
||||
this->DebugMode = this->ComputeIfDebugModeWanted();
|
||||
this->VariableDocumentation = "Path to a library.";
|
||||
this->CMakePathName = "LIBRARY";
|
||||
if (!this->ParseArguments(argsIn)) {
|
||||
|
||||
@@ -144,7 +144,7 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args)
|
||||
this->RequiredCMakeVersion = CMake_VERSION_ENCODE(v[0], v[1], v[2]);
|
||||
}
|
||||
|
||||
this->DebugMode = ComputeIfDebugModeWanted();
|
||||
this->DebugMode = this->ComputeIfDebugModeWanted();
|
||||
this->DebugBuffer.clear();
|
||||
|
||||
// Lookup target architecture, if any.
|
||||
@@ -534,7 +534,7 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args)
|
||||
loadedPackage = true;
|
||||
} else {
|
||||
// The package was not loaded. Report errors.
|
||||
if (HandlePackageMode(HandlePackageModeType::Module)) {
|
||||
if (this->HandlePackageMode(HandlePackageModeType::Module)) {
|
||||
loadedPackage = true;
|
||||
}
|
||||
}
|
||||
@@ -2070,8 +2070,8 @@ public:
|
||||
void SetSort(cmFindPackageCommand::SortOrderType o,
|
||||
cmFindPackageCommand::SortDirectionType d)
|
||||
{
|
||||
SortOrder = o;
|
||||
SortDirection = d;
|
||||
this->SortOrder = o;
|
||||
this->SortDirection = d;
|
||||
}
|
||||
|
||||
protected:
|
||||
@@ -2102,8 +2102,8 @@ private:
|
||||
// before testing the matches check if there is a specific sorting order to
|
||||
// perform
|
||||
if (this->SortOrder != cmFindPackageCommand::None) {
|
||||
cmFindPackageCommand::Sort(matches.begin(), matches.end(), SortOrder,
|
||||
SortDirection);
|
||||
cmFindPackageCommand::Sort(matches.begin(), matches.end(),
|
||||
this->SortOrder, this->SortDirection);
|
||||
}
|
||||
|
||||
for (std::string const& i : matches) {
|
||||
|
||||
@@ -22,7 +22,7 @@ cmFindPathCommand::cmFindPathCommand(cmExecutionStatus& status)
|
||||
// cmFindPathCommand
|
||||
bool cmFindPathCommand::InitialPass(std::vector<std::string> const& argsIn)
|
||||
{
|
||||
this->DebugMode = ComputeIfDebugModeWanted();
|
||||
this->DebugMode = this->ComputeIfDebugModeWanted();
|
||||
this->VariableDocumentation = "Path to a file.";
|
||||
this->CMakePathName = "INCLUDE";
|
||||
if (!this->ParseArguments(argsIn)) {
|
||||
|
||||
@@ -152,7 +152,7 @@ cmFindProgramCommand::cmFindProgramCommand(cmExecutionStatus& status)
|
||||
// cmFindProgramCommand
|
||||
bool cmFindProgramCommand::InitialPass(std::vector<std::string> const& argsIn)
|
||||
{
|
||||
this->DebugMode = ComputeIfDebugModeWanted();
|
||||
this->DebugMode = this->ComputeIfDebugModeWanted();
|
||||
this->VariableDocumentation = "Path to a program.";
|
||||
this->CMakePathName = "PROGRAM";
|
||||
// call cmFindBase::ParseArguments
|
||||
@@ -171,7 +171,7 @@ bool cmFindProgramCommand::InitialPass(std::vector<std::string> const& argsIn)
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string const result = FindProgram();
|
||||
std::string const result = this->FindProgram();
|
||||
if (!result.empty()) {
|
||||
// Save the value in the cache
|
||||
this->Makefile->AddCacheDefinition(this->VariableName, result,
|
||||
@@ -198,7 +198,7 @@ std::string cmFindProgramCommand::FindProgram()
|
||||
std::string program;
|
||||
|
||||
if (this->SearchAppBundleFirst || this->SearchAppBundleOnly) {
|
||||
program = FindAppBundle();
|
||||
program = this->FindAppBundle();
|
||||
}
|
||||
if (program.empty() && !this->SearchAppBundleOnly) {
|
||||
program = this->FindNormalProgram();
|
||||
@@ -274,7 +274,7 @@ std::string cmFindProgramCommand::FindAppBundle()
|
||||
cmSystemTools::FindDirectory(appName, this->SearchPaths, true);
|
||||
|
||||
if (!appPath.empty()) {
|
||||
std::string executable = GetBundleExecutable(appPath);
|
||||
std::string executable = this->GetBundleExecutable(appPath);
|
||||
if (!executable.empty()) {
|
||||
return cmSystemTools::CollapseFullPath(executable);
|
||||
}
|
||||
|
||||
@@ -14,11 +14,11 @@
|
||||
#endif
|
||||
|
||||
cmGeneratedFileStream::cmGeneratedFileStream(Encoding encoding)
|
||||
: OriginalLocale(getloc())
|
||||
: OriginalLocale(this->getloc())
|
||||
{
|
||||
#ifndef CMAKE_BOOTSTRAP
|
||||
if (encoding != codecvt::None) {
|
||||
imbue(std::locale(OriginalLocale, new codecvt(encoding)));
|
||||
this->imbue(std::locale(this->OriginalLocale, new codecvt(encoding)));
|
||||
}
|
||||
#else
|
||||
static_cast<void>(encoding);
|
||||
@@ -28,7 +28,7 @@ cmGeneratedFileStream::cmGeneratedFileStream(Encoding encoding)
|
||||
cmGeneratedFileStream::cmGeneratedFileStream(std::string const& name,
|
||||
bool quiet, Encoding encoding)
|
||||
: cmGeneratedFileStreamBase(name)
|
||||
, Stream(TempName.c_str())
|
||||
, Stream(this->TempName.c_str())
|
||||
{
|
||||
// Check if the file opened.
|
||||
if (!*this && !quiet) {
|
||||
@@ -37,7 +37,7 @@ cmGeneratedFileStream::cmGeneratedFileStream(std::string const& name,
|
||||
}
|
||||
#ifndef CMAKE_BOOTSTRAP
|
||||
if (encoding != codecvt::None) {
|
||||
imbue(std::locale(getloc(), new codecvt(encoding)));
|
||||
this->imbue(std::locale(this->getloc(), new codecvt(encoding)));
|
||||
}
|
||||
#else
|
||||
static_cast<void>(encoding);
|
||||
|
||||
@@ -28,7 +28,7 @@ cmGeneratorExpressionDAGChecker::cmGeneratorExpressionDAGChecker(
|
||||
, Backtrace(std::move(backtrace))
|
||||
, TransitivePropertiesOnly(false)
|
||||
{
|
||||
Initialize();
|
||||
this->Initialize();
|
||||
}
|
||||
|
||||
cmGeneratorExpressionDAGChecker::cmGeneratorExpressionDAGChecker(
|
||||
@@ -42,7 +42,7 @@ cmGeneratorExpressionDAGChecker::cmGeneratorExpressionDAGChecker(
|
||||
, Backtrace()
|
||||
, TransitivePropertiesOnly(false)
|
||||
{
|
||||
Initialize();
|
||||
this->Initialize();
|
||||
}
|
||||
|
||||
void cmGeneratorExpressionDAGChecker::Initialize()
|
||||
@@ -52,7 +52,7 @@ void cmGeneratorExpressionDAGChecker::Initialize()
|
||||
|
||||
#define TEST_TRANSITIVE_PROPERTY_METHOD(METHOD) top->METHOD() ||
|
||||
|
||||
if (CheckResult == DAG &&
|
||||
if (this->CheckResult == DAG &&
|
||||
(CM_FOR_EACH_TRANSITIVE_PROPERTY_METHOD(
|
||||
TEST_TRANSITIVE_PROPERTY_METHOD) false)) // NOLINT(*)
|
||||
#undef TEST_TRANSITIVE_PROPERTY_METHOD
|
||||
|
||||
@@ -39,7 +39,7 @@ void cmGeneratorExpressionEvaluationFile::Generate(
|
||||
std::map<std::string, std::string>& outputFiles, mode_t perm)
|
||||
{
|
||||
std::string rawCondition = this->Condition->GetInput();
|
||||
cmGeneratorTarget* target = lg->FindGeneratorTargetToUse(Target);
|
||||
cmGeneratorTarget* target = lg->FindGeneratorTargetToUse(this->Target);
|
||||
if (!rawCondition.empty()) {
|
||||
std::string condResult =
|
||||
this->Condition->Evaluate(lg, config, target, nullptr, nullptr, lang);
|
||||
@@ -95,7 +95,7 @@ void cmGeneratorExpressionEvaluationFile::CreateOutputFile(
|
||||
{
|
||||
std::vector<std::string> enabledLanguages;
|
||||
cmGlobalGenerator* gg = lg->GetGlobalGenerator();
|
||||
cmGeneratorTarget* target = lg->FindGeneratorTargetToUse(Target);
|
||||
cmGeneratorTarget* target = lg->FindGeneratorTargetToUse(this->Target);
|
||||
gg->GetEnabledLanguages(enabledLanguages);
|
||||
|
||||
for (std::string const& le : enabledLanguages) {
|
||||
|
||||
@@ -35,14 +35,14 @@ std::vector<cmGeneratorExpressionToken> cmGeneratorExpressionLexer::Tokenize(
|
||||
2);
|
||||
upto = c + 2;
|
||||
++c;
|
||||
SawBeginExpression = true;
|
||||
this->SawBeginExpression = true;
|
||||
}
|
||||
break;
|
||||
case '>':
|
||||
InsertText(upto, c, result);
|
||||
result.emplace_back(cmGeneratorExpressionToken::EndExpression, c, 1);
|
||||
upto = c + 1;
|
||||
SawGeneratorExpression = SawBeginExpression;
|
||||
this->SawGeneratorExpression = this->SawBeginExpression;
|
||||
break;
|
||||
case ':':
|
||||
InsertText(upto, c, result);
|
||||
|
||||
@@ -22,7 +22,7 @@ cmGeneratorExpressionParser::cmGeneratorExpressionParser(
|
||||
void cmGeneratorExpressionParser::Parse(
|
||||
cmGeneratorExpressionEvaluatorVector& result)
|
||||
{
|
||||
it = this->Tokens.begin();
|
||||
this->it = this->Tokens.begin();
|
||||
|
||||
while (this->it != this->Tokens.end()) {
|
||||
this->ParseContent(result);
|
||||
|
||||
@@ -557,7 +557,7 @@ std::string cmGeneratorTarget::GetFilePostfix(const std::string& config) const
|
||||
|
||||
// Frameworks created by multi config generators can have a special
|
||||
// framework postfix.
|
||||
frameworkPostfix = GetFrameworkMultiConfigPostfix(config);
|
||||
frameworkPostfix = this->GetFrameworkMultiConfigPostfix(config);
|
||||
if (!frameworkPostfix.empty()) {
|
||||
postfix = &frameworkPostfix;
|
||||
}
|
||||
@@ -576,7 +576,7 @@ std::string cmGeneratorTarget::GetFrameworkMultiConfigPostfix(
|
||||
|
||||
if (!this->IsImported() && postfix &&
|
||||
(this->IsFrameworkOnApple() &&
|
||||
!GetGlobalGenerator()->IsMultiConfig())) {
|
||||
!this->GetGlobalGenerator()->IsMultiConfig())) {
|
||||
postfix = nullptr;
|
||||
}
|
||||
}
|
||||
@@ -2503,7 +2503,7 @@ public:
|
||||
|
||||
bool GetHadLinkLanguageSensitiveCondition() const
|
||||
{
|
||||
return HadLinkLanguageSensitiveCondition;
|
||||
return this->HadLinkLanguageSensitiveCondition;
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -3278,7 +3278,7 @@ void cmGeneratorTarget::AddCUDAArchitectureFlags(std::string& flags) const
|
||||
flags += " --cuda-gpu-arch=sm_" + architecture.name;
|
||||
|
||||
if (!architecture.real) {
|
||||
Makefile->IssueMessage(
|
||||
this->Makefile->IssueMessage(
|
||||
MessageType::WARNING,
|
||||
"Clang doesn't support disabling CUDA real code generation.");
|
||||
}
|
||||
@@ -4968,7 +4968,7 @@ void cmGeneratorTarget::GetFullNameInternal(
|
||||
// the base, because the suffix ends up being used in Xcode's
|
||||
// EXECUTABLE_SUFFIX attribute.
|
||||
if (this->IsFrameworkOnApple() &&
|
||||
GetGlobalGenerator()->GetName() == "Xcode") {
|
||||
this->GetGlobalGenerator()->GetName() == "Xcode") {
|
||||
targetSuffix = &configPostfix;
|
||||
} else {
|
||||
outBase += configPostfix;
|
||||
|
||||
@@ -585,7 +585,8 @@ public:
|
||||
std::string PdbDir;
|
||||
bool empty() const
|
||||
{
|
||||
return OutDir.empty() && ImpDir.empty() && PdbDir.empty();
|
||||
return this->OutDir.empty() && this->ImpDir.empty() &&
|
||||
this->PdbDir.empty();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ void cmGhsMultiTargetGenerator::Generate()
|
||||
// Get the name of the executable to generate.
|
||||
this->TargetNameReal =
|
||||
this->GeneratorTarget->GetExecutableNames(this->ConfigName).Real;
|
||||
if (cmGhsMultiTargetGenerator::DetermineIfIntegrityApp()) {
|
||||
if (this->cmGhsMultiTargetGenerator::DetermineIfIntegrityApp()) {
|
||||
this->TagType = GhsMultiGpj::INTERGRITY_APPLICATION;
|
||||
} else {
|
||||
this->TagType = GhsMultiGpj::PROGRAM;
|
||||
@@ -631,7 +631,7 @@ void cmGhsMultiTargetGenerator::WriteSources(std::ostream& fout_proj)
|
||||
}
|
||||
} else {
|
||||
std::vector<cmSourceFile const*> customCommands;
|
||||
if (ComputeCustomCommandOrder(customCommands)) {
|
||||
if (this->ComputeCustomCommandOrder(customCommands)) {
|
||||
std::string message = "The custom commands for target [" +
|
||||
this->GeneratorTarget->GetName() + "] had a cycle.\n";
|
||||
cmSystemTools::Error(message);
|
||||
@@ -745,7 +745,7 @@ bool cmGhsMultiTargetGenerator::ComputeCustomCommandOrder(
|
||||
this->GeneratorTarget->GetCustomCommands(customCommands, this->ConfigName);
|
||||
|
||||
for (cmSourceFile const* si : customCommands) {
|
||||
bool r = VisitCustomCommand(temp, perm, order, si);
|
||||
bool r = this->VisitCustomCommand(temp, perm, order, si);
|
||||
if (r) {
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -69,17 +69,17 @@ struct GeneratedMakeCommand
|
||||
void Add(T&&... args)
|
||||
{
|
||||
// iterate the args and append each one
|
||||
AppendStrs(PrimaryCommand, std::forward<T>(args)...);
|
||||
AppendStrs(this->PrimaryCommand, std::forward<T>(args)...);
|
||||
}
|
||||
|
||||
// Add each value in the iterators as a separate element to the vector
|
||||
void Add(std::vector<std::string>::const_iterator start,
|
||||
std::vector<std::string>::const_iterator end)
|
||||
{
|
||||
cm::append(PrimaryCommand, start, end);
|
||||
cm::append(this->PrimaryCommand, start, end);
|
||||
}
|
||||
|
||||
std::string Printable() const { return cmJoin(PrimaryCommand, " "); }
|
||||
std::string Printable() const { return cmJoin(this->PrimaryCommand, " "); }
|
||||
|
||||
std::vector<std::string> PrimaryCommand;
|
||||
bool RequiresOutputForward = false;
|
||||
@@ -501,7 +501,7 @@ public:
|
||||
cmSourceFile* sf) const;
|
||||
|
||||
#if !defined(CMAKE_BOOTSTRAP)
|
||||
cmFileLockPool& GetFileLockPool() { return FileLockPool; }
|
||||
cmFileLockPool& GetFileLockPool() { return this->FileLockPool; }
|
||||
#endif
|
||||
|
||||
bool GetConfigureDoneCMP0026() const
|
||||
|
||||
@@ -366,7 +366,7 @@ void cmGlobalGhsMultiGenerator::WriteSubProjects(std::ostream& fout,
|
||||
target->GetType() == cmStateEnums::MODULE_LIBRARY ||
|
||||
target->GetType() == cmStateEnums::SHARED_LIBRARY ||
|
||||
(target->GetType() == cmStateEnums::GLOBAL_TARGET &&
|
||||
target->GetName() != GetInstallTargetName())) {
|
||||
target->GetName() != this->GetInstallTargetName())) {
|
||||
continue;
|
||||
}
|
||||
fout << "CMakeFiles/" << target->GetName() + ".tgt" + FILE_EXTENSION
|
||||
@@ -415,7 +415,7 @@ void cmGlobalGhsMultiGenerator::WriteTargets(cmLocalGenerator* root)
|
||||
target->GetType() == cmStateEnums::MODULE_LIBRARY ||
|
||||
target->GetType() == cmStateEnums::SHARED_LIBRARY ||
|
||||
(target->GetType() == cmStateEnums::GLOBAL_TARGET &&
|
||||
target->GetName() != GetInstallTargetName())) {
|
||||
target->GetName() != this->GetInstallTargetName())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -427,13 +427,13 @@ void cmGlobalGhsMultiGenerator::WriteTargets(cmLocalGenerator* root)
|
||||
this->WriteFileHeader(fbld);
|
||||
GhsMultiGpj::WriteGpjTag(GhsMultiGpj::PROJECT, fbld);
|
||||
std::vector<cmGeneratorTarget const*> build;
|
||||
if (ComputeTargetBuildOrder(target, build)) {
|
||||
if (this->ComputeTargetBuildOrder(target, build)) {
|
||||
cmSystemTools::Error(
|
||||
cmStrCat("The inter-target dependency graph for target [",
|
||||
target->GetName(), "] had a cycle.\n"));
|
||||
} else {
|
||||
for (auto& tgt : build) {
|
||||
WriteProjectLine(fbld, tgt, root, rootBinaryDir);
|
||||
this->WriteProjectLine(fbld, tgt, root, rootBinaryDir);
|
||||
}
|
||||
}
|
||||
fbld.Close();
|
||||
@@ -471,12 +471,12 @@ void cmGlobalGhsMultiGenerator::WriteAllTarget(
|
||||
if (!t->IsInBuildSystem()) {
|
||||
continue;
|
||||
}
|
||||
if (!IsExcluded(t->GetLocalGenerator(), t)) {
|
||||
if (!this->IsExcluded(t->GetLocalGenerator(), t)) {
|
||||
defaultTargets.push_back(t);
|
||||
}
|
||||
}
|
||||
std::vector<cmGeneratorTarget const*> build;
|
||||
if (ComputeTargetBuildOrder(defaultTargets, build)) {
|
||||
if (this->ComputeTargetBuildOrder(defaultTargets, build)) {
|
||||
std::string message = "The inter-target dependency graph for project [" +
|
||||
root->GetProjectName() + "] had a cycle.\n";
|
||||
cmSystemTools::Error(message);
|
||||
@@ -694,7 +694,7 @@ bool cmGlobalGhsMultiGenerator::ComputeTargetBuildOrder(
|
||||
cmGeneratorTarget const* tgt, std::vector<cmGeneratorTarget const*>& build)
|
||||
{
|
||||
std::vector<cmGeneratorTarget const*> t{ tgt };
|
||||
return ComputeTargetBuildOrder(t, build);
|
||||
return this->ComputeTargetBuildOrder(t, build);
|
||||
}
|
||||
|
||||
bool cmGlobalGhsMultiGenerator::ComputeTargetBuildOrder(
|
||||
@@ -705,7 +705,7 @@ bool cmGlobalGhsMultiGenerator::ComputeTargetBuildOrder(
|
||||
std::set<cmGeneratorTarget const*> perm;
|
||||
|
||||
for (auto const ti : tgt) {
|
||||
bool r = VisitTarget(temp, perm, build, ti);
|
||||
bool r = this->VisitTarget(temp, perm, build, ti);
|
||||
if (r) {
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ std::string cmGlobalNinjaGenerator::EncodePath(const std::string& path)
|
||||
else
|
||||
std::replace(result.begin(), result.end(), '/', '\\');
|
||||
#endif
|
||||
result = EncodeLiteral(result);
|
||||
result = this->EncodeLiteral(result);
|
||||
cmSystemTools::ReplaceString(result, " ", "$ ");
|
||||
cmSystemTools::ReplaceString(result, ":", "$:");
|
||||
return result;
|
||||
@@ -214,7 +214,7 @@ void cmGlobalNinjaGenerator::WriteBuild(std::ostream& os,
|
||||
{
|
||||
// Write explicit outputs
|
||||
for (std::string const& output : build.Outputs) {
|
||||
buildStr += cmStrCat(' ', EncodePath(output));
|
||||
buildStr += cmStrCat(' ', this->EncodePath(output));
|
||||
if (this->ComputingUnknownDependencies) {
|
||||
this->CombinedBuildOutputs.insert(output);
|
||||
}
|
||||
@@ -223,7 +223,7 @@ void cmGlobalNinjaGenerator::WriteBuild(std::ostream& os,
|
||||
if (!build.ImplicitOuts.empty()) {
|
||||
buildStr += " |";
|
||||
for (std::string const& implicitOut : build.ImplicitOuts) {
|
||||
buildStr += cmStrCat(' ', EncodePath(implicitOut));
|
||||
buildStr += cmStrCat(' ', this->EncodePath(implicitOut));
|
||||
}
|
||||
}
|
||||
buildStr += ':';
|
||||
@@ -238,14 +238,14 @@ void cmGlobalNinjaGenerator::WriteBuild(std::ostream& os,
|
||||
|
||||
// Write explicit dependencies.
|
||||
for (std::string const& explicitDep : build.ExplicitDeps) {
|
||||
arguments += cmStrCat(' ', EncodePath(explicitDep));
|
||||
arguments += cmStrCat(' ', this->EncodePath(explicitDep));
|
||||
}
|
||||
|
||||
// Write implicit dependencies.
|
||||
if (!build.ImplicitDeps.empty()) {
|
||||
arguments += " |";
|
||||
for (std::string const& implicitDep : build.ImplicitDeps) {
|
||||
arguments += cmStrCat(' ', EncodePath(implicitDep));
|
||||
arguments += cmStrCat(' ', this->EncodePath(implicitDep));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -253,7 +253,7 @@ void cmGlobalNinjaGenerator::WriteBuild(std::ostream& os,
|
||||
if (!build.OrderOnlyDeps.empty()) {
|
||||
arguments += " ||";
|
||||
for (std::string const& orderOnlyDep : build.OrderOnlyDeps) {
|
||||
arguments += cmStrCat(' ', EncodePath(orderOnlyDep));
|
||||
arguments += cmStrCat(' ', this->EncodePath(orderOnlyDep));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -331,11 +331,11 @@ void cmGlobalNinjaGenerator::WriteCustomCommandBuild(
|
||||
#endif
|
||||
vars["COMMAND"] = std::move(cmd);
|
||||
}
|
||||
vars["DESC"] = EncodeLiteral(description);
|
||||
vars["DESC"] = this->EncodeLiteral(description);
|
||||
if (restat) {
|
||||
vars["restat"] = "1";
|
||||
}
|
||||
if (uses_terminal && SupportsConsolePool()) {
|
||||
if (uses_terminal && this->SupportsConsolePool()) {
|
||||
vars["pool"] = "console";
|
||||
} else if (!job_pool.empty()) {
|
||||
vars["pool"] = job_pool;
|
||||
@@ -362,7 +362,7 @@ void cmGlobalNinjaGenerator::WriteCustomCommandBuild(
|
||||
void cmGlobalNinjaGenerator::AddMacOSXContentRule()
|
||||
{
|
||||
cmNinjaRule rule("COPY_OSX_CONTENT");
|
||||
rule.Command = cmStrCat(CMakeCmd(), " -E copy $in $out");
|
||||
rule.Command = cmStrCat(this->CMakeCmd(), " -E copy $in $out");
|
||||
rule.Description = "Copying OS X Content $out";
|
||||
rule.Comment = "Rule for copying OS X bundle content file.";
|
||||
this->AddRule(rule);
|
||||
@@ -1032,8 +1032,8 @@ static void EnsureTrailingSlash(std::string& path)
|
||||
std::string const& cmGlobalNinjaGenerator::ConvertToNinjaPath(
|
||||
const std::string& path) const
|
||||
{
|
||||
auto const f = ConvertToNinjaPathCache.find(path);
|
||||
if (f != ConvertToNinjaPathCache.end()) {
|
||||
auto const f = this->ConvertToNinjaPathCache.find(path);
|
||||
if (f != this->ConvertToNinjaPathCache.end()) {
|
||||
return f->second;
|
||||
}
|
||||
|
||||
@@ -1045,7 +1045,7 @@ std::string const& cmGlobalNinjaGenerator::ConvertToNinjaPath(
|
||||
#ifdef _WIN32
|
||||
std::replace(convPath.begin(), convPath.end(), '/', '\\');
|
||||
#endif
|
||||
return ConvertToNinjaPathCache.emplace(path, std::move(convPath))
|
||||
return this->ConvertToNinjaPathCache.emplace(path, std::move(convPath))
|
||||
.first->second;
|
||||
}
|
||||
|
||||
@@ -1117,12 +1117,13 @@ void cmGlobalNinjaGenerator::WriteAssumedSourceDependencies()
|
||||
cmNinjaDeps orderOnlyDeps;
|
||||
std::copy(asd.second.begin(), asd.second.end(),
|
||||
std::back_inserter(orderOnlyDeps));
|
||||
WriteCustomCommandBuild(/*command=*/"", /*description=*/"",
|
||||
"Assume dependencies for generated source file.",
|
||||
/*depfile*/ "", /*job_pool*/ "",
|
||||
/*uses_terminal*/ false,
|
||||
/*restat*/ true, cmNinjaDeps(1, asd.first), "",
|
||||
cmNinjaDeps(), orderOnlyDeps);
|
||||
this->WriteCustomCommandBuild(
|
||||
/*command=*/"", /*description=*/"",
|
||||
"Assume dependencies for generated source file.",
|
||||
/*depfile*/ "", /*job_pool*/ "",
|
||||
/*uses_terminal*/ false,
|
||||
/*restat*/ true, cmNinjaDeps(1, asd.first), "", cmNinjaDeps(),
|
||||
orderOnlyDeps);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1147,7 +1148,7 @@ void cmGlobalNinjaGenerator::AppendTargetOutputs(
|
||||
case cmStateEnums::STATIC_LIBRARY:
|
||||
case cmStateEnums::MODULE_LIBRARY: {
|
||||
if (depends == DependOnTargetOrdering) {
|
||||
outputs.push_back(OrderDependsTargetForTarget(target, config));
|
||||
outputs.push_back(this->OrderDependsTargetForTarget(target, config));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1159,7 +1160,7 @@ void cmGlobalNinjaGenerator::AppendTargetOutputs(
|
||||
}
|
||||
case cmStateEnums::OBJECT_LIBRARY: {
|
||||
if (depends == DependOnTargetOrdering) {
|
||||
outputs.push_back(OrderDependsTargetForTarget(target, config));
|
||||
outputs.push_back(this->OrderDependsTargetForTarget(target, config));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1476,7 +1477,7 @@ void cmGlobalNinjaGenerator::WriteFolderTargets(std::ostream& os)
|
||||
build.Outputs.front() = this->BuildAlias(buildDirAllTarget, config);
|
||||
configDeps.emplace_back(build.Outputs.front());
|
||||
for (DirectoryTarget::Target const& t : dt.Targets) {
|
||||
if (!IsExcludedFromAllInConfig(t, config)) {
|
||||
if (!this->IsExcludedFromAllInConfig(t, config)) {
|
||||
this->AppendTargetOutputs(t.GT, build.ExplicitDeps, config,
|
||||
DependOnTargetArtifact);
|
||||
}
|
||||
@@ -1689,7 +1690,7 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os)
|
||||
{
|
||||
cmNinjaRule rule("RERUN_CMAKE");
|
||||
rule.Command =
|
||||
cmStrCat(CMakeCmd(), " --regenerate-during-build -S",
|
||||
cmStrCat(this->CMakeCmd(), " --regenerate-during-build -S",
|
||||
lg->ConvertToOutputFormat(lg->GetSourceDirectory(),
|
||||
cmOutputConverter::SHELL),
|
||||
" -B",
|
||||
@@ -1714,7 +1715,7 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os)
|
||||
|
||||
// Use 'console' pool to get non buffered output of the CMake re-run call
|
||||
// Available since Ninja 1.5
|
||||
if (SupportsConsolePool()) {
|
||||
if (this->SupportsConsolePool()) {
|
||||
reBuild.Variables["pool"] = "console";
|
||||
}
|
||||
|
||||
@@ -1723,7 +1724,7 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os)
|
||||
{
|
||||
cmNinjaRule rule("VERIFY_GLOBS");
|
||||
rule.Command =
|
||||
cmStrCat(CMakeCmd(), " -P ",
|
||||
cmStrCat(this->CMakeCmd(), " -P ",
|
||||
lg->ConvertToOutputFormat(cm->GetGlobVerifyScript(),
|
||||
cmOutputConverter::SHELL));
|
||||
rule.Description = "Re-checking globbed directories...";
|
||||
@@ -1784,8 +1785,8 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os)
|
||||
build.Comment = "A missing CMake input file is not an error.";
|
||||
std::set_difference(std::make_move_iterator(reBuild.ImplicitDeps.begin()),
|
||||
std::make_move_iterator(reBuild.ImplicitDeps.end()),
|
||||
CustomCommandOutputs.begin(),
|
||||
CustomCommandOutputs.end(),
|
||||
this->CustomCommandOutputs.begin(),
|
||||
this->CustomCommandOutputs.end(),
|
||||
std::back_inserter(build.Outputs));
|
||||
this->WriteBuild(os, build);
|
||||
}
|
||||
@@ -1869,7 +1870,8 @@ bool cmGlobalNinjaGenerator::WriteTargetCleanAdditional(std::ostream& os)
|
||||
fout << " file(REMOVE_RECURSE\n";
|
||||
for (std::string const& acf : it->second.AdditionalCleanFiles) {
|
||||
fout << " "
|
||||
<< cmOutputConverter::EscapeForCMake(ConvertToNinjaPath(acf))
|
||||
<< cmOutputConverter::EscapeForCMake(
|
||||
this->ConvertToNinjaPath(acf))
|
||||
<< '\n';
|
||||
}
|
||||
fout << " )\n";
|
||||
@@ -1884,7 +1886,7 @@ bool cmGlobalNinjaGenerator::WriteTargetCleanAdditional(std::ostream& os)
|
||||
{
|
||||
cmNinjaRule rule("CLEAN_ADDITIONAL");
|
||||
rule.Command = cmStrCat(
|
||||
CMakeCmd(), " -DCONFIG=$CONFIG -P ",
|
||||
this->CMakeCmd(), " -DCONFIG=$CONFIG -P ",
|
||||
lgr->ConvertToOutputFormat(this->NinjaOutputPath(cleanScriptRel),
|
||||
cmOutputConverter::SHELL));
|
||||
rule.Description = "Cleaning additional files...";
|
||||
@@ -1901,13 +1903,13 @@ bool cmGlobalNinjaGenerator::WriteTargetCleanAdditional(std::ostream& os)
|
||||
build.Outputs.front() = this->BuildAlias(
|
||||
this->NinjaOutputPath(this->GetAdditionalCleanTargetName()), config);
|
||||
build.Variables["CONFIG"] = config;
|
||||
WriteBuild(os, build);
|
||||
this->WriteBuild(os, build);
|
||||
}
|
||||
if (this->IsMultiConfig()) {
|
||||
build.Outputs.front() =
|
||||
this->NinjaOutputPath(this->GetAdditionalCleanTargetName());
|
||||
build.Variables["CONFIG"] = "";
|
||||
WriteBuild(os, build);
|
||||
this->WriteBuild(os, build);
|
||||
}
|
||||
}
|
||||
// Return success
|
||||
@@ -1917,13 +1919,13 @@ bool cmGlobalNinjaGenerator::WriteTargetCleanAdditional(std::ostream& os)
|
||||
void cmGlobalNinjaGenerator::WriteTargetClean(std::ostream& os)
|
||||
{
|
||||
// -- Additional clean target
|
||||
bool additionalFiles = WriteTargetCleanAdditional(os);
|
||||
bool additionalFiles = this->WriteTargetCleanAdditional(os);
|
||||
|
||||
// -- Default clean target
|
||||
// Write rule
|
||||
{
|
||||
cmNinjaRule rule("CLEAN");
|
||||
rule.Command = cmStrCat(NinjaCmd(), " $FILE_ARG -t clean $TARGETS");
|
||||
rule.Command = cmStrCat(this->NinjaCmd(), " $FILE_ARG -t clean $TARGETS");
|
||||
rule.Description = "Cleaning all built files...";
|
||||
rule.Comment = "Rule for cleaning all built files.";
|
||||
WriteRule(*this->RulesFileStream, rule);
|
||||
@@ -2024,13 +2026,13 @@ void cmGlobalNinjaGenerator::WriteTargetClean(std::ostream& os)
|
||||
build.Outputs.emplace_back(
|
||||
this->ConvertToNinjaPath(GetByproductsForCleanTargetName()));
|
||||
build.ExplicitDeps = this->ByproductsForCleanTarget;
|
||||
WriteBuild(os, build);
|
||||
this->WriteBuild(os, build);
|
||||
|
||||
for (auto const& config : configs) {
|
||||
build.Outputs.front() = this->BuildAlias(
|
||||
this->ConvertToNinjaPath(GetByproductsForCleanTargetName()), config);
|
||||
build.ExplicitDeps = this->Configs[config].ByproductsForCleanTarget;
|
||||
WriteBuild(os, build);
|
||||
this->WriteBuild(os, build);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2039,7 +2041,7 @@ void cmGlobalNinjaGenerator::WriteTargetHelp(std::ostream& os)
|
||||
{
|
||||
{
|
||||
cmNinjaRule rule("HELP");
|
||||
rule.Command = cmStrCat(NinjaCmd(), " -t targets");
|
||||
rule.Command = cmStrCat(this->NinjaCmd(), " -t targets");
|
||||
rule.Description = "All primary targets available:";
|
||||
rule.Comment = "Rule for printing all primary targets available.";
|
||||
WriteRule(*this->RulesFileStream, rule);
|
||||
@@ -2048,7 +2050,7 @@ void cmGlobalNinjaGenerator::WriteTargetHelp(std::ostream& os)
|
||||
cmNinjaBuild build("HELP");
|
||||
build.Comment = "Print all primary targets available.";
|
||||
build.Outputs.push_back(this->NinjaOutputPath("help"));
|
||||
WriteBuild(os, build);
|
||||
this->WriteBuild(os, build);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -150,7 +150,7 @@ public:
|
||||
static void WriteDefault(std::ostream& os, const cmNinjaDeps& targets,
|
||||
const std::string& comment = "");
|
||||
|
||||
bool IsGCCOnWindows() const { return UsingGCCOnWindows; }
|
||||
bool IsGCCOnWindows() const { return this->UsingGCCOnWindows; }
|
||||
|
||||
public:
|
||||
cmGlobalNinjaGenerator(cmake* cm);
|
||||
@@ -354,7 +354,10 @@ public:
|
||||
outputs.push_back(this->NinjaOutputPath(NINJA_BUILD_FILE));
|
||||
}
|
||||
|
||||
int GetRuleCmdLength(const std::string& name) { return RuleCmdLength[name]; }
|
||||
int GetRuleCmdLength(const std::string& name)
|
||||
{
|
||||
return this->RuleCmdLength[name];
|
||||
}
|
||||
|
||||
void AddTargetAlias(const std::string& alias, cmGeneratorTarget* target,
|
||||
const std::string& config);
|
||||
|
||||
@@ -838,7 +838,7 @@ void cmGlobalUnixMakefileGenerator3::InitializeProgressMarks()
|
||||
for (const auto& gt : lg->GetGeneratorTargets()) {
|
||||
cmLocalGenerator* tlg = gt->GetLocalGenerator();
|
||||
|
||||
if (!gt->IsInBuildSystem() || IsExcluded(lg.get(), gt.get())) {
|
||||
if (!gt->IsInBuildSystem() || this->IsExcluded(lg.get(), gt.get())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
+18
-14
@@ -131,8 +131,8 @@ cmGraphVizWriter::~cmGraphVizWriter()
|
||||
|
||||
void cmGraphVizWriter::VisitGraph(std::string const&)
|
||||
{
|
||||
this->WriteHeader(GlobalFileStream, this->GraphName);
|
||||
this->WriteLegend(GlobalFileStream);
|
||||
this->WriteHeader(this->GlobalFileStream, this->GraphName);
|
||||
this->WriteLegend(this->GlobalFileStream);
|
||||
}
|
||||
|
||||
void cmGraphVizWriter::OnItem(cmLinkItem const& item)
|
||||
@@ -141,8 +141,9 @@ void cmGraphVizWriter::OnItem(cmLinkItem const& item)
|
||||
return;
|
||||
}
|
||||
|
||||
NodeNames[item.AsStr()] = cmStrCat(GraphNodePrefix, NextNodeId);
|
||||
++NextNodeId;
|
||||
this->NodeNames[item.AsStr()] =
|
||||
cmStrCat(this->GraphNodePrefix, this->NextNodeId);
|
||||
++this->NextNodeId;
|
||||
|
||||
this->WriteNode(this->GlobalFileStream, item);
|
||||
}
|
||||
@@ -191,12 +192,13 @@ void cmGraphVizWriter::VisitLink(cmLinkItem const& depender,
|
||||
this->WriteConnection(this->GlobalFileStream, depender, dependee, scopeType);
|
||||
|
||||
if (this->GeneratePerTarget) {
|
||||
PerTargetConnections[depender].emplace_back(depender, dependee, scopeType);
|
||||
this->PerTargetConnections[depender].emplace_back(depender, dependee,
|
||||
scopeType);
|
||||
}
|
||||
|
||||
if (this->GenerateDependers) {
|
||||
TargetDependersConnections[dependee].emplace_back(dependee, depender,
|
||||
scopeType);
|
||||
this->TargetDependersConnections[dependee].emplace_back(dependee, depender,
|
||||
scopeType);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -307,12 +309,12 @@ void cmGraphVizWriter::Write()
|
||||
}
|
||||
|
||||
if (this->GeneratePerTarget) {
|
||||
WritePerTargetConnections<DependeesDir>(PerTargetConnections);
|
||||
this->WritePerTargetConnections<DependeesDir>(this->PerTargetConnections);
|
||||
}
|
||||
|
||||
if (this->GenerateDependers) {
|
||||
WritePerTargetConnections<DependersDir>(TargetDependersConnections,
|
||||
".dependers");
|
||||
this->WritePerTargetConnections<DependersDir>(
|
||||
this->TargetDependersConnections, ".dependers");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -336,7 +338,8 @@ void cmGraphVizWriter::FindAllConnections(const ConnectionsMap& connectionMap,
|
||||
bool const visited = visitedItems.find(dstItem) != visitedItems.cend();
|
||||
if (!visited) {
|
||||
visitedItems.insert(dstItem);
|
||||
FindAllConnections(connectionMap, dstItem, extendedCons, visitedItems);
|
||||
this->FindAllConnections(connectionMap, dstItem, extendedCons,
|
||||
visitedItems);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -346,7 +349,8 @@ void cmGraphVizWriter::FindAllConnections(const ConnectionsMap& connectionMap,
|
||||
Connections& extendedCons)
|
||||
{
|
||||
std::set<cmLinkItem> visitedItems = { rootItem };
|
||||
FindAllConnections(connectionMap, rootItem, extendedCons, visitedItems);
|
||||
this->FindAllConnections(connectionMap, rootItem, extendedCons,
|
||||
visitedItems);
|
||||
}
|
||||
|
||||
template <typename DirFunc>
|
||||
@@ -358,7 +362,7 @@ void cmGraphVizWriter::WritePerTargetConnections(
|
||||
for (auto const& conPerTarget : connections) {
|
||||
const cmLinkItem& rootItem = conPerTarget.first;
|
||||
Connections& extendedCons = extendedConnections[conPerTarget.first];
|
||||
FindAllConnections(connections, rootItem, extendedCons);
|
||||
this->FindAllConnections(connections, rootItem, extendedCons);
|
||||
}
|
||||
|
||||
for (auto const& conPerTarget : extendedConnections) {
|
||||
@@ -451,7 +455,7 @@ void cmGraphVizWriter::WriteNode(cmGeneratedFileStream& fs,
|
||||
auto const& itemName = item.AsStr();
|
||||
auto const& nodeName = this->NodeNames[itemName];
|
||||
|
||||
auto const itemNameWithAliases = ItemNameWithAliases(itemName);
|
||||
auto const itemNameWithAliases = this->ItemNameWithAliases(itemName);
|
||||
auto const escapedLabel = EscapeForDotFile(itemNameWithAliases);
|
||||
|
||||
fs << " \"" << nodeName << "\" [ label = \"" << escapedLabel
|
||||
|
||||
@@ -27,7 +27,7 @@ cmInstallDirectoryGenerator::cmInstallDirectoryGenerator(
|
||||
, Optional(optional)
|
||||
{
|
||||
// We need per-config actions if destination have generator expressions.
|
||||
if (cmGeneratorExpression::Find(Destination) != std::string::npos) {
|
||||
if (cmGeneratorExpression::Find(this->Destination) != std::string::npos) {
|
||||
this->ActionsPerConfig = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -122,10 +122,10 @@ size_t cmInstallExportGenerator::GetMaxConfigLength() const
|
||||
void cmInstallExportGenerator::GenerateScript(std::ostream& os)
|
||||
{
|
||||
// Skip empty sets.
|
||||
if (ExportSet->GetTargetExports().empty()) {
|
||||
if (this->ExportSet->GetTargetExports().empty()) {
|
||||
std::ostringstream e;
|
||||
e << "INSTALL(EXPORT) given unknown export \"" << ExportSet->GetName()
|
||||
<< "\"";
|
||||
e << "INSTALL(EXPORT) given unknown export \""
|
||||
<< this->ExportSet->GetName() << "\"";
|
||||
cmSystemTools::Error(e.str());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ cmInstallFilesGenerator::cmInstallFilesGenerator(
|
||||
, Optional(optional)
|
||||
{
|
||||
// We need per-config actions if the destination has generator expressions.
|
||||
if (cmGeneratorExpression::Find(Destination) != std::string::npos) {
|
||||
if (cmGeneratorExpression::Find(this->Destination) != std::string::npos) {
|
||||
this->ActionsPerConfig = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ cmInstallScriptGenerator::cmInstallScriptGenerator(
|
||||
, AllowGenex(false)
|
||||
{
|
||||
// We need per-config actions if the script has generator expressions.
|
||||
if (cmGeneratorExpression::Find(Script) != std::string::npos) {
|
||||
if (cmGeneratorExpression::Find(this->Script) != std::string::npos) {
|
||||
this->ActionsPerConfig = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,9 +133,9 @@ public:
|
||||
return iterator(const_cast<cmLinkedTree*>(this), 0);
|
||||
}
|
||||
|
||||
iterator Push(iterator it) { return Push_impl(it, T()); }
|
||||
iterator Push(iterator it) { return this->Push_impl(it, T()); }
|
||||
|
||||
iterator Push(iterator it, T t) { return Push_impl(it, std::move(t)); }
|
||||
iterator Push(iterator it, T t) { return this->Push_impl(it, std::move(t)); }
|
||||
|
||||
bool IsLast(iterator it) { return it.Position == this->Data.size(); }
|
||||
|
||||
|
||||
+13
-12
@@ -609,9 +609,9 @@ public:
|
||||
|
||||
bool Validate(std::size_t count) override
|
||||
{
|
||||
decltype(Indexes) indexes;
|
||||
decltype(this->Indexes) indexes;
|
||||
|
||||
for (auto index : Indexes) {
|
||||
for (auto index : this->Indexes) {
|
||||
indexes.push_back(this->NormalizeIndex(index, count));
|
||||
}
|
||||
this->Indexes = std::move(indexes);
|
||||
@@ -750,7 +750,7 @@ bool HandleTransformCommand(std::vector<std::string> const& args,
|
||||
{
|
||||
}
|
||||
|
||||
operator const std::string&() const { return Name; }
|
||||
operator const std::string&() const { return this->Name; }
|
||||
|
||||
std::string Name;
|
||||
int Arity = 0;
|
||||
@@ -1093,8 +1093,9 @@ protected:
|
||||
public:
|
||||
cmStringSorter(Compare compare, CaseSensitivity caseSensitivity,
|
||||
Order desc = Order::ASCENDING)
|
||||
: filters{ GetCompareFilter(compare), GetCaseFilter(caseSensitivity) }
|
||||
, sortMethod(GetComparisonFunction(compare))
|
||||
: filters{ this->GetCompareFilter(compare),
|
||||
this->GetCaseFilter(caseSensitivity) }
|
||||
, sortMethod(this->GetComparisonFunction(compare))
|
||||
, descending(desc == Order::DESCENDING)
|
||||
{
|
||||
}
|
||||
@@ -1102,7 +1103,7 @@ public:
|
||||
std::string ApplyFilter(const std::string& argument)
|
||||
{
|
||||
std::string result = argument;
|
||||
for (auto filter : filters) {
|
||||
for (auto filter : this->filters) {
|
||||
if (filter != nullptr) {
|
||||
result = filter(result);
|
||||
}
|
||||
@@ -1112,13 +1113,13 @@ public:
|
||||
|
||||
bool operator()(const std::string& a, const std::string& b)
|
||||
{
|
||||
std::string af = ApplyFilter(a);
|
||||
std::string bf = ApplyFilter(b);
|
||||
std::string af = this->ApplyFilter(a);
|
||||
std::string bf = this->ApplyFilter(b);
|
||||
bool result;
|
||||
if (descending) {
|
||||
result = sortMethod(bf, af);
|
||||
if (this->descending) {
|
||||
result = this->sortMethod(bf, af);
|
||||
} else {
|
||||
result = sortMethod(af, bf);
|
||||
result = this->sortMethod(af, bf);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -1424,7 +1425,7 @@ public:
|
||||
|
||||
bool operator()(const std::string& target)
|
||||
{
|
||||
return regex.find(target) ^ includeMatches;
|
||||
return this->regex.find(target) ^ this->includeMatches;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -105,7 +105,7 @@ bool cmListFileParser::ParseFile(const char* filename)
|
||||
return false;
|
||||
}
|
||||
|
||||
return Parse();
|
||||
return this->Parse();
|
||||
}
|
||||
|
||||
bool cmListFileParser::ParseString(const char* str,
|
||||
@@ -118,7 +118,7 @@ bool cmListFileParser::ParseString(const char* str,
|
||||
return false;
|
||||
}
|
||||
|
||||
return Parse();
|
||||
return this->Parse();
|
||||
}
|
||||
|
||||
bool cmListFileParser::Parse()
|
||||
|
||||
@@ -249,7 +249,7 @@ public:
|
||||
BTs(T v = T(), cmListFileBacktrace bt = cmListFileBacktrace())
|
||||
: Value(std::move(v))
|
||||
{
|
||||
Backtraces.emplace_back(std::move(bt));
|
||||
this->Backtraces.emplace_back(std::move(bt));
|
||||
}
|
||||
T Value;
|
||||
std::vector<cmListFileBacktrace> Backtraces;
|
||||
|
||||
@@ -2607,11 +2607,11 @@ void cmLocalGenerator::AddPchDependencies(cmGeneratorTarget* target)
|
||||
}
|
||||
|
||||
if (editAndContinueDebugInfo || msvc2008OrLess) {
|
||||
CopyPchCompilePdb(config, target, *ReuseFrom, reuseTarget,
|
||||
{ ".pdb", ".idb" });
|
||||
this->CopyPchCompilePdb(config, target, *ReuseFrom,
|
||||
reuseTarget, { ".pdb", ".idb" });
|
||||
} else if (enableDebuggingInformation) {
|
||||
CopyPchCompilePdb(config, target, *ReuseFrom, reuseTarget,
|
||||
{ ".pdb" });
|
||||
this->CopyPchCompilePdb(config, target, *ReuseFrom,
|
||||
reuseTarget, { ".pdb" });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -96,8 +96,8 @@ public:
|
||||
|
||||
// If it's an absolute path, check if it starts with the source
|
||||
// directory:
|
||||
return !(cmCMakePath(SourceDir).IsPrefix(path) ||
|
||||
cmCMakePath(BinaryDir).IsPrefix(path));
|
||||
return !(cmCMakePath(this->SourceDir).IsPrefix(path) ||
|
||||
cmCMakePath(this->BinaryDir).IsPrefix(path));
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -36,5 +36,5 @@ std::string cmMSVC60LinkLineComputer::ConvertToLinkReference(
|
||||
}
|
||||
#endif
|
||||
|
||||
return cmLinkLineComputer::ConvertToLinkReference(lib);
|
||||
return this->cmLinkLineComputer::ConvertToLinkReference(lib);
|
||||
}
|
||||
|
||||
+14
-14
@@ -978,7 +978,7 @@ struct BacktraceGuard
|
||||
this->Backtrace = std::move(current);
|
||||
}
|
||||
|
||||
~BacktraceGuard() { this->Backtrace = std::move(Previous); }
|
||||
~BacktraceGuard() { this->Backtrace = std::move(this->Previous); }
|
||||
|
||||
private:
|
||||
cmListFileBacktrace& Backtrace;
|
||||
@@ -2438,7 +2438,7 @@ cmMakefile::AppleSDK cmMakefile::GetAppleSDKType() const
|
||||
|
||||
bool cmMakefile::PlatformIsAppleEmbedded() const
|
||||
{
|
||||
return GetAppleSDKType() != AppleSDK::MacOS;
|
||||
return this->GetAppleSDKType() != AppleSDK::MacOS;
|
||||
}
|
||||
|
||||
const char* cmMakefile::GetSONameFlag(const std::string& language) const
|
||||
@@ -2449,7 +2449,7 @@ const char* cmMakefile::GetSONameFlag(const std::string& language) const
|
||||
name += language;
|
||||
}
|
||||
name += "_FLAG";
|
||||
return cmToCStr(GetDefinition(name));
|
||||
return cmToCStr(this->GetDefinition(name));
|
||||
}
|
||||
|
||||
bool cmMakefile::CanIWriteThisFile(std::string const& fileName) const
|
||||
@@ -2472,7 +2472,7 @@ const std::string& cmMakefile::GetRequiredDefinition(
|
||||
const std::string& name) const
|
||||
{
|
||||
static std::string const empty;
|
||||
const std::string* def = GetDefinition(name);
|
||||
const std::string* def = this->GetDefinition(name);
|
||||
if (!def) {
|
||||
cmSystemTools::Error("Error required internal CMake variable not "
|
||||
"set, cmake may not be built correctly.\n"
|
||||
@@ -2532,7 +2532,7 @@ cmProp cmMakefile::GetDefinition(const std::string& name) const
|
||||
const std::string& cmMakefile::GetSafeDefinition(const std::string& name) const
|
||||
{
|
||||
static std::string const empty;
|
||||
const std::string* def = GetDefinition(name);
|
||||
const std::string* def = this->GetDefinition(name);
|
||||
if (!def) {
|
||||
return empty;
|
||||
}
|
||||
@@ -2598,24 +2598,24 @@ const std::string& cmMakefile::ExpandVariablesInString(
|
||||
// Suppress variable watches to avoid calling hooks twice. Suppress new
|
||||
// dereferences since the OLD behavior is still what is actually used.
|
||||
this->SuppressSideEffects = true;
|
||||
newError = ExpandVariablesInStringNew(newErrorstr, newResult,
|
||||
escapeQuotes, noEscapes, atOnly,
|
||||
filename, line, replaceAt);
|
||||
newError = this->ExpandVariablesInStringNew(
|
||||
newErrorstr, newResult, escapeQuotes, noEscapes, atOnly, filename,
|
||||
line, replaceAt);
|
||||
this->SuppressSideEffects = false;
|
||||
CM_FALLTHROUGH;
|
||||
}
|
||||
case cmPolicies::OLD:
|
||||
mtype =
|
||||
ExpandVariablesInStringOld(errorstr, source, escapeQuotes, noEscapes,
|
||||
atOnly, filename, line, removeEmpty, true);
|
||||
mtype = this->ExpandVariablesInStringOld(errorstr, source, escapeQuotes,
|
||||
noEscapes, atOnly, filename,
|
||||
line, removeEmpty, true);
|
||||
break;
|
||||
case cmPolicies::REQUIRED_IF_USED:
|
||||
case cmPolicies::REQUIRED_ALWAYS:
|
||||
// Messaging here would be *very* verbose.
|
||||
case cmPolicies::NEW:
|
||||
mtype =
|
||||
ExpandVariablesInStringNew(errorstr, source, escapeQuotes, noEscapes,
|
||||
atOnly, filename, line, replaceAt);
|
||||
mtype = this->ExpandVariablesInStringNew(errorstr, source, escapeQuotes,
|
||||
noEscapes, atOnly, filename,
|
||||
line, replaceAt);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -292,7 +292,7 @@ public:
|
||||
const char* doc, cmStateEnums::CacheEntryType type,
|
||||
bool force = false)
|
||||
{
|
||||
AddCacheDefinition(name, value.c_str(), doc, type, force);
|
||||
this->AddCacheDefinition(name, value.c_str(), doc, type, force);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -71,7 +71,8 @@ cmMakefileTargetGenerator::cmMakefileTargetGenerator(cmGeneratorTarget* target)
|
||||
this->CMP0113New = true;
|
||||
break;
|
||||
}
|
||||
MacOSXContentGenerator = cm::make_unique<MacOSXContentGeneratorType>(this);
|
||||
this->MacOSXContentGenerator =
|
||||
cm::make_unique<MacOSXContentGeneratorType>(this);
|
||||
}
|
||||
|
||||
cmMakefileTargetGenerator::~cmMakefileTargetGenerator() = default;
|
||||
|
||||
@@ -8,13 +8,13 @@ cmNewLineStyle::cmNewLineStyle() = default;
|
||||
|
||||
bool cmNewLineStyle::IsValid() const
|
||||
{
|
||||
return NewLineStyle != Invalid;
|
||||
return this->NewLineStyle != Invalid;
|
||||
}
|
||||
|
||||
bool cmNewLineStyle::ReadFromArguments(const std::vector<std::string>& args,
|
||||
std::string& errorString)
|
||||
{
|
||||
NewLineStyle = Invalid;
|
||||
this->NewLineStyle = Invalid;
|
||||
|
||||
for (size_t i = 0; i < args.size(); i++) {
|
||||
if (args[i] == "NEWLINE_STYLE") {
|
||||
@@ -22,11 +22,11 @@ bool cmNewLineStyle::ReadFromArguments(const std::vector<std::string>& args,
|
||||
if (args.size() > styleIndex) {
|
||||
std::string const& eol = args[styleIndex];
|
||||
if (eol == "LF" || eol == "UNIX") {
|
||||
NewLineStyle = LF;
|
||||
this->NewLineStyle = LF;
|
||||
return true;
|
||||
}
|
||||
if (eol == "CRLF" || eol == "WIN32" || eol == "DOS") {
|
||||
NewLineStyle = CRLF;
|
||||
this->NewLineStyle = CRLF;
|
||||
return true;
|
||||
}
|
||||
errorString = "NEWLINE_STYLE sets an unknown style, only LF, "
|
||||
@@ -43,7 +43,7 @@ bool cmNewLineStyle::ReadFromArguments(const std::vector<std::string>& args,
|
||||
|
||||
std::string cmNewLineStyle::GetCharacters() const
|
||||
{
|
||||
switch (NewLineStyle) {
|
||||
switch (this->NewLineStyle) {
|
||||
case Invalid:
|
||||
return "";
|
||||
case LF:
|
||||
@@ -56,10 +56,10 @@ std::string cmNewLineStyle::GetCharacters() const
|
||||
|
||||
void cmNewLineStyle::SetStyle(Style style)
|
||||
{
|
||||
NewLineStyle = style;
|
||||
this->NewLineStyle = style;
|
||||
}
|
||||
|
||||
cmNewLineStyle::Style cmNewLineStyle::GetStyle() const
|
||||
{
|
||||
return NewLineStyle;
|
||||
return this->NewLineStyle;
|
||||
}
|
||||
|
||||
@@ -18,5 +18,5 @@ cmNinjaLinkLineComputer::cmNinjaLinkLineComputer(
|
||||
std::string cmNinjaLinkLineComputer::ConvertToLinkReference(
|
||||
std::string const& lib) const
|
||||
{
|
||||
return GG->ConvertToNinjaPath(lib);
|
||||
return this->GG->ConvertToNinjaPath(lib);
|
||||
}
|
||||
|
||||
@@ -16,5 +16,5 @@ cmNinjaLinkLineDeviceComputer::cmNinjaLinkLineDeviceComputer(
|
||||
std::string cmNinjaLinkLineDeviceComputer::ConvertToLinkReference(
|
||||
std::string const& lib) const
|
||||
{
|
||||
return GG->ConvertToNinjaPath(lib);
|
||||
return this->GG->ConvertToNinjaPath(lib);
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ cmNinjaNormalTargetGenerator::cmNinjaNormalTargetGenerator(
|
||||
// on Windows the output dir is already needed at compile time
|
||||
// ensure the directory exists (OutDir test)
|
||||
for (auto const& config : this->GetConfigNames()) {
|
||||
EnsureDirectoryExists(target->GetDirectory(config));
|
||||
this->EnsureDirectoryExists(target->GetDirectory(config));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -306,7 +306,7 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkRules(
|
||||
{
|
||||
const cmMakefile* mf = this->GetMakefile();
|
||||
|
||||
cmNinjaRule rule(LanguageLinkerCudaDeviceRule(config));
|
||||
cmNinjaRule rule(this->LanguageLinkerCudaDeviceRule(config));
|
||||
rule.Command = this->GetLocalGenerator()->BuildCommandLine(
|
||||
{ cmStrCat(mf->GetRequiredDefinition("CMAKE_CUDA_DEVICE_LINKER"),
|
||||
" -arch=$ARCH $REGISTER -o=$out $in") });
|
||||
@@ -334,13 +334,13 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkRules(
|
||||
rulePlaceholderExpander->ExpandRuleVariables(this->GetLocalGenerator(),
|
||||
compileCmd, vars);
|
||||
|
||||
rule.Name = LanguageLinkerCudaDeviceCompileRule(config);
|
||||
rule.Name = this->LanguageLinkerCudaDeviceCompileRule(config);
|
||||
rule.Command = this->GetLocalGenerator()->BuildCommandLine({ compileCmd });
|
||||
rule.Comment = "Rule for compiling CUDA device stubs.";
|
||||
rule.Description = "Compiling CUDA device stub $out";
|
||||
this->GetGlobalGenerator()->AddRule(rule);
|
||||
|
||||
rule.Name = LanguageLinkerCudaFatbinaryRule(config);
|
||||
rule.Name = this->LanguageLinkerCudaFatbinaryRule(config);
|
||||
rule.Command = this->GetLocalGenerator()->BuildCommandLine(
|
||||
{ cmStrCat(mf->GetRequiredDefinition("CMAKE_CUDA_FATBINARY"),
|
||||
" -64 -cmdline=--compile-only -compress-all -link "
|
||||
@@ -385,7 +385,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile,
|
||||
|
||||
// build response file name
|
||||
std::string cmakeLinkVar = cmakeVarLang + "_RESPONSE_FILE_LINK_FLAG";
|
||||
cmProp flag = GetMakefile()->GetDefinition(cmakeLinkVar);
|
||||
cmProp flag = this->GetMakefile()->GetDefinition(cmakeLinkVar);
|
||||
|
||||
if (flag) {
|
||||
responseFlag = *flag;
|
||||
@@ -673,7 +673,7 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement(
|
||||
targetOutputDir = globalGen->ExpandCFGIntDir(targetOutputDir, config);
|
||||
|
||||
std::string targetOutputReal =
|
||||
ConvertToNinjaPath(targetOutputDir + "cmake_device_link" + objExt);
|
||||
this->ConvertToNinjaPath(targetOutputDir + "cmake_device_link" + objExt);
|
||||
|
||||
if (firstForConfig) {
|
||||
globalGen->GetByproductsForCleanTarget(config).push_back(targetOutputReal);
|
||||
@@ -730,7 +730,7 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatements(
|
||||
this->GetGlobalGenerator()->ConfigDirectory(config));
|
||||
const std::string ninjaOutputDir = this->ConvertToNinjaPath(objectDir);
|
||||
|
||||
cmNinjaBuild fatbinary(LanguageLinkerCudaFatbinaryRule(config));
|
||||
cmNinjaBuild fatbinary(this->LanguageLinkerCudaFatbinaryRule(config));
|
||||
|
||||
// Link device code for each architecture.
|
||||
for (const std::string& architectureKind : architectures) {
|
||||
@@ -744,7 +744,7 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatements(
|
||||
cmStrCat(" -im=profile=sm_", architecture, ",file=", cubin);
|
||||
fatbinary.ExplicitDeps.emplace_back(cubin);
|
||||
|
||||
cmNinjaBuild dlink(LanguageLinkerCudaDeviceRule(config));
|
||||
cmNinjaBuild dlink(this->LanguageLinkerCudaDeviceRule(config));
|
||||
dlink.ExplicitDeps = explicitDeps;
|
||||
dlink.Outputs = { cubin };
|
||||
dlink.Variables["ARCH"] = cmStrCat("sm_", architecture);
|
||||
@@ -767,7 +767,7 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatements(
|
||||
fatbinary);
|
||||
|
||||
// Compile the stub that registers the kernels and contains the fatbinaries.
|
||||
cmNinjaBuild dcompile(LanguageLinkerCudaDeviceCompileRule(config));
|
||||
cmNinjaBuild dcompile(this->LanguageLinkerCudaDeviceCompileRule(config));
|
||||
dcompile.Outputs = { output };
|
||||
dcompile.ExplicitDeps = { cmStrCat(ninjaOutputDir, "/cmake_cuda_fatbin.h") };
|
||||
dcompile.Variables["FATBIN"] =
|
||||
@@ -787,7 +787,7 @@ void cmNinjaNormalTargetGenerator::WriteNvidiaDeviceLinkStatement(
|
||||
cmGeneratorTarget* genTarget = this->GetGeneratorTarget();
|
||||
cmGlobalNinjaGenerator* globalGen = this->GetGlobalGenerator();
|
||||
|
||||
std::string targetOutputImplib = ConvertToNinjaPath(
|
||||
std::string targetOutputImplib = this->ConvertToNinjaPath(
|
||||
genTarget->GetFullPath(config, cmStateEnums::ImportLibraryArtifact));
|
||||
|
||||
if (config != fileConfig) {
|
||||
@@ -806,7 +806,7 @@ void cmNinjaNormalTargetGenerator::WriteNvidiaDeviceLinkStatement(
|
||||
->GetFullName(fileConfig, cmStateEnums::ImportLibraryArtifact)
|
||||
.empty() &&
|
||||
targetOutputImplib ==
|
||||
ConvertToNinjaPath(genTarget->GetFullPath(
|
||||
this->ConvertToNinjaPath(genTarget->GetFullPath(
|
||||
fileConfig, cmStateEnums::ImportLibraryArtifact))) {
|
||||
return;
|
||||
}
|
||||
@@ -882,16 +882,16 @@ void cmNinjaNormalTargetGenerator::WriteNvidiaDeviceLinkStatement(
|
||||
const std::string impLibPath = localGen.ConvertToOutputFormat(
|
||||
targetOutputImplib, cmOutputConverter::SHELL);
|
||||
vars["TARGET_IMPLIB"] = impLibPath;
|
||||
EnsureParentDirectoryExists(impLibPath);
|
||||
this->EnsureParentDirectoryExists(impLibPath);
|
||||
}
|
||||
|
||||
const std::string objPath =
|
||||
cmStrCat(GetGeneratorTarget()->GetSupportDirectory(),
|
||||
cmStrCat(this->GetGeneratorTarget()->GetSupportDirectory(),
|
||||
globalGen->ConfigDirectory(config));
|
||||
|
||||
vars["OBJECT_DIR"] = this->GetLocalGenerator()->ConvertToOutputFormat(
|
||||
this->ConvertToNinjaPath(objPath), cmOutputConverter::SHELL);
|
||||
EnsureDirectoryExists(objPath);
|
||||
this->EnsureDirectoryExists(objPath);
|
||||
|
||||
this->SetMsvcTargetPdbVariable(vars, config);
|
||||
|
||||
@@ -933,21 +933,22 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
|
||||
cmGlobalNinjaGenerator* globalGen = this->GetGlobalGenerator();
|
||||
cmGeneratorTarget* gt = this->GetGeneratorTarget();
|
||||
|
||||
std::string targetOutput = ConvertToNinjaPath(gt->GetFullPath(config));
|
||||
std::string targetOutputReal = ConvertToNinjaPath(
|
||||
std::string targetOutput = this->ConvertToNinjaPath(gt->GetFullPath(config));
|
||||
std::string targetOutputReal = this->ConvertToNinjaPath(
|
||||
gt->GetFullPath(config, cmStateEnums::RuntimeBinaryArtifact,
|
||||
/*realname=*/true));
|
||||
std::string targetOutputImplib = ConvertToNinjaPath(
|
||||
std::string targetOutputImplib = this->ConvertToNinjaPath(
|
||||
gt->GetFullPath(config, cmStateEnums::ImportLibraryArtifact));
|
||||
|
||||
if (config != fileConfig) {
|
||||
if (targetOutput == ConvertToNinjaPath(gt->GetFullPath(fileConfig))) {
|
||||
if (targetOutput ==
|
||||
this->ConvertToNinjaPath(gt->GetFullPath(fileConfig))) {
|
||||
return;
|
||||
}
|
||||
if (targetOutputReal ==
|
||||
ConvertToNinjaPath(gt->GetFullPath(fileConfig,
|
||||
cmStateEnums::RuntimeBinaryArtifact,
|
||||
/*realname=*/true))) {
|
||||
this->ConvertToNinjaPath(
|
||||
gt->GetFullPath(fileConfig, cmStateEnums::RuntimeBinaryArtifact,
|
||||
/*realname=*/true))) {
|
||||
return;
|
||||
}
|
||||
if (!gt->GetFullName(config, cmStateEnums::ImportLibraryArtifact)
|
||||
@@ -955,7 +956,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
|
||||
!gt->GetFullName(fileConfig, cmStateEnums::ImportLibraryArtifact)
|
||||
.empty() &&
|
||||
targetOutputImplib ==
|
||||
ConvertToNinjaPath(gt->GetFullPath(
|
||||
this->ConvertToNinjaPath(gt->GetFullPath(
|
||||
fileConfig, cmStateEnums::ImportLibraryArtifact))) {
|
||||
return;
|
||||
}
|
||||
@@ -1095,7 +1096,8 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
|
||||
std::vector<std::string> extraISPCObjects =
|
||||
this->GetGeneratorTarget()->GetGeneratedISPCObjects(config);
|
||||
std::transform(extraISPCObjects.begin(), extraISPCObjects.end(),
|
||||
std::back_inserter(linkBuild.ExplicitDeps), MapToNinjaPath());
|
||||
std::back_inserter(linkBuild.ExplicitDeps),
|
||||
this->MapToNinjaPath());
|
||||
|
||||
linkBuild.ImplicitDeps =
|
||||
this->ComputeLinkDeps(this->TargetLinkLanguage(config), config);
|
||||
@@ -1189,7 +1191,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
|
||||
const std::string impLibPath = localGen.ConvertToOutputFormat(
|
||||
targetOutputImplib, cmOutputConverter::SHELL);
|
||||
vars["TARGET_IMPLIB"] = impLibPath;
|
||||
EnsureParentDirectoryExists(impLibPath);
|
||||
this->EnsureParentDirectoryExists(impLibPath);
|
||||
if (gt->HasImportLibrary(config)) {
|
||||
byproducts.push_back(targetOutputImplib);
|
||||
if (firstForConfig) {
|
||||
@@ -1218,7 +1220,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
|
||||
cmStrCat(gt->GetSupportDirectory(), globalGen->ConfigDirectory(config));
|
||||
vars["OBJECT_DIR"] = this->GetLocalGenerator()->ConvertToOutputFormat(
|
||||
this->ConvertToNinjaPath(objPath), cmOutputConverter::SHELL);
|
||||
EnsureDirectoryExists(objPath);
|
||||
this->EnsureDirectoryExists(objPath);
|
||||
|
||||
std::string& linkLibraries = vars["LINK_LIBRARIES"];
|
||||
std::string& link_path = vars["LINK_PATH"];
|
||||
@@ -1247,11 +1249,11 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
|
||||
localGen.AppendCustomCommandLines(ccg, *cmdLineLists[i]);
|
||||
std::vector<std::string> const& ccByproducts = ccg.GetByproducts();
|
||||
std::transform(ccByproducts.begin(), ccByproducts.end(),
|
||||
std::back_inserter(byproducts), MapToNinjaPath());
|
||||
std::back_inserter(byproducts), this->MapToNinjaPath());
|
||||
std::transform(
|
||||
ccByproducts.begin(), ccByproducts.end(),
|
||||
std::back_inserter(globalGen->GetByproductsForCleanTarget()),
|
||||
MapToNinjaPath());
|
||||
this->MapToNinjaPath());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1272,7 +1274,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
|
||||
cmd += this->GetLocalGenerator()->ConvertToOutputFormat(
|
||||
obj_list_file, cmOutputConverter::SHELL);
|
||||
|
||||
cmProp nm_executable = GetMakefile()->GetDefinition("CMAKE_NM");
|
||||
cmProp nm_executable = this->GetMakefile()->GetDefinition("CMAKE_NM");
|
||||
if (cmNonempty(nm_executable)) {
|
||||
cmd += " --nm=";
|
||||
cmd += this->LocalCommonGenerator->ConvertToOutputFormat(
|
||||
@@ -1325,7 +1327,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement(
|
||||
// build response file name
|
||||
std::string cmakeLinkVar = cmakeVarLang + "_RESPONSE_FILE_LINK_FLAG";
|
||||
|
||||
cmProp flag = GetMakefile()->GetDefinition(cmakeLinkVar);
|
||||
cmProp flag = this->GetMakefile()->GetDefinition(cmakeLinkVar);
|
||||
|
||||
bool const lang_supports_response =
|
||||
!(this->TargetLinkLanguage(config) == "RC" ||
|
||||
|
||||
@@ -332,7 +332,8 @@ cmNinjaDeps cmNinjaTargetGenerator::ComputeLinkDeps(
|
||||
|
||||
const std::vector<std::string>& deps = cli->GetDepends();
|
||||
cmNinjaDeps result(deps.size());
|
||||
std::transform(deps.begin(), deps.end(), result.begin(), MapToNinjaPath());
|
||||
std::transform(deps.begin(), deps.end(), result.begin(),
|
||||
this->MapToNinjaPath());
|
||||
|
||||
// Add a dependency on the link definitions file, if any.
|
||||
if (cmGeneratorTarget::ModuleDefinitionInfo const* mdi =
|
||||
@@ -353,7 +354,7 @@ cmNinjaDeps cmNinjaTargetGenerator::ComputeLinkDeps(
|
||||
std::vector<std::string> linkDeps;
|
||||
this->GeneratorTarget->GetLinkDepends(linkDeps, config, linkLanguage);
|
||||
std::transform(linkDeps.begin(), linkDeps.end(), std::back_inserter(result),
|
||||
MapToNinjaPath());
|
||||
this->MapToNinjaPath());
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -361,7 +362,7 @@ cmNinjaDeps cmNinjaTargetGenerator::ComputeLinkDeps(
|
||||
std::string cmNinjaTargetGenerator::GetSourceFilePath(
|
||||
cmSourceFile const* source) const
|
||||
{
|
||||
return ConvertToNinjaPath(source->GetFullPath());
|
||||
return this->ConvertToNinjaPath(source->GetFullPath());
|
||||
}
|
||||
|
||||
std::string cmNinjaTargetGenerator::GetObjectFilePath(
|
||||
@@ -442,7 +443,7 @@ std::string cmNinjaTargetGenerator::GetTargetOutputDir(
|
||||
const std::string& config) const
|
||||
{
|
||||
std::string dir = this->GeneratorTarget->GetDirectory(config);
|
||||
return ConvertToNinjaPath(dir);
|
||||
return this->ConvertToNinjaPath(dir);
|
||||
}
|
||||
|
||||
std::string cmNinjaTargetGenerator::GetTargetFilePath(
|
||||
@@ -479,13 +480,13 @@ bool cmNinjaTargetGenerator::SetMsvcTargetPdbVariable(
|
||||
}
|
||||
|
||||
vars["TARGET_PDB"] = this->GetLocalGenerator()->ConvertToOutputFormat(
|
||||
ConvertToNinjaPath(pdbPath), cmOutputConverter::SHELL);
|
||||
this->ConvertToNinjaPath(pdbPath), cmOutputConverter::SHELL);
|
||||
vars["TARGET_COMPILE_PDB"] =
|
||||
this->GetLocalGenerator()->ConvertToOutputFormat(
|
||||
ConvertToNinjaPath(compilePdbPath), cmOutputConverter::SHELL);
|
||||
this->ConvertToNinjaPath(compilePdbPath), cmOutputConverter::SHELL);
|
||||
|
||||
EnsureParentDirectoryExists(pdbPath);
|
||||
EnsureParentDirectoryExists(compilePdbPath);
|
||||
this->EnsureParentDirectoryExists(pdbPath);
|
||||
this->EnsureParentDirectoryExists(compilePdbPath);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -605,7 +606,7 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang,
|
||||
this->GetLocalGenerator()->CreateRulePlaceholderExpander());
|
||||
|
||||
std::string const tdi = this->GetLocalGenerator()->ConvertToOutputFormat(
|
||||
ConvertToNinjaPath(this->GetTargetDependInfoPath(lang, config)),
|
||||
this->ConvertToNinjaPath(this->GetTargetDependInfoPath(lang, config)),
|
||||
cmLocalGenerator::SHELL);
|
||||
|
||||
std::string launcher;
|
||||
@@ -922,7 +923,8 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatements(
|
||||
config);
|
||||
}
|
||||
if (firstForConfig) {
|
||||
cmProp pchExtension = GetMakefile()->GetDefinition("CMAKE_PCH_EXTENSION");
|
||||
cmProp pchExtension =
|
||||
this->GetMakefile()->GetDefinition("CMAKE_PCH_EXTENSION");
|
||||
|
||||
std::vector<cmSourceFile const*> externalObjects;
|
||||
this->GeneratorTarget->GetExternalObjects(externalObjects, config);
|
||||
@@ -956,9 +958,11 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatements(
|
||||
const std::vector<std::string>& ccoutputs = ccg.GetOutputs();
|
||||
const std::vector<std::string>& ccbyproducts = ccg.GetByproducts();
|
||||
std::transform(ccoutputs.begin(), ccoutputs.end(),
|
||||
std::back_inserter(orderOnlyDeps), MapToNinjaPath());
|
||||
std::back_inserter(orderOnlyDeps),
|
||||
this->MapToNinjaPath());
|
||||
std::transform(ccbyproducts.begin(), ccbyproducts.end(),
|
||||
std::back_inserter(orderOnlyDeps), MapToNinjaPath());
|
||||
std::back_inserter(orderOnlyDeps),
|
||||
this->MapToNinjaPath());
|
||||
}
|
||||
|
||||
std::sort(orderOnlyDeps.begin(), orderOnlyDeps.end());
|
||||
@@ -1143,7 +1147,7 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
|
||||
// build response file name
|
||||
std::string cmakeLinkVar = cmStrCat(cmakeVarLang, "_RESPONSE_FILE_FLAG");
|
||||
|
||||
cmProp flag = GetMakefile()->GetDefinition(cmakeLinkVar);
|
||||
cmProp flag = this->GetMakefile()->GetDefinition(cmakeLinkVar);
|
||||
|
||||
bool const lang_supports_response =
|
||||
!(language == "RC" || (language == "CUDA" && !flag));
|
||||
@@ -1240,7 +1244,7 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
|
||||
}
|
||||
std::transform(depList.begin(), depList.end(),
|
||||
std::back_inserter(objBuild.ImplicitDeps),
|
||||
MapToNinjaPath());
|
||||
this->MapToNinjaPath());
|
||||
}
|
||||
|
||||
objBuild.OrderOnlyDeps.push_back(this->OrderDependsTargetForTarget(config));
|
||||
@@ -1329,7 +1333,7 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
|
||||
vars["dyndep"] = dyndep;
|
||||
}
|
||||
|
||||
EnsureParentDirectoryExists(objectFileName);
|
||||
this->EnsureParentDirectoryExists(objectFileName);
|
||||
|
||||
vars["OBJECT_DIR"] = this->GetLocalGenerator()->ConvertToOutputFormat(
|
||||
objectDir, cmOutputConverter::SHELL);
|
||||
@@ -1402,7 +1406,7 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
|
||||
auto headers = this->GeneratorTarget->GetGeneratedISPCHeaders(config);
|
||||
if (!headers.empty()) {
|
||||
std::transform(headers.begin(), headers.end(), headers.begin(),
|
||||
MapToNinjaPath());
|
||||
this->MapToNinjaPath());
|
||||
objBuild.OrderOnlyDeps.insert(objBuild.OrderOnlyDeps.end(),
|
||||
headers.begin(), headers.end());
|
||||
}
|
||||
@@ -1424,7 +1428,7 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
|
||||
build.Comment = "Additional output files.";
|
||||
build.Outputs = cmExpandedList(evaluatedObjectOutputs);
|
||||
std::transform(build.Outputs.begin(), build.Outputs.end(),
|
||||
build.Outputs.begin(), MapToNinjaPath());
|
||||
build.Outputs.begin(), this->MapToNinjaPath());
|
||||
build.ExplicitDeps = objBuild.Outputs;
|
||||
this->GetGlobalGenerator()->WriteBuild(
|
||||
this->GetImplFileStream(fileConfig), build);
|
||||
@@ -1644,7 +1648,7 @@ void cmNinjaTargetGenerator::EnsureDirectoryExists(
|
||||
void cmNinjaTargetGenerator::EnsureParentDirectoryExists(
|
||||
const std::string& path) const
|
||||
{
|
||||
EnsureDirectoryExists(cmSystemTools::GetParentDirectory(path));
|
||||
this->EnsureDirectoryExists(cmSystemTools::GetParentDirectory(path));
|
||||
}
|
||||
|
||||
void cmNinjaTargetGenerator::MacOSXContentGeneratorType::operator()(
|
||||
|
||||
@@ -83,7 +83,8 @@ void cmNinjaUtilityTargetGenerator::WriteUtilBuildStatements(
|
||||
lg->AppendCustomCommandLines(ccg, commands);
|
||||
std::vector<std::string> const& ccByproducts = ccg.GetByproducts();
|
||||
std::transform(ccByproducts.begin(), ccByproducts.end(),
|
||||
std::back_inserter(util_outputs), MapToNinjaPath());
|
||||
std::back_inserter(util_outputs),
|
||||
this->MapToNinjaPath());
|
||||
if (ci.GetUsesTerminal()) {
|
||||
uses_terminal = true;
|
||||
}
|
||||
@@ -103,9 +104,9 @@ void cmNinjaUtilityTargetGenerator::WriteUtilBuildStatements(
|
||||
const std::vector<std::string>& ccOutputs = ccg.GetOutputs();
|
||||
const std::vector<std::string>& ccByproducts = ccg.GetByproducts();
|
||||
std::transform(ccOutputs.begin(), ccOutputs.end(),
|
||||
std::back_inserter(deps), MapToNinjaPath());
|
||||
std::back_inserter(deps), this->MapToNinjaPath());
|
||||
std::transform(ccByproducts.begin(), ccByproducts.end(),
|
||||
std::back_inserter(deps), MapToNinjaPath());
|
||||
std::back_inserter(deps), this->MapToNinjaPath());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ bool cmProcessOutput::DecodeText(std::string raw, std::string& decoded,
|
||||
bool cmProcessOutput::DecodeText(const char* data, size_t length,
|
||||
std::string& decoded, size_t id)
|
||||
{
|
||||
return DecodeText(std::string(data, length), decoded, id);
|
||||
return this->DecodeText(std::string(data, length), decoded, id);
|
||||
}
|
||||
|
||||
bool cmProcessOutput::DecodeText(std::vector<char> raw,
|
||||
@@ -134,7 +134,7 @@ bool cmProcessOutput::DecodeText(std::vector<char> raw,
|
||||
{
|
||||
std::string str;
|
||||
const bool success =
|
||||
DecodeText(std::string(raw.begin(), raw.end()), str, id);
|
||||
this->DecodeText(std::string(raw.begin(), raw.end()), str, id);
|
||||
decoded.assign(str.begin(), str.end());
|
||||
return success;
|
||||
}
|
||||
|
||||
+11
-11
@@ -7,17 +7,17 @@
|
||||
|
||||
void cmPropertyMap::Clear()
|
||||
{
|
||||
Map_.clear();
|
||||
this->Map_.clear();
|
||||
}
|
||||
|
||||
void cmPropertyMap::SetProperty(const std::string& name, const char* value)
|
||||
{
|
||||
if (!value) {
|
||||
Map_.erase(name);
|
||||
this->Map_.erase(name);
|
||||
return;
|
||||
}
|
||||
|
||||
Map_[name] = value;
|
||||
this->Map_[name] = value;
|
||||
}
|
||||
|
||||
void cmPropertyMap::AppendProperty(const std::string& name,
|
||||
@@ -29,7 +29,7 @@ void cmPropertyMap::AppendProperty(const std::string& name,
|
||||
}
|
||||
|
||||
{
|
||||
std::string& pVal = Map_[name];
|
||||
std::string& pVal = this->Map_[name];
|
||||
if (!pVal.empty() && !asString) {
|
||||
pVal += ';';
|
||||
}
|
||||
@@ -39,13 +39,13 @@ void cmPropertyMap::AppendProperty(const std::string& name,
|
||||
|
||||
void cmPropertyMap::RemoveProperty(const std::string& name)
|
||||
{
|
||||
Map_.erase(name);
|
||||
this->Map_.erase(name);
|
||||
}
|
||||
|
||||
cmProp cmPropertyMap::GetPropertyValue(const std::string& name) const
|
||||
{
|
||||
auto it = Map_.find(name);
|
||||
if (it != Map_.end()) {
|
||||
auto it = this->Map_.find(name);
|
||||
if (it != this->Map_.end()) {
|
||||
return &it->second;
|
||||
}
|
||||
return nullptr;
|
||||
@@ -54,8 +54,8 @@ cmProp cmPropertyMap::GetPropertyValue(const std::string& name) const
|
||||
std::vector<std::string> cmPropertyMap::GetKeys() const
|
||||
{
|
||||
std::vector<std::string> keyList;
|
||||
keyList.reserve(Map_.size());
|
||||
for (auto const& item : Map_) {
|
||||
keyList.reserve(this->Map_.size());
|
||||
for (auto const& item : this->Map_) {
|
||||
keyList.push_back(item.first);
|
||||
}
|
||||
std::sort(keyList.begin(), keyList.end());
|
||||
@@ -66,8 +66,8 @@ std::vector<std::pair<std::string, std::string>> cmPropertyMap::GetList() const
|
||||
{
|
||||
using StringPair = std::pair<std::string, std::string>;
|
||||
std::vector<StringPair> kvList;
|
||||
kvList.reserve(Map_.size());
|
||||
for (auto const& item : Map_) {
|
||||
kvList.reserve(this->Map_.size());
|
||||
for (auto const& item : this->Map_) {
|
||||
kvList.emplace_back(item.first, item.second);
|
||||
}
|
||||
std::sort(kvList.begin(), kvList.end(),
|
||||
|
||||
@@ -111,20 +111,20 @@ public:
|
||||
RccLister(std::string rccExecutable, std::vector<std::string> listOptions);
|
||||
|
||||
//! The rcc executable
|
||||
std::string const& RccExcutable() const { return RccExcutable_; }
|
||||
std::string const& RccExcutable() const { return this->RccExcutable_; }
|
||||
void SetRccExecutable(std::string const& rccExecutable)
|
||||
{
|
||||
RccExcutable_ = rccExecutable;
|
||||
this->RccExcutable_ = rccExecutable;
|
||||
}
|
||||
|
||||
//! The rcc executable list options
|
||||
std::vector<std::string> const& ListOptions() const
|
||||
{
|
||||
return ListOptions_;
|
||||
return this->ListOptions_;
|
||||
}
|
||||
void SetListOptions(std::vector<std::string> const& listOptions)
|
||||
{
|
||||
ListOptions_ = listOptions;
|
||||
this->ListOptions_ = listOptions;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -57,7 +57,8 @@ cmQtAutoGenGlobalInitializer::cmQtAutoGenGlobalInitializer(
|
||||
if (targetName.empty()) {
|
||||
targetName = "autogen";
|
||||
}
|
||||
GlobalAutoGenTargets_.emplace(localGen.get(), std::move(targetName));
|
||||
this->GlobalAutoGenTargets_.emplace(localGen.get(),
|
||||
std::move(targetName));
|
||||
globalAutoGenTarget = true;
|
||||
}
|
||||
|
||||
@@ -68,7 +69,8 @@ cmQtAutoGenGlobalInitializer::cmQtAutoGenGlobalInitializer(
|
||||
if (targetName.empty()) {
|
||||
targetName = "autorcc";
|
||||
}
|
||||
GlobalAutoRccTargets_.emplace(localGen.get(), std::move(targetName));
|
||||
this->GlobalAutoRccTargets_.emplace(localGen.get(),
|
||||
std::move(targetName));
|
||||
globalAutoRccTarget = true;
|
||||
}
|
||||
}
|
||||
@@ -99,16 +101,16 @@ cmQtAutoGenGlobalInitializer::cmQtAutoGenGlobalInitializer(
|
||||
continue;
|
||||
}
|
||||
|
||||
bool const moc = target->GetPropertyAsBool(kw().AUTOMOC);
|
||||
bool const uic = target->GetPropertyAsBool(kw().AUTOUIC);
|
||||
bool const rcc = target->GetPropertyAsBool(kw().AUTORCC);
|
||||
bool const moc = target->GetPropertyAsBool(this->kw().AUTOMOC);
|
||||
bool const uic = target->GetPropertyAsBool(this->kw().AUTOUIC);
|
||||
bool const rcc = target->GetPropertyAsBool(this->kw().AUTORCC);
|
||||
if (moc || uic || rcc) {
|
||||
std::string const& mocExec =
|
||||
target->GetSafeProperty(kw().AUTOMOC_EXECUTABLE);
|
||||
target->GetSafeProperty(this->kw().AUTOMOC_EXECUTABLE);
|
||||
std::string const& uicExec =
|
||||
target->GetSafeProperty(kw().AUTOUIC_EXECUTABLE);
|
||||
target->GetSafeProperty(this->kw().AUTOUIC_EXECUTABLE);
|
||||
std::string const& rccExec =
|
||||
target->GetSafeProperty(kw().AUTORCC_EXECUTABLE);
|
||||
target->GetSafeProperty(this->kw().AUTORCC_EXECUTABLE);
|
||||
|
||||
// We support Qt4, Qt5 and Qt6
|
||||
auto qtVersion = cmQtAutoGenInitializer::GetQtVersion(target.get());
|
||||
@@ -141,9 +143,10 @@ cmQtAutoGenGlobalInitializer::cmQtAutoGenGlobalInitializer(
|
||||
}
|
||||
if (mocIsValid || uicIsValid || rccIsValid) {
|
||||
// Create autogen target initializer
|
||||
Initializers_.emplace_back(cm::make_unique<cmQtAutoGenInitializer>(
|
||||
this, target.get(), qtVersion.first, mocIsValid, uicIsValid,
|
||||
rccIsValid, globalAutoGenTarget, globalAutoRccTarget));
|
||||
this->Initializers_.emplace_back(
|
||||
cm::make_unique<cmQtAutoGenInitializer>(
|
||||
this, target.get(), qtVersion.first, mocIsValid, uicIsValid,
|
||||
rccIsValid, globalAutoGenTarget, globalAutoRccTarget));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -184,8 +187,8 @@ void cmQtAutoGenGlobalInitializer::GetOrCreateGlobalTarget(
|
||||
void cmQtAutoGenGlobalInitializer::AddToGlobalAutoGen(
|
||||
cmLocalGenerator* localGen, std::string const& targetName)
|
||||
{
|
||||
auto it = GlobalAutoGenTargets_.find(localGen);
|
||||
if (it != GlobalAutoGenTargets_.end()) {
|
||||
auto it = this->GlobalAutoGenTargets_.find(localGen);
|
||||
if (it != this->GlobalAutoGenTargets_.end()) {
|
||||
cmGeneratorTarget* target = localGen->FindGeneratorTargetToUse(it->second);
|
||||
if (target != nullptr) {
|
||||
target->Target->AddUtility(targetName, false, localGen->GetMakefile());
|
||||
@@ -196,8 +199,8 @@ void cmQtAutoGenGlobalInitializer::AddToGlobalAutoGen(
|
||||
void cmQtAutoGenGlobalInitializer::AddToGlobalAutoRcc(
|
||||
cmLocalGenerator* localGen, std::string const& targetName)
|
||||
{
|
||||
auto it = GlobalAutoRccTargets_.find(localGen);
|
||||
if (it != GlobalAutoRccTargets_.end()) {
|
||||
auto it = this->GlobalAutoRccTargets_.find(localGen);
|
||||
if (it != this->GlobalAutoRccTargets_.end()) {
|
||||
cmGeneratorTarget* target = localGen->FindGeneratorTargetToUse(it->second);
|
||||
if (target != nullptr) {
|
||||
target->Target->AddUtility(targetName, false, localGen->GetMakefile());
|
||||
@@ -258,7 +261,7 @@ cmQtAutoGenGlobalInitializer::GetCompilerFeatures(
|
||||
|
||||
bool cmQtAutoGenGlobalInitializer::generate()
|
||||
{
|
||||
return (InitializeCustomTargets() && SetupCustomTargets());
|
||||
return (this->InitializeCustomTargets() && this->SetupCustomTargets());
|
||||
}
|
||||
|
||||
bool cmQtAutoGenGlobalInitializer::InitializeCustomTargets()
|
||||
@@ -266,19 +269,19 @@ bool cmQtAutoGenGlobalInitializer::InitializeCustomTargets()
|
||||
// Initialize global autogen targets
|
||||
{
|
||||
std::string const comment = "Global AUTOGEN target";
|
||||
for (auto const& pair : GlobalAutoGenTargets_) {
|
||||
GetOrCreateGlobalTarget(pair.first, pair.second, comment);
|
||||
for (auto const& pair : this->GlobalAutoGenTargets_) {
|
||||
this->GetOrCreateGlobalTarget(pair.first, pair.second, comment);
|
||||
}
|
||||
}
|
||||
// Initialize global autorcc targets
|
||||
{
|
||||
std::string const comment = "Global AUTORCC target";
|
||||
for (auto const& pair : GlobalAutoRccTargets_) {
|
||||
GetOrCreateGlobalTarget(pair.first, pair.second, comment);
|
||||
for (auto const& pair : this->GlobalAutoRccTargets_) {
|
||||
this->GetOrCreateGlobalTarget(pair.first, pair.second, comment);
|
||||
}
|
||||
}
|
||||
// Initialize per target autogen targets
|
||||
for (auto& initializer : Initializers_) {
|
||||
for (auto& initializer : this->Initializers_) {
|
||||
if (!initializer->InitCustomTargets()) {
|
||||
return false;
|
||||
}
|
||||
@@ -288,7 +291,7 @@ bool cmQtAutoGenGlobalInitializer::InitializeCustomTargets()
|
||||
|
||||
bool cmQtAutoGenGlobalInitializer::SetupCustomTargets()
|
||||
{
|
||||
for (auto& initializer : Initializers_) {
|
||||
for (auto& initializer : this->Initializers_) {
|
||||
if (!initializer->SetupCustomTargets()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
std::vector<std::unique_ptr<cmLocalGenerator>> const& localGenerators);
|
||||
~cmQtAutoGenGlobalInitializer();
|
||||
|
||||
Keywords const& kw() const { return Keywords_; };
|
||||
Keywords const& kw() const { return this->Keywords_; };
|
||||
|
||||
bool generate();
|
||||
|
||||
|
||||
@@ -152,7 +152,8 @@ std::vector<std::string> SearchPathSanitizer::operator()(
|
||||
res.reserve(paths.size());
|
||||
for (std::string const& srcPath : paths) {
|
||||
// Collapse relative paths
|
||||
std::string path = cmSystemTools::CollapseFullPath(srcPath, SourcePath_);
|
||||
std::string path =
|
||||
cmSystemTools::CollapseFullPath(srcPath, this->SourcePath_);
|
||||
// Remove suffix slashes
|
||||
while (cmHasSuffix(path, '/')) {
|
||||
path.pop_back();
|
||||
@@ -172,14 +173,17 @@ public:
|
||||
// -- Single value
|
||||
void Set(std::string const& key, std::string const& value)
|
||||
{
|
||||
Value_[key] = value;
|
||||
this->Value_[key] = value;
|
||||
}
|
||||
void SetConfig(std::string const& key,
|
||||
cmQtAutoGenInitializer::ConfigString const& cfgStr);
|
||||
void SetBool(std::string const& key, bool value) { Value_[key] = value; }
|
||||
void SetBool(std::string const& key, bool value)
|
||||
{
|
||||
this->Value_[key] = value;
|
||||
}
|
||||
void SetUInt(std::string const& key, unsigned int value)
|
||||
{
|
||||
Value_[key] = value;
|
||||
this->Value_[key] = value;
|
||||
}
|
||||
|
||||
// -- Array utility
|
||||
@@ -211,9 +215,9 @@ private:
|
||||
void InfoWriter::SetConfig(std::string const& key,
|
||||
cmQtAutoGenInitializer::ConfigString const& cfgStr)
|
||||
{
|
||||
Set(key, cfgStr.Default);
|
||||
this->Set(key, cfgStr.Default);
|
||||
for (auto const& item : cfgStr.Config) {
|
||||
Set(cmStrCat(key, '_', item.first), item.second);
|
||||
this->Set(cmStrCat(key, '_', item.first), item.second);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -243,14 +247,14 @@ void InfoWriter::MakeStringArray(Json::Value& jval, CONT const& container)
|
||||
template <typename CONT>
|
||||
void InfoWriter::SetArray(std::string const& key, CONT const& container)
|
||||
{
|
||||
MakeStringArray(Value_[key], container);
|
||||
MakeStringArray(this->Value_[key], container);
|
||||
}
|
||||
|
||||
template <typename CONT, typename FUNC>
|
||||
void InfoWriter::SetArrayArray(std::string const& key, CONT const& container,
|
||||
FUNC func)
|
||||
{
|
||||
Json::Value& jval = Value_[key];
|
||||
Json::Value& jval = this->Value_[key];
|
||||
if (MakeArray(jval, container)) {
|
||||
Json::ArrayIndex ii = 0;
|
||||
for (auto const& citem : container) {
|
||||
@@ -266,9 +270,9 @@ void InfoWriter::SetConfigArray(
|
||||
std::string const& key,
|
||||
cmQtAutoGenInitializer::ConfigStrings<CONT> const& cfgStr)
|
||||
{
|
||||
SetArray(key, cfgStr.Default);
|
||||
this->SetArray(key, cfgStr.Default);
|
||||
for (auto const& item : cfgStr.Config) {
|
||||
SetArray(cmStrCat(key, '_', item.first), item.second);
|
||||
this->SetArray(cmStrCat(key, '_', item.first), item.second);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -283,7 +287,7 @@ bool InfoWriter::Save(std::string const& filename)
|
||||
|
||||
Json::StyledStreamWriter jsonWriter;
|
||||
try {
|
||||
jsonWriter.write(fileStream, Value_);
|
||||
jsonWriter.write(fileStream, this->Value_);
|
||||
} catch (...) {
|
||||
return false;
|
||||
}
|
||||
@@ -306,11 +310,11 @@ cmQtAutoGenInitializer::cmQtAutoGenInitializer(
|
||||
, PathCheckSum(genTarget->Makefile)
|
||||
, QtVersion(qtVersion)
|
||||
{
|
||||
AutogenTarget.GlobalTarget = globalAutogenTarget;
|
||||
Moc.Enabled = mocEnabled;
|
||||
Uic.Enabled = uicEnabled;
|
||||
Rcc.Enabled = rccEnabled;
|
||||
Rcc.GlobalTarget = globalAutoRccTarget;
|
||||
this->AutogenTarget.GlobalTarget = globalAutogenTarget;
|
||||
this->Moc.Enabled = mocEnabled;
|
||||
this->Uic.Enabled = uicEnabled;
|
||||
this->Rcc.Enabled = rccEnabled;
|
||||
this->Rcc.GlobalTarget = globalAutoRccTarget;
|
||||
}
|
||||
|
||||
bool cmQtAutoGenInitializer::InitCustomTargets()
|
||||
@@ -416,8 +420,8 @@ bool cmQtAutoGenInitializer::InitCustomTargets()
|
||||
cmSystemTools::ConvertToUnixSlashes(this->Dir.Work);
|
||||
|
||||
// Include directory
|
||||
ConfigFileNames(this->Dir.Include, cmStrCat(this->Dir.Build, "/include"),
|
||||
"");
|
||||
this->ConfigFileNames(this->Dir.Include,
|
||||
cmStrCat(this->Dir.Build, "/include"), "");
|
||||
this->Dir.IncludeGenExp = this->Dir.Include.Default;
|
||||
if (this->MultiConfig) {
|
||||
this->Dir.IncludeGenExp += "_$<CONFIG>";
|
||||
@@ -427,12 +431,12 @@ bool cmQtAutoGenInitializer::InitCustomTargets()
|
||||
// Moc, Uic and _autogen target settings
|
||||
if (this->MocOrUicEnabled()) {
|
||||
// Init moc specific settings
|
||||
if (this->Moc.Enabled && !InitMoc()) {
|
||||
if (this->Moc.Enabled && !this->InitMoc()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Init uic specific settings
|
||||
if (this->Uic.Enabled && !InitUic()) {
|
||||
if (this->Uic.Enabled && !this->InitUic()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -459,14 +463,14 @@ bool cmQtAutoGenInitializer::InitCustomTargets()
|
||||
cmStrCat(this->Dir.Info, "/AutogenInfo.json");
|
||||
|
||||
// Used settings file
|
||||
ConfigFileNames(this->AutogenTarget.SettingsFile,
|
||||
cmStrCat(this->Dir.Info, "/AutogenUsed"), ".txt");
|
||||
ConfigFileClean(this->AutogenTarget.SettingsFile);
|
||||
this->ConfigFileNames(this->AutogenTarget.SettingsFile,
|
||||
cmStrCat(this->Dir.Info, "/AutogenUsed"), ".txt");
|
||||
this->ConfigFileClean(this->AutogenTarget.SettingsFile);
|
||||
|
||||
// Parse cache file
|
||||
ConfigFileNames(this->AutogenTarget.ParseCacheFile,
|
||||
cmStrCat(this->Dir.Info, "/ParseCache"), ".txt");
|
||||
ConfigFileClean(this->AutogenTarget.ParseCacheFile);
|
||||
this->ConfigFileNames(this->AutogenTarget.ParseCacheFile,
|
||||
cmStrCat(this->Dir.Info, "/ParseCache"), ".txt");
|
||||
this->ConfigFileClean(this->AutogenTarget.ParseCacheFile);
|
||||
}
|
||||
|
||||
// Autogen target: Compute user defined dependencies
|
||||
@@ -535,7 +539,7 @@ bool cmQtAutoGenInitializer::InitCustomTargets()
|
||||
}
|
||||
|
||||
// Init rcc specific settings
|
||||
if (this->Rcc.Enabled && !InitRcc()) {
|
||||
if (this->Rcc.Enabled && !this->InitRcc()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -572,8 +576,9 @@ bool cmQtAutoGenInitializer::InitMoc()
|
||||
cmStrCat(this->Dir.Build, "/mocs_compilation.cpp");
|
||||
this->Moc.CompilationFileGenex = this->Moc.CompilationFile.Default;
|
||||
} else {
|
||||
ConfigFileNames(this->Moc.CompilationFile,
|
||||
cmStrCat(this->Dir.Build, "/mocs_compilation"), ".cpp");
|
||||
this->ConfigFileNames(this->Moc.CompilationFile,
|
||||
cmStrCat(this->Dir.Build, "/mocs_compilation"),
|
||||
".cpp");
|
||||
if (this->MultiConfig) {
|
||||
this->Moc.CompilationFileGenex =
|
||||
cmStrCat(this->Dir.Build, "/mocs_compilation_$<CONFIG>.cpp"_s);
|
||||
@@ -590,8 +595,8 @@ bool cmQtAutoGenInitializer::InitMoc()
|
||||
this->Moc.PredefsCmd);
|
||||
// Header
|
||||
if (!this->Moc.PredefsCmd.empty()) {
|
||||
ConfigFileNames(this->Moc.PredefsFile,
|
||||
cmStrCat(this->Dir.Build, "/moc_predefs"), ".h");
|
||||
this->ConfigFileNames(this->Moc.PredefsFile,
|
||||
cmStrCat(this->Dir.Build, "/moc_predefs"), ".h");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1035,7 +1040,7 @@ bool cmQtAutoGenInitializer::InitScanFiles()
|
||||
qrc.QrcName, '_', qrc.QrcPathChecksum);
|
||||
qrc.LockFile = cmStrCat(base, "_Lock.lock");
|
||||
qrc.InfoFile = cmStrCat(base, "_Info.json");
|
||||
ConfigFileNames(qrc.SettingsFile, cmStrCat(base, "_Used"), ".txt");
|
||||
this->ConfigFileNames(qrc.SettingsFile, cmStrCat(base, "_Used"), ".txt");
|
||||
}
|
||||
// rcc options
|
||||
for (Qrc& qrc : this->Rcc.Qrcs) {
|
||||
@@ -1133,7 +1138,7 @@ bool cmQtAutoGenInitializer::InitAutogenTarget()
|
||||
usePRE_BUILD = false;
|
||||
}
|
||||
// Cannot use PRE_BUILD when a global autogen target is in place
|
||||
if (AutogenTarget.GlobalTarget) {
|
||||
if (this->AutogenTarget.GlobalTarget) {
|
||||
usePRE_BUILD = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,10 +18,10 @@ cmQtAutoGenerator::Logger::Logger()
|
||||
if (cmSystemTools::GetEnv("VERBOSE", verbose) && !verbose.empty()) {
|
||||
unsigned long iVerbose = 0;
|
||||
if (cmStrToULong(verbose, &iVerbose)) {
|
||||
SetVerbosity(static_cast<unsigned int>(iVerbose));
|
||||
this->SetVerbosity(static_cast<unsigned int>(iVerbose));
|
||||
} else {
|
||||
// Non numeric verbosity
|
||||
SetVerbose(cmIsOn(verbose));
|
||||
this->SetVerbose(cmIsOn(verbose));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,9 +29,9 @@ cmQtAutoGenerator::Logger::Logger()
|
||||
std::string colorEnv;
|
||||
cmSystemTools::GetEnv("COLOR", colorEnv);
|
||||
if (!colorEnv.empty()) {
|
||||
SetColorOutput(cmIsOn(colorEnv));
|
||||
this->SetColorOutput(cmIsOn(colorEnv));
|
||||
} else {
|
||||
SetColorOutput(true);
|
||||
this->SetColorOutput(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -47,7 +47,7 @@ void cmQtAutoGenerator::Logger::RaiseVerbosity(unsigned int value)
|
||||
|
||||
void cmQtAutoGenerator::Logger::SetColorOutput(bool value)
|
||||
{
|
||||
ColorOutput_ = value;
|
||||
this->ColorOutput_ = value;
|
||||
}
|
||||
|
||||
std::string cmQtAutoGenerator::Logger::HeadLine(cm::string_view title)
|
||||
@@ -61,7 +61,7 @@ void cmQtAutoGenerator::Logger::Info(GenT genType,
|
||||
std::string msg = cmStrCat(GeneratorName(genType), ": ", message,
|
||||
cmHasSuffix(message, '\n') ? "" : "\n");
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(Mutex_);
|
||||
std::lock_guard<std::mutex> lock(this->Mutex_);
|
||||
cmSystemTools::Stdout(msg);
|
||||
}
|
||||
}
|
||||
@@ -80,7 +80,7 @@ void cmQtAutoGenerator::Logger::Warning(GenT genType,
|
||||
message, cmHasSuffix(message, '\n') ? "\n" : "\n\n");
|
||||
}
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(Mutex_);
|
||||
std::lock_guard<std::mutex> lock(this->Mutex_);
|
||||
cmSystemTools::Stdout(msg);
|
||||
}
|
||||
}
|
||||
@@ -92,7 +92,7 @@ void cmQtAutoGenerator::Logger::Error(GenT genType,
|
||||
cmStrCat('\n', HeadLine(cmStrCat(GeneratorName(genType), " error")),
|
||||
message, cmHasSuffix(message, '\n') ? "\n" : "\n\n");
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(Mutex_);
|
||||
std::lock_guard<std::mutex> lock(this->Mutex_);
|
||||
cmSystemTools::Stderr(msg);
|
||||
}
|
||||
}
|
||||
@@ -108,7 +108,7 @@ void cmQtAutoGenerator::Logger::ErrorCommand(
|
||||
msg += cmStrCat(HeadLine("Output"), output,
|
||||
cmHasSuffix(output, '\n') ? "\n" : "\n\n");
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(Mutex_);
|
||||
std::lock_guard<std::mutex> lock(this->Mutex_);
|
||||
cmSystemTools::Stderr(msg);
|
||||
}
|
||||
}
|
||||
@@ -215,7 +215,7 @@ cmQtAutoGenerator::~cmQtAutoGenerator() = default;
|
||||
bool cmQtAutoGenerator::InfoT::Read(std::istream& istr)
|
||||
{
|
||||
try {
|
||||
istr >> Json_;
|
||||
istr >> this->Json_;
|
||||
} catch (...) {
|
||||
return false;
|
||||
}
|
||||
@@ -264,22 +264,22 @@ bool cmQtAutoGenerator::InfoT::GetJsonArray(
|
||||
|
||||
std::string cmQtAutoGenerator::InfoT::ConfigKey(cm::string_view key) const
|
||||
{
|
||||
return cmStrCat(key, '_', Gen_.InfoConfig());
|
||||
return cmStrCat(key, '_', this->Gen_.InfoConfig());
|
||||
}
|
||||
|
||||
bool cmQtAutoGenerator::InfoT::GetString(std::string const& key,
|
||||
std::string& value,
|
||||
bool required) const
|
||||
{
|
||||
Json::Value const& jval = Json_[key];
|
||||
Json::Value const& jval = this->Json_[key];
|
||||
if (!jval.isString()) {
|
||||
if (!jval.isNull() || required) {
|
||||
return LogError(cmStrCat(key, " is not a string."));
|
||||
return this->LogError(cmStrCat(key, " is not a string."));
|
||||
}
|
||||
} else {
|
||||
value = jval.asString();
|
||||
if (value.empty() && required) {
|
||||
return LogError(cmStrCat(key, " is empty."));
|
||||
return this->LogError(cmStrCat(key, " is empty."));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -290,32 +290,32 @@ bool cmQtAutoGenerator::InfoT::GetStringConfig(std::string const& key,
|
||||
bool required) const
|
||||
{
|
||||
{ // Try config
|
||||
std::string const configKey = ConfigKey(key);
|
||||
Json::Value const& jval = Json_[configKey];
|
||||
std::string const configKey = this->ConfigKey(key);
|
||||
Json::Value const& jval = this->Json_[configKey];
|
||||
if (!jval.isNull()) {
|
||||
if (!jval.isString()) {
|
||||
return LogError(cmStrCat(configKey, " is not a string."));
|
||||
return this->LogError(cmStrCat(configKey, " is not a string."));
|
||||
}
|
||||
value = jval.asString();
|
||||
if (required && value.empty()) {
|
||||
return LogError(cmStrCat(configKey, " is empty."));
|
||||
return this->LogError(cmStrCat(configKey, " is empty."));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// Try plain
|
||||
return GetString(key, value, required);
|
||||
return this->GetString(key, value, required);
|
||||
}
|
||||
|
||||
bool cmQtAutoGenerator::InfoT::GetBool(std::string const& key, bool& value,
|
||||
bool required) const
|
||||
{
|
||||
Json::Value const& jval = Json_[key];
|
||||
Json::Value const& jval = this->Json_[key];
|
||||
if (jval.isBool()) {
|
||||
value = jval.asBool();
|
||||
} else {
|
||||
if (!jval.isNull() || required) {
|
||||
return LogError(cmStrCat(key, " is not a boolean."));
|
||||
return this->LogError(cmStrCat(key, " is not a boolean."));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -325,12 +325,12 @@ bool cmQtAutoGenerator::InfoT::GetUInt(std::string const& key,
|
||||
unsigned int& value,
|
||||
bool required) const
|
||||
{
|
||||
Json::Value const& jval = Json_[key];
|
||||
Json::Value const& jval = this->Json_[key];
|
||||
if (jval.isUInt()) {
|
||||
value = jval.asUInt();
|
||||
} else {
|
||||
if (!jval.isNull() || required) {
|
||||
return LogError(cmStrCat(key, " is not an unsigned integer."));
|
||||
return this->LogError(cmStrCat(key, " is not an unsigned integer."));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -340,10 +340,10 @@ bool cmQtAutoGenerator::InfoT::GetArray(std::string const& key,
|
||||
std::vector<std::string>& list,
|
||||
bool required) const
|
||||
{
|
||||
Json::Value const& jval = Json_[key];
|
||||
Json::Value const& jval = this->Json_[key];
|
||||
if (!jval.isArray()) {
|
||||
if (!jval.isNull() || required) {
|
||||
return LogError(cmStrCat(key, " is not an array."));
|
||||
return this->LogError(cmStrCat(key, " is not an array."));
|
||||
}
|
||||
}
|
||||
return GetJsonArray(list, jval) || !required;
|
||||
@@ -353,10 +353,10 @@ bool cmQtAutoGenerator::InfoT::GetArray(std::string const& key,
|
||||
std::unordered_set<std::string>& list,
|
||||
bool required) const
|
||||
{
|
||||
Json::Value const& jval = Json_[key];
|
||||
Json::Value const& jval = this->Json_[key];
|
||||
if (!jval.isArray()) {
|
||||
if (!jval.isNull() || required) {
|
||||
return LogError(cmStrCat(key, " is not an array."));
|
||||
return this->LogError(cmStrCat(key, " is not an array."));
|
||||
}
|
||||
}
|
||||
return GetJsonArray(list, jval) || !required;
|
||||
@@ -367,34 +367,35 @@ bool cmQtAutoGenerator::InfoT::GetArrayConfig(std::string const& key,
|
||||
bool required) const
|
||||
{
|
||||
{ // Try config
|
||||
std::string const configKey = ConfigKey(key);
|
||||
Json::Value const& jval = Json_[configKey];
|
||||
std::string const configKey = this->ConfigKey(key);
|
||||
Json::Value const& jval = this->Json_[configKey];
|
||||
if (!jval.isNull()) {
|
||||
if (!jval.isArray()) {
|
||||
return LogError(cmStrCat(configKey, " is not an array string."));
|
||||
return this->LogError(cmStrCat(configKey, " is not an array string."));
|
||||
}
|
||||
if (!GetJsonArray(list, jval) && required) {
|
||||
return LogError(cmStrCat(configKey, " is empty."));
|
||||
return this->LogError(cmStrCat(configKey, " is empty."));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// Try plain
|
||||
return GetArray(key, list, required);
|
||||
return this->GetArray(key, list, required);
|
||||
}
|
||||
|
||||
bool cmQtAutoGenerator::InfoT::LogError(GenT genType,
|
||||
cm::string_view message) const
|
||||
{
|
||||
Gen_.Log().Error(genType,
|
||||
cmStrCat("Info error in info file\n",
|
||||
Quoted(Gen_.InfoFile()), ":\n", message));
|
||||
this->Gen_.Log().Error(genType,
|
||||
cmStrCat("Info error in info file\n",
|
||||
Quoted(this->Gen_.InfoFile()), ":\n",
|
||||
message));
|
||||
return false;
|
||||
}
|
||||
|
||||
bool cmQtAutoGenerator::InfoT::LogError(cm::string_view message) const
|
||||
{
|
||||
return LogError(Gen_.GenType_, message);
|
||||
return this->LogError(this->Gen_.GenType_, message);
|
||||
}
|
||||
|
||||
std::string cmQtAutoGenerator::SettingsFind(cm::string_view content,
|
||||
@@ -418,10 +419,10 @@ std::string cmQtAutoGenerator::SettingsFind(cm::string_view content,
|
||||
std::string cmQtAutoGenerator::MessagePath(cm::string_view path) const
|
||||
{
|
||||
std::string res;
|
||||
if (cmHasPrefix(path, ProjectDirs().Source)) {
|
||||
res = cmStrCat("SRC:", path.substr(ProjectDirs().Source.size()));
|
||||
} else if (cmHasPrefix(path, ProjectDirs().Binary)) {
|
||||
res = cmStrCat("BIN:", path.substr(ProjectDirs().Binary.size()));
|
||||
if (cmHasPrefix(path, this->ProjectDirs().Source)) {
|
||||
res = cmStrCat("SRC:", path.substr(this->ProjectDirs().Source.size()));
|
||||
} else if (cmHasPrefix(path, this->ProjectDirs().Binary)) {
|
||||
res = cmStrCat("BIN:", path.substr(this->ProjectDirs().Binary.size()));
|
||||
} else {
|
||||
res = std::string(path);
|
||||
}
|
||||
@@ -431,17 +432,18 @@ std::string cmQtAutoGenerator::MessagePath(cm::string_view path) const
|
||||
bool cmQtAutoGenerator::Run(cm::string_view infoFile, cm::string_view config)
|
||||
{
|
||||
// Info config
|
||||
InfoConfig_ = std::string(config);
|
||||
this->InfoConfig_ = std::string(config);
|
||||
|
||||
// Info file
|
||||
InfoFile_ = std::string(infoFile);
|
||||
cmSystemTools::CollapseFullPath(InfoFile_);
|
||||
InfoDir_ = cmSystemTools::GetFilenamePath(InfoFile_);
|
||||
this->InfoFile_ = std::string(infoFile);
|
||||
cmSystemTools::CollapseFullPath(this->InfoFile_);
|
||||
this->InfoDir_ = cmSystemTools::GetFilenamePath(this->InfoFile_);
|
||||
|
||||
// Load info file time
|
||||
if (!InfoFileTime_.Load(InfoFile_)) {
|
||||
if (!this->InfoFileTime_.Load(this->InfoFile_)) {
|
||||
cmSystemTools::Stderr(cmStrCat("AutoGen: The info file ",
|
||||
Quoted(InfoFile_), " is not readable\n"));
|
||||
Quoted(this->InfoFile_),
|
||||
" is not readable\n"));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -450,17 +452,18 @@ bool cmQtAutoGenerator::Run(cm::string_view infoFile, cm::string_view config)
|
||||
|
||||
// Read info file
|
||||
{
|
||||
cmsys::ifstream ifs(InfoFile_.c_str(),
|
||||
cmsys::ifstream ifs(this->InfoFile_.c_str(),
|
||||
(std::ios::in | std::ios::binary));
|
||||
if (!ifs) {
|
||||
Log().Error(
|
||||
GenType_,
|
||||
cmStrCat("Could not to open info file ", Quoted(InfoFile_)));
|
||||
this->Log().Error(
|
||||
this->GenType_,
|
||||
cmStrCat("Could not to open info file ", Quoted(this->InfoFile_)));
|
||||
return false;
|
||||
}
|
||||
if (!info.Read(ifs)) {
|
||||
Log().Error(GenType_,
|
||||
cmStrCat("Could not read info file ", Quoted(InfoFile_)));
|
||||
this->Log().Error(
|
||||
this->GenType_,
|
||||
cmStrCat("Could not read info file ", Quoted(this->InfoFile_)));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -470,15 +473,17 @@ bool cmQtAutoGenerator::Run(cm::string_view infoFile, cm::string_view config)
|
||||
unsigned int verbosity = 0;
|
||||
// Info: setup project directories
|
||||
if (!info.GetUInt("VERBOSITY", verbosity, false) ||
|
||||
!info.GetString("CMAKE_SOURCE_DIR", ProjectDirs_.Source, true) ||
|
||||
!info.GetString("CMAKE_BINARY_DIR", ProjectDirs_.Binary, true) ||
|
||||
!info.GetString("CMAKE_SOURCE_DIR", this->ProjectDirs_.Source,
|
||||
true) ||
|
||||
!info.GetString("CMAKE_BINARY_DIR", this->ProjectDirs_.Binary,
|
||||
true) ||
|
||||
!info.GetString("CMAKE_CURRENT_SOURCE_DIR",
|
||||
ProjectDirs_.CurrentSource, true) ||
|
||||
this->ProjectDirs_.CurrentSource, true) ||
|
||||
!info.GetString("CMAKE_CURRENT_BINARY_DIR",
|
||||
ProjectDirs_.CurrentBinary, true)) {
|
||||
this->ProjectDirs_.CurrentBinary, true)) {
|
||||
return false;
|
||||
}
|
||||
Logger_.RaiseVerbosity(verbosity);
|
||||
this->Logger_.RaiseVerbosity(verbosity);
|
||||
}
|
||||
|
||||
// -- Call virtual init from info method.
|
||||
|
||||
@@ -88,10 +88,10 @@ public:
|
||||
cmQtAutoGenerator& operator=(cmQtAutoGenerator const&) = delete;
|
||||
|
||||
// -- Info options
|
||||
std::string const& InfoFile() const { return InfoFile_; }
|
||||
std::string const& InfoDir() const { return InfoDir_; }
|
||||
cmFileTime const& InfoFileTime() const { return InfoFileTime_; }
|
||||
std::string const& InfoConfig() const { return InfoConfig_; }
|
||||
std::string const& InfoFile() const { return this->InfoFile_; }
|
||||
std::string const& InfoDir() const { return this->InfoDir_; }
|
||||
cmFileTime const& InfoFileTime() const { return this->InfoFileTime_; }
|
||||
std::string const& InfoConfig() const { return this->InfoConfig_; }
|
||||
|
||||
// -- Info file parsing
|
||||
/** Info file reader class. */
|
||||
@@ -124,7 +124,7 @@ public:
|
||||
|
||||
Json::Value const& GetValue(std::string const& key) const
|
||||
{
|
||||
return Json_[key];
|
||||
return this->Json_[key];
|
||||
}
|
||||
|
||||
/** Returns true if strings were appended to the list. */
|
||||
@@ -150,7 +150,7 @@ public:
|
||||
cm::string_view key);
|
||||
|
||||
// -- Directories
|
||||
ProjectDirsT const& ProjectDirs() const { return ProjectDirs_; }
|
||||
ProjectDirsT const& ProjectDirs() const { return this->ProjectDirs_; }
|
||||
std::string MessagePath(cm::string_view path) const;
|
||||
|
||||
// -- Run
|
||||
@@ -161,7 +161,7 @@ protected:
|
||||
virtual bool InitFromInfo(InfoT const& info) = 0;
|
||||
virtual bool Process() = 0;
|
||||
// - Utility classes
|
||||
Logger const& Log() const { return Logger_; }
|
||||
Logger const& Log() const { return this->Logger_; }
|
||||
|
||||
private:
|
||||
// -- Generator type
|
||||
|
||||
+618
-559
@@ -313,22 +313,22 @@ public:
|
||||
//! Get the generator. Only valid during Process() call!
|
||||
cmQtAutoMocUicT* Gen() const
|
||||
{
|
||||
return static_cast<cmQtAutoMocUicT*>(UserData());
|
||||
return static_cast<cmQtAutoMocUicT*>(this->UserData());
|
||||
};
|
||||
|
||||
// -- Accessors. Only valid during Process() call!
|
||||
Logger const& Log() const { return Gen()->Log(); }
|
||||
BaseSettingsT const& BaseConst() const { return Gen()->BaseConst(); }
|
||||
BaseEvalT& BaseEval() const { return Gen()->BaseEval(); }
|
||||
MocSettingsT const& MocConst() const { return Gen()->MocConst(); }
|
||||
MocEvalT& MocEval() const { return Gen()->MocEval(); }
|
||||
UicSettingsT const& UicConst() const { return Gen()->UicConst(); }
|
||||
UicEvalT& UicEval() const { return Gen()->UicEval(); }
|
||||
Logger const& Log() const { return this->Gen()->Log(); }
|
||||
BaseSettingsT const& BaseConst() const { return this->Gen()->BaseConst(); }
|
||||
BaseEvalT& BaseEval() const { return this->Gen()->BaseEval(); }
|
||||
MocSettingsT const& MocConst() const { return this->Gen()->MocConst(); }
|
||||
MocEvalT& MocEval() const { return this->Gen()->MocEval(); }
|
||||
UicSettingsT const& UicConst() const { return this->Gen()->UicConst(); }
|
||||
UicEvalT& UicEval() const { return this->Gen()->UicEval(); }
|
||||
|
||||
// -- Logging
|
||||
std::string MessagePath(cm::string_view path) const
|
||||
{
|
||||
return Gen()->MessagePath(path);
|
||||
return this->Gen()->MessagePath(path);
|
||||
}
|
||||
// - Error logging with automatic abort
|
||||
void LogError(GenT genType, cm::string_view message) const;
|
||||
@@ -541,9 +541,9 @@ public:
|
||||
UicEvalT& UicEval() { return this->UicEval_; }
|
||||
|
||||
// -- Parallel job processing interface
|
||||
cmWorkerPool& WorkerPool() { return WorkerPool_; }
|
||||
void AbortError() { Abort(true); }
|
||||
void AbortSuccess() { Abort(false); }
|
||||
cmWorkerPool& WorkerPool() { return this->WorkerPool_; }
|
||||
void AbortError() { this->Abort(true); }
|
||||
void AbortSuccess() { this->Abort(false); }
|
||||
|
||||
// -- Utility
|
||||
std::string AbsoluteBuildPath(cm::string_view relativePath) const;
|
||||
@@ -597,19 +597,19 @@ cmQtAutoMocUicT::IncludeKeyT::IncludeKeyT(std::string const& key,
|
||||
, Base(cmSystemTools::GetFilenameWithoutLastExtension(key))
|
||||
{
|
||||
if (basePrefixLength != 0) {
|
||||
Base = Base.substr(basePrefixLength);
|
||||
this->Base = this->Base.substr(basePrefixLength);
|
||||
}
|
||||
}
|
||||
|
||||
void cmQtAutoMocUicT::ParseCacheT::FileT::Clear()
|
||||
{
|
||||
Moc.Macro.clear();
|
||||
Moc.Include.Underscore.clear();
|
||||
Moc.Include.Dot.clear();
|
||||
Moc.Depends.clear();
|
||||
this->Moc.Macro.clear();
|
||||
this->Moc.Include.Underscore.clear();
|
||||
this->Moc.Include.Dot.clear();
|
||||
this->Moc.Depends.clear();
|
||||
|
||||
Uic.Include.clear();
|
||||
Uic.Depends.clear();
|
||||
this->Uic.Include.clear();
|
||||
this->Uic.Depends.clear();
|
||||
}
|
||||
|
||||
cmQtAutoMocUicT::ParseCacheT::GetOrInsertT
|
||||
@@ -617,15 +617,15 @@ cmQtAutoMocUicT::ParseCacheT::GetOrInsert(std::string const& fileName)
|
||||
{
|
||||
// Find existing entry
|
||||
{
|
||||
auto it = Map_.find(fileName);
|
||||
if (it != Map_.end()) {
|
||||
auto it = this->Map_.find(fileName);
|
||||
if (it != this->Map_.end()) {
|
||||
return GetOrInsertT{ it->second, false };
|
||||
}
|
||||
}
|
||||
|
||||
// Insert new entry
|
||||
return GetOrInsertT{
|
||||
Map_.emplace(fileName, std::make_shared<FileT>()).first->second, true
|
||||
this->Map_.emplace(fileName, std::make_shared<FileT>()).first->second, true
|
||||
};
|
||||
}
|
||||
|
||||
@@ -655,7 +655,7 @@ bool cmQtAutoMocUicT::ParseCacheT::ReadFromFile(std::string const& fileName)
|
||||
}
|
||||
// Check if this a file name line
|
||||
if (line.front() != ' ') {
|
||||
fileHandle = GetOrInsert(line).first;
|
||||
fileHandle = this->GetOrInsert(line).first;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -702,7 +702,7 @@ bool cmQtAutoMocUicT::ParseCacheT::WriteToFile(std::string const& fileName)
|
||||
return false;
|
||||
}
|
||||
ofs << "# Generated by CMake. Changes will be overwritten.\n";
|
||||
for (auto const& pair : Map_) {
|
||||
for (auto const& pair : this->Map_) {
|
||||
ofs << pair.first << '\n';
|
||||
FileT const& file = *pair.second;
|
||||
if (!file.Moc.Macro.empty()) {
|
||||
@@ -732,7 +732,7 @@ cmQtAutoMocUicT::BaseSettingsT::~BaseSettingsT() = default;
|
||||
|
||||
cmQtAutoMocUicT::MocSettingsT::MocSettingsT()
|
||||
{
|
||||
RegExpInclude.compile(
|
||||
this->RegExpInclude.compile(
|
||||
"(^|\n)[ \t]*#[ \t]*include[ \t]+"
|
||||
"[\"<](([^ \">]+/)?moc_[^ \">/]+\\.cpp|[^ \">]+\\.moc)[\">]");
|
||||
}
|
||||
@@ -741,14 +741,15 @@ cmQtAutoMocUicT::MocSettingsT::~MocSettingsT() = default;
|
||||
|
||||
bool cmQtAutoMocUicT::MocSettingsT::skipped(std::string const& fileName) const
|
||||
{
|
||||
return (!Enabled || (SkipList.find(fileName) != SkipList.end()));
|
||||
return (!this->Enabled ||
|
||||
(this->SkipList.find(fileName) != this->SkipList.end()));
|
||||
}
|
||||
|
||||
std::string cmQtAutoMocUicT::MocSettingsT::MacrosString() const
|
||||
{
|
||||
std::string res;
|
||||
const auto itB = MacroFilters.cbegin();
|
||||
const auto itE = MacroFilters.cend();
|
||||
const auto itB = this->MacroFilters.cbegin();
|
||||
const auto itE = this->MacroFilters.cend();
|
||||
const auto itL = itE - 1;
|
||||
auto itC = itB;
|
||||
for (; itC != itE; ++itC) {
|
||||
@@ -768,30 +769,31 @@ std::string cmQtAutoMocUicT::MocSettingsT::MacrosString() const
|
||||
|
||||
cmQtAutoMocUicT::UicSettingsT::UicSettingsT()
|
||||
{
|
||||
RegExpInclude.compile("(^|\n)[ \t]*#[ \t]*include[ \t]+"
|
||||
"[\"<](([^ \">]+/)?ui_[^ \">/]+\\.h)[\">]");
|
||||
this->RegExpInclude.compile("(^|\n)[ \t]*#[ \t]*include[ \t]+"
|
||||
"[\"<](([^ \">]+/)?ui_[^ \">/]+\\.h)[\">]");
|
||||
}
|
||||
|
||||
cmQtAutoMocUicT::UicSettingsT::~UicSettingsT() = default;
|
||||
|
||||
bool cmQtAutoMocUicT::UicSettingsT::skipped(std::string const& fileName) const
|
||||
{
|
||||
return (!Enabled || (SkipList.find(fileName) != SkipList.end()));
|
||||
return (!this->Enabled ||
|
||||
(this->SkipList.find(fileName) != this->SkipList.end()));
|
||||
}
|
||||
|
||||
void cmQtAutoMocUicT::JobT::LogError(GenT genType,
|
||||
cm::string_view message) const
|
||||
{
|
||||
Gen()->AbortError();
|
||||
Gen()->Log().Error(genType, message);
|
||||
this->Gen()->AbortError();
|
||||
this->Gen()->Log().Error(genType, message);
|
||||
}
|
||||
|
||||
void cmQtAutoMocUicT::JobT::LogCommandError(
|
||||
GenT genType, cm::string_view message,
|
||||
std::vector<std::string> const& command, std::string const& output) const
|
||||
{
|
||||
Gen()->AbortError();
|
||||
Gen()->Log().ErrorCommand(genType, message, command, output);
|
||||
this->Gen()->AbortError();
|
||||
this->Gen()->Log().ErrorCommand(genType, message, command, output);
|
||||
}
|
||||
|
||||
bool cmQtAutoMocUicT::JobT::RunProcess(GenT genType,
|
||||
@@ -800,48 +802,48 @@ bool cmQtAutoMocUicT::JobT::RunProcess(GenT genType,
|
||||
std::string* infoMessage)
|
||||
{
|
||||
// Log command
|
||||
if (Log().Verbose()) {
|
||||
if (this->Log().Verbose()) {
|
||||
cm::string_view info;
|
||||
if (infoMessage != nullptr) {
|
||||
info = *infoMessage;
|
||||
}
|
||||
Log().Info(genType,
|
||||
cmStrCat(info,
|
||||
info.empty() || cmHasSuffix(info, '\n') ? "" : "\n",
|
||||
QuotedCommand(command), '\n'));
|
||||
this->Log().Info(
|
||||
genType,
|
||||
cmStrCat(info, info.empty() || cmHasSuffix(info, '\n') ? "" : "\n",
|
||||
QuotedCommand(command), '\n'));
|
||||
}
|
||||
// Run command
|
||||
return cmWorkerPool::JobT::RunProcess(result, command,
|
||||
BaseConst().AutogenBuildDir);
|
||||
return this->cmWorkerPool::JobT::RunProcess(
|
||||
result, command, this->BaseConst().AutogenBuildDir);
|
||||
}
|
||||
|
||||
void cmQtAutoMocUicT::JobMocPredefsT::Process()
|
||||
{
|
||||
// (Re)generate moc_predefs.h on demand
|
||||
std::unique_ptr<std::string> reason;
|
||||
if (Log().Verbose()) {
|
||||
if (this->Log().Verbose()) {
|
||||
reason = cm::make_unique<std::string>();
|
||||
}
|
||||
if (!Update(reason.get())) {
|
||||
if (!this->Update(reason.get())) {
|
||||
return;
|
||||
}
|
||||
std::string const& predefsFileAbs = MocConst().PredefsFileAbs;
|
||||
std::string const& predefsFileAbs = this->MocConst().PredefsFileAbs;
|
||||
{
|
||||
cmWorkerPool::ProcessResultT result;
|
||||
{
|
||||
// Compose command
|
||||
std::vector<std::string> cmd = MocConst().PredefsCmd;
|
||||
std::vector<std::string> cmd = this->MocConst().PredefsCmd;
|
||||
// Add definitions
|
||||
cm::append(cmd, MocConst().OptionsDefinitions);
|
||||
cm::append(cmd, this->MocConst().OptionsDefinitions);
|
||||
// Add includes
|
||||
cm::append(cmd, MocConst().OptionsIncludes);
|
||||
cm::append(cmd, this->MocConst().OptionsIncludes);
|
||||
// Execute command
|
||||
if (!RunProcess(GenT::MOC, result, cmd, reason.get())) {
|
||||
LogCommandError(GenT::MOC,
|
||||
cmStrCat("The content generation command for ",
|
||||
MessagePath(predefsFileAbs), " failed.\n",
|
||||
result.ErrorMessage),
|
||||
cmd, result.StdOut);
|
||||
if (!this->RunProcess(GenT::MOC, result, cmd, reason.get())) {
|
||||
this->LogCommandError(GenT::MOC,
|
||||
cmStrCat("The content generation command for ",
|
||||
this->MessagePath(predefsFileAbs),
|
||||
" failed.\n", result.ErrorMessage),
|
||||
cmd, result.StdOut);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -849,30 +851,31 @@ void cmQtAutoMocUicT::JobMocPredefsT::Process()
|
||||
// (Re)write predefs file only on demand
|
||||
if (cmQtAutoGenerator::FileDiffers(predefsFileAbs, result.StdOut)) {
|
||||
if (!cmQtAutoGenerator::FileWrite(predefsFileAbs, result.StdOut)) {
|
||||
LogError(
|
||||
this->LogError(
|
||||
GenT::MOC,
|
||||
cmStrCat("Writing ", MessagePath(predefsFileAbs), " failed."));
|
||||
cmStrCat("Writing ", this->MessagePath(predefsFileAbs), " failed."));
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
// Touch to update the time stamp
|
||||
if (Log().Verbose()) {
|
||||
Log().Info(GenT::MOC, "Touching " + MessagePath(predefsFileAbs));
|
||||
if (this->Log().Verbose()) {
|
||||
this->Log().Info(GenT::MOC,
|
||||
"Touching " + this->MessagePath(predefsFileAbs));
|
||||
}
|
||||
if (!cmSystemTools::Touch(predefsFileAbs, false)) {
|
||||
LogError(
|
||||
GenT::MOC,
|
||||
cmStrCat("Touching ", MessagePath(predefsFileAbs), " failed."));
|
||||
this->LogError(GenT::MOC,
|
||||
cmStrCat("Touching ", this->MessagePath(predefsFileAbs),
|
||||
" failed."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Read file time afterwards
|
||||
if (!MocEval().PredefsTime.Load(predefsFileAbs)) {
|
||||
LogError(GenT::MOC,
|
||||
cmStrCat("Reading the file time of ", MessagePath(predefsFileAbs),
|
||||
" failed."));
|
||||
if (!this->MocEval().PredefsTime.Load(predefsFileAbs)) {
|
||||
this->LogError(GenT::MOC,
|
||||
cmStrCat("Reading the file time of ",
|
||||
this->MessagePath(predefsFileAbs), " failed."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -880,18 +883,20 @@ void cmQtAutoMocUicT::JobMocPredefsT::Process()
|
||||
bool cmQtAutoMocUicT::JobMocPredefsT::Update(std::string* reason) const
|
||||
{
|
||||
// Test if the file exists
|
||||
if (!MocEval().PredefsTime.Load(MocConst().PredefsFileAbs)) {
|
||||
if (!this->MocEval().PredefsTime.Load(this->MocConst().PredefsFileAbs)) {
|
||||
if (reason != nullptr) {
|
||||
*reason = cmStrCat("Generating ", MessagePath(MocConst().PredefsFileAbs),
|
||||
*reason = cmStrCat("Generating ",
|
||||
this->MessagePath(this->MocConst().PredefsFileAbs),
|
||||
", because it doesn't exist.");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Test if the settings changed
|
||||
if (MocConst().SettingsChanged) {
|
||||
if (this->MocConst().SettingsChanged) {
|
||||
if (reason != nullptr) {
|
||||
*reason = cmStrCat("Generating ", MessagePath(MocConst().PredefsFileAbs),
|
||||
*reason = cmStrCat("Generating ",
|
||||
this->MessagePath(this->MocConst().PredefsFileAbs),
|
||||
", because the moc settings changed.");
|
||||
}
|
||||
return true;
|
||||
@@ -899,14 +904,14 @@ bool cmQtAutoMocUicT::JobMocPredefsT::Update(std::string* reason) const
|
||||
|
||||
// Test if the executable is newer
|
||||
{
|
||||
std::string const& exec = MocConst().PredefsCmd.at(0);
|
||||
std::string const& exec = this->MocConst().PredefsCmd.at(0);
|
||||
cmFileTime execTime;
|
||||
if (execTime.Load(exec)) {
|
||||
if (MocEval().PredefsTime.Older(execTime)) {
|
||||
if (this->MocEval().PredefsTime.Older(execTime)) {
|
||||
if (reason != nullptr) {
|
||||
*reason =
|
||||
cmStrCat("Generating ", MessagePath(MocConst().PredefsFileAbs),
|
||||
" because it is older than ", MessagePath(exec), '.');
|
||||
*reason = cmStrCat(
|
||||
"Generating ", this->MessagePath(this->MocConst().PredefsFileAbs),
|
||||
" because it is older than ", this->MessagePath(exec), '.');
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -919,25 +924,27 @@ bool cmQtAutoMocUicT::JobMocPredefsT::Update(std::string* reason) const
|
||||
bool cmQtAutoMocUicT::JobParseT::ReadFile()
|
||||
{
|
||||
// Clear old parse information
|
||||
FileHandle->ParseData->Clear();
|
||||
std::string const& fileName = FileHandle->FileName;
|
||||
this->FileHandle->ParseData->Clear();
|
||||
std::string const& fileName = this->FileHandle->FileName;
|
||||
// Write info
|
||||
if (Log().Verbose()) {
|
||||
Log().Info(GenT::GEN, cmStrCat("Parsing ", MessagePath(fileName)));
|
||||
if (this->Log().Verbose()) {
|
||||
this->Log().Info(GenT::GEN,
|
||||
cmStrCat("Parsing ", this->MessagePath(fileName)));
|
||||
}
|
||||
// Read file content
|
||||
{
|
||||
std::string error;
|
||||
if (!cmQtAutoGenerator::FileRead(Content, fileName, &error)) {
|
||||
LogError(
|
||||
GenT::GEN,
|
||||
cmStrCat("Could not read ", MessagePath(fileName), ".\n", error));
|
||||
if (!cmQtAutoGenerator::FileRead(this->Content, fileName, &error)) {
|
||||
this->LogError(GenT::GEN,
|
||||
cmStrCat("Could not read ", this->MessagePath(fileName),
|
||||
".\n", error));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Warn if empty
|
||||
if (Content.empty()) {
|
||||
Log().Warning(GenT::GEN, cmStrCat(MessagePath(fileName), " is empty."));
|
||||
if (this->Content.empty()) {
|
||||
this->Log().Warning(GenT::GEN,
|
||||
cmStrCat(this->MessagePath(fileName), " is empty."));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -958,16 +965,16 @@ void cmQtAutoMocUicT::JobParseT::CreateKeys(
|
||||
|
||||
void cmQtAutoMocUicT::JobParseT::MocMacro()
|
||||
{
|
||||
for (KeyExpT const& filter : MocConst().MacroFilters) {
|
||||
for (KeyExpT const& filter : this->MocConst().MacroFilters) {
|
||||
// Run a simple find string check
|
||||
if (Content.find(filter.Key) == std::string::npos) {
|
||||
if (this->Content.find(filter.Key) == std::string::npos) {
|
||||
continue;
|
||||
}
|
||||
// Run the expensive regular expression check loop
|
||||
cmsys::RegularExpressionMatch match;
|
||||
if (filter.Exp.find(Content.c_str(), match)) {
|
||||
if (filter.Exp.find(this->Content.c_str(), match)) {
|
||||
// Keep detected macro name
|
||||
FileHandle->ParseData->Moc.Macro = filter.Key;
|
||||
this->FileHandle->ParseData->Moc.Macro = filter.Key;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -975,19 +982,20 @@ void cmQtAutoMocUicT::JobParseT::MocMacro()
|
||||
|
||||
void cmQtAutoMocUicT::JobParseT::MocDependecies()
|
||||
{
|
||||
if (MocConst().DependFilters.empty() || MocConst().CanOutputDependencies) {
|
||||
if (this->MocConst().DependFilters.empty() ||
|
||||
this->MocConst().CanOutputDependencies) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Find dependency strings
|
||||
std::set<std::string> parseDepends;
|
||||
for (KeyExpT const& filter : MocConst().DependFilters) {
|
||||
for (KeyExpT const& filter : this->MocConst().DependFilters) {
|
||||
// Run a simple find string check
|
||||
if (Content.find(filter.Key) == std::string::npos) {
|
||||
if (this->Content.find(filter.Key) == std::string::npos) {
|
||||
continue;
|
||||
}
|
||||
// Run the expensive regular expression check loop
|
||||
const char* contentChars = Content.c_str();
|
||||
const char* contentChars = this->Content.c_str();
|
||||
cmsys::RegularExpressionMatch match;
|
||||
while (filter.Exp.find(contentChars, match)) {
|
||||
{
|
||||
@@ -1002,7 +1010,7 @@ void cmQtAutoMocUicT::JobParseT::MocDependecies()
|
||||
|
||||
// Store dependency strings
|
||||
{
|
||||
auto& Depends = FileHandle->ParseData->Moc.Depends;
|
||||
auto& Depends = this->FileHandle->ParseData->Moc.Depends;
|
||||
Depends.reserve(parseDepends.size());
|
||||
for (std::string const& item : parseDepends) {
|
||||
Depends.emplace_back(item);
|
||||
@@ -1016,15 +1024,15 @@ void cmQtAutoMocUicT::JobParseT::MocDependecies()
|
||||
|
||||
void cmQtAutoMocUicT::JobParseT::MocIncludes()
|
||||
{
|
||||
if (Content.find("moc") == std::string::npos) {
|
||||
if (this->Content.find("moc") == std::string::npos) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::set<std::string> underscore;
|
||||
std::set<std::string> dot;
|
||||
{
|
||||
const char* contentChars = Content.c_str();
|
||||
cmsys::RegularExpression const& regExp = MocConst().RegExpInclude;
|
||||
const char* contentChars = this->Content.c_str();
|
||||
cmsys::RegularExpression const& regExp = this->MocConst().RegExpInclude;
|
||||
cmsys::RegularExpressionMatch match;
|
||||
while (regExp.find(contentChars, match)) {
|
||||
std::string incString = match.match(2);
|
||||
@@ -1042,21 +1050,21 @@ void cmQtAutoMocUicT::JobParseT::MocIncludes()
|
||||
contentChars += match.end();
|
||||
}
|
||||
}
|
||||
auto& Include = FileHandle->ParseData->Moc.Include;
|
||||
CreateKeys(Include.Underscore, underscore, MocUnderscoreLength);
|
||||
CreateKeys(Include.Dot, dot, 0);
|
||||
auto& Include = this->FileHandle->ParseData->Moc.Include;
|
||||
this->CreateKeys(Include.Underscore, underscore, MocUnderscoreLength);
|
||||
this->CreateKeys(Include.Dot, dot, 0);
|
||||
}
|
||||
|
||||
void cmQtAutoMocUicT::JobParseT::UicIncludes()
|
||||
{
|
||||
if (Content.find("ui_") == std::string::npos) {
|
||||
if (this->Content.find("ui_") == std::string::npos) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::set<std::string> includes;
|
||||
{
|
||||
const char* contentChars = Content.c_str();
|
||||
cmsys::RegularExpression const& regExp = UicConst().RegExpInclude;
|
||||
const char* contentChars = this->Content.c_str();
|
||||
cmsys::RegularExpression const& regExp = this->UicConst().RegExpInclude;
|
||||
cmsys::RegularExpressionMatch match;
|
||||
while (regExp.find(contentChars, match)) {
|
||||
includes.emplace(match.match(2));
|
||||
@@ -1064,39 +1072,40 @@ void cmQtAutoMocUicT::JobParseT::UicIncludes()
|
||||
contentChars += match.end();
|
||||
}
|
||||
}
|
||||
CreateKeys(FileHandle->ParseData->Uic.Include, includes, UiUnderscoreLength);
|
||||
this->CreateKeys(this->FileHandle->ParseData->Uic.Include, includes,
|
||||
UiUnderscoreLength);
|
||||
}
|
||||
|
||||
void cmQtAutoMocUicT::JobParseHeaderT::Process()
|
||||
{
|
||||
if (!ReadFile()) {
|
||||
if (!this->ReadFile()) {
|
||||
return;
|
||||
}
|
||||
// Moc parsing
|
||||
if (FileHandle->Moc) {
|
||||
MocMacro();
|
||||
MocDependecies();
|
||||
if (this->FileHandle->Moc) {
|
||||
this->MocMacro();
|
||||
this->MocDependecies();
|
||||
}
|
||||
// Uic parsing
|
||||
if (FileHandle->Uic) {
|
||||
UicIncludes();
|
||||
if (this->FileHandle->Uic) {
|
||||
this->UicIncludes();
|
||||
}
|
||||
}
|
||||
|
||||
void cmQtAutoMocUicT::JobParseSourceT::Process()
|
||||
{
|
||||
if (!ReadFile()) {
|
||||
if (!this->ReadFile()) {
|
||||
return;
|
||||
}
|
||||
// Moc parsing
|
||||
if (FileHandle->Moc) {
|
||||
MocMacro();
|
||||
MocDependecies();
|
||||
MocIncludes();
|
||||
if (this->FileHandle->Moc) {
|
||||
this->MocMacro();
|
||||
this->MocDependecies();
|
||||
this->MocIncludes();
|
||||
}
|
||||
// Uic parsing
|
||||
if (FileHandle->Uic) {
|
||||
UicIncludes();
|
||||
if (this->FileHandle->Uic) {
|
||||
this->UicIncludes();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1104,9 +1113,9 @@ std::string cmQtAutoMocUicT::JobEvalCacheT::MessageSearchLocations() const
|
||||
{
|
||||
std::string res;
|
||||
res.reserve(512);
|
||||
for (std::string const& path : SearchLocations) {
|
||||
for (std::string const& path : this->SearchLocations) {
|
||||
res += " ";
|
||||
res += MessagePath(path);
|
||||
res += this->MessagePath(path);
|
||||
res += '\n';
|
||||
}
|
||||
return res;
|
||||
@@ -1115,14 +1124,14 @@ std::string cmQtAutoMocUicT::JobEvalCacheT::MessageSearchLocations() const
|
||||
void cmQtAutoMocUicT::JobEvalCacheMocT::Process()
|
||||
{
|
||||
// Evaluate headers
|
||||
for (auto const& pair : BaseEval().Headers) {
|
||||
if (!EvalHeader(pair.second)) {
|
||||
for (auto const& pair : this->BaseEval().Headers) {
|
||||
if (!this->EvalHeader(pair.second)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
// Evaluate sources
|
||||
for (auto const& pair : BaseEval().Sources) {
|
||||
if (!EvalSource(pair.second)) {
|
||||
for (auto const& pair : this->BaseEval().Sources) {
|
||||
if (!this->EvalSource(pair.second)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1142,14 +1151,16 @@ bool cmQtAutoMocUicT::JobEvalCacheMocT::EvalHeader(SourceFileHandleT source)
|
||||
handle->SourceFile = std::move(source);
|
||||
|
||||
// Absolute build path
|
||||
if (BaseConst().MultiConfig) {
|
||||
handle->OutputFile = Gen()->AbsoluteIncludePath(sourceFile.BuildPath);
|
||||
if (this->BaseConst().MultiConfig) {
|
||||
handle->OutputFile =
|
||||
this->Gen()->AbsoluteIncludePath(sourceFile.BuildPath);
|
||||
} else {
|
||||
handle->OutputFile = Gen()->AbsoluteBuildPath(sourceFile.BuildPath);
|
||||
handle->OutputFile =
|
||||
this->Gen()->AbsoluteBuildPath(sourceFile.BuildPath);
|
||||
}
|
||||
|
||||
// Register mapping in headers map
|
||||
RegisterMapping(handle);
|
||||
this->RegisterMapping(handle);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -1171,7 +1182,7 @@ bool cmQtAutoMocUicT::JobEvalCacheMocT::EvalSource(
|
||||
cmSystemTools::GetFilenameWithoutLastExtension(sourceFile.FileName);
|
||||
|
||||
// For relaxed mode check if the own "moc_" or ".moc" file is included
|
||||
bool const relaxedMode = MocConst().RelaxedMode;
|
||||
bool const relaxedMode = this->MocConst().RelaxedMode;
|
||||
bool sourceIncludesMocUnderscore = false;
|
||||
bool sourceIncludesDotMoc = false;
|
||||
// Check if the sources own "moc_" or ".moc" file is included
|
||||
@@ -1193,12 +1204,13 @@ bool cmQtAutoMocUicT::JobEvalCacheMocT::EvalSource(
|
||||
// Check if this source needs to be moc processed but doesn't.
|
||||
if (!sourceIncludesDotMoc && !parseData.Macro.empty() &&
|
||||
!(relaxedMode && sourceIncludesMocUnderscore)) {
|
||||
LogError(GenT::MOC,
|
||||
cmStrCat(MessagePath(sourceFile.FileName), "\ncontains a ",
|
||||
Quoted(parseData.Macro), " macro, but does not include ",
|
||||
MessagePath(sourceBase + ".moc"),
|
||||
"!\nConsider to\n - add #include \"", sourceBase,
|
||||
".moc\"\n - enable SKIP_AUTOMOC for this file"));
|
||||
this->LogError(GenT::MOC,
|
||||
cmStrCat(this->MessagePath(sourceFile.FileName),
|
||||
"\ncontains a ", Quoted(parseData.Macro),
|
||||
" macro, but does not include ",
|
||||
this->MessagePath(sourceBase + ".moc"),
|
||||
"!\nConsider to\n - add #include \"", sourceBase,
|
||||
".moc\"\n - enable SKIP_AUTOMOC for this file"));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1207,14 +1219,16 @@ bool cmQtAutoMocUicT::JobEvalCacheMocT::EvalSource(
|
||||
SourceFileHandleT headerHandle;
|
||||
{
|
||||
std::string const headerBase = cmStrCat(incKey.Dir, incKey.Base);
|
||||
if (!FindIncludedHeader(headerHandle, sourceDirPrefix, headerBase)) {
|
||||
LogError(GenT::MOC,
|
||||
cmStrCat(MessagePath(sourceFile.FileName),
|
||||
"\nincludes the moc file ", MessagePath(incKey.Key),
|
||||
",\nbut a header ", MessageHeader(headerBase),
|
||||
"\ncould not be found "
|
||||
"in the following directories\n",
|
||||
MessageSearchLocations()));
|
||||
if (!this->FindIncludedHeader(headerHandle, sourceDirPrefix,
|
||||
headerBase)) {
|
||||
this->LogError(
|
||||
GenT::MOC,
|
||||
cmStrCat(this->MessagePath(sourceFile.FileName),
|
||||
"\nincludes the moc file ", this->MessagePath(incKey.Key),
|
||||
",\nbut a header ", this->MessageHeader(headerBase),
|
||||
"\ncould not be found "
|
||||
"in the following directories\n",
|
||||
this->MessageSearchLocations()));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1228,30 +1242,31 @@ bool cmQtAutoMocUicT::JobEvalCacheMocT::EvalSource(
|
||||
// used. This is for KDE4 compatibility.
|
||||
|
||||
// Issue a warning
|
||||
Log().Warning(
|
||||
this->Log().Warning(
|
||||
GenT::MOC,
|
||||
cmStrCat(MessagePath(sourceFile.FileName), "\ncontains a ",
|
||||
cmStrCat(this->MessagePath(sourceFile.FileName), "\ncontains a ",
|
||||
Quoted(parseData.Macro), " macro, but does not include ",
|
||||
MessagePath(sourceBase + ".moc"), ".\nInstead it includes ",
|
||||
MessagePath(incKey.Key), ".\nRunning moc on the source\n ",
|
||||
MessagePath(sourceFile.FileName), "!\nBetter include ",
|
||||
MessagePath(sourceBase + ".moc"),
|
||||
this->MessagePath(sourceBase + ".moc"),
|
||||
".\nInstead it includes ", this->MessagePath(incKey.Key),
|
||||
".\nRunning moc on the source\n ",
|
||||
this->MessagePath(sourceFile.FileName), "!\nBetter include ",
|
||||
this->MessagePath(sourceBase + ".moc"),
|
||||
" for compatibility with regular mode.\n",
|
||||
"This is a CMAKE_AUTOMOC_RELAXED_MODE warning.\n"));
|
||||
|
||||
// Create mapping
|
||||
if (!RegisterIncluded(incKey.Key, source, source)) {
|
||||
if (!this->RegisterIncluded(incKey.Key, source, source)) {
|
||||
return false;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check if header is skipped
|
||||
if (MocConst().skipped(headerHandle->FileName)) {
|
||||
if (this->MocConst().skipped(headerHandle->FileName)) {
|
||||
continue;
|
||||
}
|
||||
// Create mapping
|
||||
if (!RegisterIncluded(incKey.Key, source, std::move(headerHandle))) {
|
||||
if (!this->RegisterIncluded(incKey.Key, source, std::move(headerHandle))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1264,7 +1279,7 @@ bool cmQtAutoMocUicT::JobEvalCacheMocT::EvalSource(
|
||||
bool const ownMoc = (incKey.Base == sourceBase);
|
||||
if (ownMoc && !parseData.Macro.empty()) {
|
||||
// Create mapping for the regular use case
|
||||
if (!RegisterIncluded(incKey.Key, source, source)) {
|
||||
if (!this->RegisterIncluded(incKey.Key, source, source)) {
|
||||
return false;
|
||||
}
|
||||
continue;
|
||||
@@ -1274,50 +1289,54 @@ bool cmQtAutoMocUicT::JobEvalCacheMocT::EvalSource(
|
||||
SourceFileHandleT headerHandle;
|
||||
{
|
||||
std::string const headerBase = cmStrCat(incKey.Dir, incKey.Base);
|
||||
if (!FindIncludedHeader(headerHandle, sourceDirPrefix, headerBase)) {
|
||||
LogError(
|
||||
if (!this->FindIncludedHeader(headerHandle, sourceDirPrefix,
|
||||
headerBase)) {
|
||||
this->LogError(
|
||||
GenT::MOC,
|
||||
cmStrCat(
|
||||
MessagePath(sourceFile.FileName), "\nincludes the moc file ",
|
||||
MessagePath(incKey.Key),
|
||||
this->MessagePath(sourceFile.FileName),
|
||||
"\nincludes the moc file ", this->MessagePath(incKey.Key),
|
||||
",\nwhich seems to be the moc file from a different source "
|
||||
"file.\nCMAKE_AUTOMOC_RELAXED_MODE:\nAlso a matching header ",
|
||||
MessageHeader(headerBase),
|
||||
this->MessageHeader(headerBase),
|
||||
"\ncould not be found in the following directories\n",
|
||||
MessageSearchLocations()));
|
||||
this->MessageSearchLocations()));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Check if header is skipped
|
||||
if (MocConst().skipped(headerHandle->FileName)) {
|
||||
if (this->MocConst().skipped(headerHandle->FileName)) {
|
||||
continue;
|
||||
}
|
||||
// Issue a warning
|
||||
if (ownMoc && parseData.Macro.empty()) {
|
||||
Log().Warning(
|
||||
this->Log().Warning(
|
||||
GenT::MOC,
|
||||
cmStrCat(MessagePath(sourceFile.FileName),
|
||||
"\nincludes the moc file ", MessagePath(incKey.Key),
|
||||
", but does not contain a\n", MocConst().MacrosString(),
|
||||
" macro.\nRunning moc on the header\n ",
|
||||
MessagePath(headerHandle->FileName), "!\nBetter include ",
|
||||
MessagePath("moc_" + incKey.Base + ".cpp"),
|
||||
" for a compatibility with regular mode.\n",
|
||||
"This is a CMAKE_AUTOMOC_RELAXED_MODE warning.\n"));
|
||||
cmStrCat(
|
||||
this->MessagePath(sourceFile.FileName), "\nincludes the moc file ",
|
||||
this->MessagePath(incKey.Key), ", but does not contain a\n",
|
||||
this->MocConst().MacrosString(),
|
||||
" macro.\nRunning moc on the header\n ",
|
||||
this->MessagePath(headerHandle->FileName), "!\nBetter include ",
|
||||
this->MessagePath("moc_" + incKey.Base + ".cpp"),
|
||||
" for a compatibility with regular mode.\n",
|
||||
"This is a CMAKE_AUTOMOC_RELAXED_MODE warning.\n"));
|
||||
} else {
|
||||
Log().Warning(
|
||||
this->Log().Warning(
|
||||
GenT::MOC,
|
||||
cmStrCat(MessagePath(sourceFile.FileName),
|
||||
"\nincludes the moc file ", MessagePath(incKey.Key),
|
||||
" instead of ", MessagePath("moc_" + incKey.Base + ".cpp"),
|
||||
".\nRunning moc on the header\n ",
|
||||
MessagePath(headerHandle->FileName), "!\nBetter include ",
|
||||
MessagePath("moc_" + incKey.Base + ".cpp"),
|
||||
" for compatibility with regular mode.\n",
|
||||
"This is a CMAKE_AUTOMOC_RELAXED_MODE warning.\n"));
|
||||
cmStrCat(
|
||||
this->MessagePath(sourceFile.FileName), "\nincludes the moc file ",
|
||||
this->MessagePath(incKey.Key), " instead of ",
|
||||
this->MessagePath("moc_" + incKey.Base + ".cpp"),
|
||||
".\nRunning moc on the header\n ",
|
||||
this->MessagePath(headerHandle->FileName), "!\nBetter include ",
|
||||
this->MessagePath("moc_" + incKey.Base + ".cpp"),
|
||||
" for compatibility with regular mode.\n",
|
||||
"This is a CMAKE_AUTOMOC_RELAXED_MODE warning.\n"));
|
||||
}
|
||||
// Create mapping
|
||||
if (!RegisterIncluded(incKey.Key, source, std::move(headerHandle))) {
|
||||
if (!this->RegisterIncluded(incKey.Key, source,
|
||||
std::move(headerHandle))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1328,26 +1347,27 @@ bool cmQtAutoMocUicT::JobEvalCacheMocT::EvalSource(
|
||||
bool const ownMoc = (incKey.Base == sourceBase);
|
||||
if (!ownMoc) {
|
||||
// Don't allow <BASE>.moc include other than own in regular mode
|
||||
LogError(GenT::MOC,
|
||||
cmStrCat(MessagePath(sourceFile.FileName),
|
||||
"\nincludes the moc file ", MessagePath(incKey.Key),
|
||||
",\nwhich seems to be the moc file from a different "
|
||||
"source file.\nThis is not supported. Include ",
|
||||
MessagePath(sourceBase + ".moc"),
|
||||
" to run moc on this source file."));
|
||||
this->LogError(
|
||||
GenT::MOC,
|
||||
cmStrCat(this->MessagePath(sourceFile.FileName),
|
||||
"\nincludes the moc file ", this->MessagePath(incKey.Key),
|
||||
",\nwhich seems to be the moc file from a different "
|
||||
"source file.\nThis is not supported. Include ",
|
||||
this->MessagePath(sourceBase + ".moc"),
|
||||
" to run moc on this source file."));
|
||||
return false;
|
||||
}
|
||||
// Accept but issue a warning if moc isn't required
|
||||
if (parseData.Macro.empty()) {
|
||||
Log().Warning(GenT::MOC,
|
||||
cmStrCat(MessagePath(sourceFile.FileName),
|
||||
"\nincludes the moc file ",
|
||||
MessagePath(incKey.Key),
|
||||
", but does not contain a ",
|
||||
MocConst().MacrosString(), " macro."));
|
||||
this->Log().Warning(
|
||||
GenT::MOC,
|
||||
cmStrCat(this->MessagePath(sourceFile.FileName),
|
||||
"\nincludes the moc file ", this->MessagePath(incKey.Key),
|
||||
", but does not contain a ",
|
||||
this->MocConst().MacrosString(), " macro."));
|
||||
}
|
||||
// Create mapping
|
||||
if (!RegisterIncluded(incKey.Key, source, source)) {
|
||||
if (!this->RegisterIncluded(incKey.Key, source, source)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1361,7 +1381,7 @@ bool cmQtAutoMocUicT::JobEvalCacheMocT::FindIncludedHeader(
|
||||
cm::string_view includeBase)
|
||||
{
|
||||
// Clear search locations
|
||||
SearchLocations.clear();
|
||||
this->SearchLocations.clear();
|
||||
|
||||
auto findHeader = [this,
|
||||
&headerHandle](std::string const& basePath) -> bool {
|
||||
@@ -1377,8 +1397,8 @@ bool cmQtAutoMocUicT::JobEvalCacheMocT::FindIncludedHeader(
|
||||
|
||||
// Return a known file if it exists already
|
||||
{
|
||||
auto it = BaseEval().Headers.find(testPath);
|
||||
if (it != BaseEval().Headers.end()) {
|
||||
auto it = this->BaseEval().Headers.find(testPath);
|
||||
if (it != this->BaseEval().Headers.end()) {
|
||||
headerHandle = it->second;
|
||||
found = true;
|
||||
break;
|
||||
@@ -1387,7 +1407,8 @@ bool cmQtAutoMocUicT::JobEvalCacheMocT::FindIncludedHeader(
|
||||
|
||||
// Created and return discovered file entry
|
||||
{
|
||||
SourceFileHandleT& handle = MocEval().HeadersDiscovered[testPath];
|
||||
SourceFileHandleT& handle =
|
||||
this->MocEval().HeadersDiscovered[testPath];
|
||||
if (!handle) {
|
||||
handle = std::make_shared<SourceFileT>(testPath);
|
||||
handle->FileTime = fileTime;
|
||||
@@ -1410,7 +1431,7 @@ bool cmQtAutoMocUicT::JobEvalCacheMocT::FindIncludedHeader(
|
||||
return true;
|
||||
}
|
||||
// Search in include directories
|
||||
for (std::string const& path : MocConst().IncludePaths) {
|
||||
for (std::string const& path : this->MocConst().IncludePaths) {
|
||||
if (findHeader(cmStrCat(path, '/', includeBase))) {
|
||||
return true;
|
||||
}
|
||||
@@ -1424,24 +1445,24 @@ bool cmQtAutoMocUicT::JobEvalCacheMocT::RegisterIncluded(
|
||||
SourceFileHandleT sourceFileHandle) const
|
||||
{
|
||||
// Check if this file is already included
|
||||
MappingHandleT& handle = MocEval().Includes[includeString];
|
||||
MappingHandleT& handle = this->MocEval().Includes[includeString];
|
||||
if (handle) {
|
||||
// Check if the output file would be generated from different source files
|
||||
if (handle->SourceFile != sourceFileHandle) {
|
||||
std::string files =
|
||||
cmStrCat(" ", MessagePath(includerFileHandle->FileName), '\n');
|
||||
cmStrCat(" ", this->MessagePath(includerFileHandle->FileName), '\n');
|
||||
for (auto const& item : handle->IncluderFiles) {
|
||||
files += cmStrCat(" ", MessagePath(item->FileName), '\n');
|
||||
files += cmStrCat(" ", this->MessagePath(item->FileName), '\n');
|
||||
}
|
||||
LogError(
|
||||
this->LogError(
|
||||
GenT::MOC,
|
||||
cmStrCat("The source files\n", files,
|
||||
"contain the same include string ",
|
||||
MessagePath(includeString),
|
||||
this->MessagePath(includeString),
|
||||
", but\nthe moc file would be generated from different "
|
||||
"source files\n ",
|
||||
MessagePath(sourceFileHandle->FileName), " and\n ",
|
||||
MessagePath(handle->SourceFile->FileName),
|
||||
this->MessagePath(sourceFileHandle->FileName), " and\n ",
|
||||
this->MessagePath(handle->SourceFile->FileName),
|
||||
".\nConsider to\n"
|
||||
" - not include the \"moc_<NAME>.cpp\" file\n"
|
||||
" - add a directory prefix to a \"<NAME>.moc\" include "
|
||||
@@ -1460,10 +1481,10 @@ bool cmQtAutoMocUicT::JobEvalCacheMocT::RegisterIncluded(
|
||||
handle->IncludeString = includeString;
|
||||
handle->IncluderFiles.emplace_back(std::move(includerFileHandle));
|
||||
handle->SourceFile = std::move(sourceFileHandle);
|
||||
handle->OutputFile = Gen()->AbsoluteIncludePath(includeString);
|
||||
handle->OutputFile = this->Gen()->AbsoluteIncludePath(includeString);
|
||||
|
||||
// Register mapping in sources/headers map
|
||||
RegisterMapping(handle);
|
||||
this->RegisterMapping(handle);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1471,8 +1492,8 @@ void cmQtAutoMocUicT::JobEvalCacheMocT::RegisterMapping(
|
||||
MappingHandleT mappingHandle) const
|
||||
{
|
||||
auto& regMap = mappingHandle->SourceFile->IsHeader
|
||||
? MocEval().HeaderMappings
|
||||
: MocEval().SourceMappings;
|
||||
? this->MocEval().HeaderMappings
|
||||
: this->MocEval().SourceMappings;
|
||||
// Check if source file already gets mapped
|
||||
auto& regHandle = regMap[mappingHandle->SourceFile->FileName];
|
||||
if (!regHandle) {
|
||||
@@ -1489,24 +1510,24 @@ void cmQtAutoMocUicT::JobEvalCacheMocT::RegisterMapping(
|
||||
std::string cmQtAutoMocUicT::JobEvalCacheMocT::MessageHeader(
|
||||
cm::string_view headerBase) const
|
||||
{
|
||||
return MessagePath(cmStrCat(
|
||||
return this->MessagePath(cmStrCat(
|
||||
headerBase, ".{", cmJoin(this->BaseConst().HeaderExtensions, ","), '}'));
|
||||
}
|
||||
|
||||
void cmQtAutoMocUicT::JobEvalCacheUicT::Process()
|
||||
{
|
||||
// Prepare buffers
|
||||
SearchLocations.reserve((UicConst().SearchPaths.size() + 1) * 2);
|
||||
this->SearchLocations.reserve((this->UicConst().SearchPaths.size() + 1) * 2);
|
||||
|
||||
// Evaluate headers
|
||||
for (auto const& pair : BaseEval().Headers) {
|
||||
if (!EvalFile(pair.second)) {
|
||||
for (auto const& pair : this->BaseEval().Headers) {
|
||||
if (!this->EvalFile(pair.second)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
// Evaluate sources
|
||||
for (auto const& pair : BaseEval().Sources) {
|
||||
if (!EvalFile(pair.second)) {
|
||||
for (auto const& pair : this->BaseEval().Sources) {
|
||||
if (!this->EvalFile(pair.second)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1524,22 +1545,24 @@ bool cmQtAutoMocUicT::JobEvalCacheUicT::EvalFile(
|
||||
std::string const sourceDirPrefix = SubDirPrefix(sourceFile.FileName);
|
||||
for (IncludeKeyT const& incKey : Include) {
|
||||
// Find .ui file
|
||||
UiName = cmStrCat(incKey.Base, ".ui");
|
||||
if (!FindIncludedUi(sourceDirPrefix, incKey.Dir)) {
|
||||
LogError(GenT::UIC,
|
||||
cmStrCat(MessagePath(sourceFile.FileName),
|
||||
"\nincludes the uic file ", MessagePath(incKey.Key),
|
||||
",\nbut the user interface file ", MessagePath(UiName),
|
||||
"\ncould not be found in the following directories\n",
|
||||
MessageSearchLocations()));
|
||||
this->UiName = cmStrCat(incKey.Base, ".ui");
|
||||
if (!this->FindIncludedUi(sourceDirPrefix, incKey.Dir)) {
|
||||
this->LogError(
|
||||
GenT::UIC,
|
||||
cmStrCat(this->MessagePath(sourceFile.FileName),
|
||||
"\nincludes the uic file ", this->MessagePath(incKey.Key),
|
||||
",\nbut the user interface file ",
|
||||
this->MessagePath(this->UiName),
|
||||
"\ncould not be found in the following directories\n",
|
||||
this->MessageSearchLocations()));
|
||||
return false;
|
||||
}
|
||||
// Check if the file is skipped
|
||||
if (UicConst().skipped(UiFileHandle->FileName)) {
|
||||
if (this->UicConst().skipped(this->UiFileHandle->FileName)) {
|
||||
continue;
|
||||
}
|
||||
// Register mapping
|
||||
if (!RegisterMapping(incKey.Key, sourceFileHandle)) {
|
||||
if (!this->RegisterMapping(incKey.Key, sourceFileHandle)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1551,7 +1574,7 @@ bool cmQtAutoMocUicT::JobEvalCacheUicT::FindIncludedUi(
|
||||
cm::string_view sourceDirPrefix, cm::string_view includePrefix)
|
||||
{
|
||||
// Clear locations buffer
|
||||
SearchLocations.clear();
|
||||
this->SearchLocations.clear();
|
||||
|
||||
auto findUi = [this](std::string const& testPath) -> bool {
|
||||
std::string const fullPath = this->Gen()->CollapseFullPathTS(testPath);
|
||||
@@ -1573,25 +1596,25 @@ bool cmQtAutoMocUicT::JobEvalCacheUicT::FindIncludedUi(
|
||||
};
|
||||
|
||||
// Vicinity of the source
|
||||
if (findUi(cmStrCat(sourceDirPrefix, UiName))) {
|
||||
if (findUi(cmStrCat(sourceDirPrefix, this->UiName))) {
|
||||
return true;
|
||||
}
|
||||
if (!includePrefix.empty()) {
|
||||
if (findUi(cmStrCat(sourceDirPrefix, includePrefix, UiName))) {
|
||||
if (findUi(cmStrCat(sourceDirPrefix, includePrefix, this->UiName))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// Additional AUTOUIC search paths
|
||||
auto const& searchPaths = UicConst().SearchPaths;
|
||||
auto const& searchPaths = this->UicConst().SearchPaths;
|
||||
if (!searchPaths.empty()) {
|
||||
for (std::string const& sPath : searchPaths) {
|
||||
if (findUi(cmStrCat(sPath, '/', UiName))) {
|
||||
if (findUi(cmStrCat(sPath, '/', this->UiName))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (!includePrefix.empty()) {
|
||||
for (std::string const& sPath : searchPaths) {
|
||||
if (findUi(cmStrCat(sPath, '/', includePrefix, UiName))) {
|
||||
if (findUi(cmStrCat(sPath, '/', includePrefix, this->UiName))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1604,26 +1627,26 @@ bool cmQtAutoMocUicT::JobEvalCacheUicT::FindIncludedUi(
|
||||
bool cmQtAutoMocUicT::JobEvalCacheUicT::RegisterMapping(
|
||||
std::string const& includeString, SourceFileHandleT includerFileHandle)
|
||||
{
|
||||
auto& Includes = Gen()->UicEval().Includes;
|
||||
auto& Includes = this->Gen()->UicEval().Includes;
|
||||
auto it = Includes.find(includeString);
|
||||
if (it != Includes.end()) {
|
||||
MappingHandleT const& handle = it->second;
|
||||
if (handle->SourceFile != UiFileHandle) {
|
||||
if (handle->SourceFile != this->UiFileHandle) {
|
||||
// The output file already gets generated - from a different .ui file!
|
||||
std::string files =
|
||||
cmStrCat(" ", MessagePath(includerFileHandle->FileName), '\n');
|
||||
cmStrCat(" ", this->MessagePath(includerFileHandle->FileName), '\n');
|
||||
for (auto const& item : handle->IncluderFiles) {
|
||||
files += cmStrCat(" ", MessagePath(item->FileName), '\n');
|
||||
files += cmStrCat(" ", this->MessagePath(item->FileName), '\n');
|
||||
}
|
||||
LogError(
|
||||
this->LogError(
|
||||
GenT::UIC,
|
||||
cmStrCat(
|
||||
"The source files\n", files, "contain the same include string ",
|
||||
Quoted(includeString),
|
||||
", but\nthe uic file would be generated from different "
|
||||
"user interface files\n ",
|
||||
MessagePath(UiFileHandle->FileName), " and\n ",
|
||||
MessagePath(handle->SourceFile->FileName),
|
||||
this->MessagePath(this->UiFileHandle->FileName), " and\n ",
|
||||
this->MessagePath(handle->SourceFile->FileName),
|
||||
".\nConsider to\n"
|
||||
" - add a directory prefix to a \"ui_<NAME>.h\" include "
|
||||
"(e.g \"sub/ui_<NAME>.h\")\n"
|
||||
@@ -1638,8 +1661,8 @@ bool cmQtAutoMocUicT::JobEvalCacheUicT::RegisterMapping(
|
||||
MappingHandleT handle = std::make_shared<MappingT>();
|
||||
handle->IncludeString = includeString;
|
||||
handle->IncluderFiles.emplace_back(std::move(includerFileHandle));
|
||||
handle->SourceFile = UiFileHandle;
|
||||
handle->OutputFile = Gen()->AbsoluteIncludePath(includeString);
|
||||
handle->SourceFile = this->UiFileHandle;
|
||||
handle->OutputFile = this->Gen()->AbsoluteIncludePath(includeString);
|
||||
// Register mapping
|
||||
Includes.emplace(includeString, std::move(handle));
|
||||
}
|
||||
@@ -1649,40 +1672,42 @@ bool cmQtAutoMocUicT::JobEvalCacheUicT::RegisterMapping(
|
||||
void cmQtAutoMocUicT::JobEvalCacheFinishT::Process()
|
||||
{
|
||||
// Add discovered header parse jobs
|
||||
Gen()->CreateParseJobs<JobParseHeaderT>(MocEval().HeadersDiscovered);
|
||||
this->Gen()->CreateParseJobs<JobParseHeaderT>(
|
||||
this->MocEval().HeadersDiscovered);
|
||||
|
||||
// Add dependency probing jobs
|
||||
{
|
||||
// Add fence job to ensure all parsing has finished
|
||||
Gen()->WorkerPool().EmplaceJob<JobFenceT>();
|
||||
if (MocConst().Enabled) {
|
||||
Gen()->WorkerPool().EmplaceJob<JobProbeDepsMocT>();
|
||||
this->Gen()->WorkerPool().EmplaceJob<JobFenceT>();
|
||||
if (this->MocConst().Enabled) {
|
||||
this->Gen()->WorkerPool().EmplaceJob<JobProbeDepsMocT>();
|
||||
}
|
||||
if (UicConst().Enabled) {
|
||||
Gen()->WorkerPool().EmplaceJob<JobProbeDepsUicT>();
|
||||
if (this->UicConst().Enabled) {
|
||||
this->Gen()->WorkerPool().EmplaceJob<JobProbeDepsUicT>();
|
||||
}
|
||||
// Add probe finish job
|
||||
Gen()->WorkerPool().EmplaceJob<JobProbeDepsFinishT>();
|
||||
this->Gen()->WorkerPool().EmplaceJob<JobProbeDepsFinishT>();
|
||||
}
|
||||
}
|
||||
|
||||
void cmQtAutoMocUicT::JobProbeDepsMocT::Process()
|
||||
{
|
||||
// Create moc header jobs
|
||||
for (auto const& pair : MocEval().HeaderMappings) {
|
||||
for (auto const& pair : this->MocEval().HeaderMappings) {
|
||||
// Register if this mapping is a candidate for mocs_compilation.cpp
|
||||
bool const compFile = pair.second->IncludeString.empty();
|
||||
if (compFile) {
|
||||
MocEval().CompFiles.emplace_back(pair.second->SourceFile->BuildPath);
|
||||
this->MocEval().CompFiles.emplace_back(
|
||||
pair.second->SourceFile->BuildPath);
|
||||
}
|
||||
if (!Generate(pair.second, compFile)) {
|
||||
if (!this->Generate(pair.second, compFile)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Create moc source jobs
|
||||
for (auto const& pair : MocEval().SourceMappings) {
|
||||
if (!Generate(pair.second, false)) {
|
||||
for (auto const& pair : this->MocEval().SourceMappings) {
|
||||
if (!this->Generate(pair.second, false)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1692,22 +1717,23 @@ bool cmQtAutoMocUicT::JobProbeDepsMocT::Generate(MappingHandleT const& mapping,
|
||||
bool compFile) const
|
||||
{
|
||||
std::unique_ptr<std::string> reason;
|
||||
if (Log().Verbose()) {
|
||||
if (this->Log().Verbose()) {
|
||||
reason = cm::make_unique<std::string>();
|
||||
}
|
||||
if (Probe(*mapping, reason.get())) {
|
||||
if (this->Probe(*mapping, reason.get())) {
|
||||
// Register the parent directory for creation
|
||||
MocEval().OutputDirs.emplace(cmQtAutoGen::ParentDir(mapping->OutputFile));
|
||||
this->MocEval().OutputDirs.emplace(
|
||||
cmQtAutoGen::ParentDir(mapping->OutputFile));
|
||||
// Fetch the cache entry for the source file
|
||||
std::string const& sourceFile = mapping->SourceFile->FileName;
|
||||
ParseCacheT::GetOrInsertT cacheEntry =
|
||||
BaseEval().ParseCache.GetOrInsert(sourceFile);
|
||||
this->BaseEval().ParseCache.GetOrInsert(sourceFile);
|
||||
// Add moc job
|
||||
Gen()->WorkerPool().EmplaceJob<JobCompileMocT>(
|
||||
this->Gen()->WorkerPool().EmplaceJob<JobCompileMocT>(
|
||||
mapping, std::move(reason), std::move(cacheEntry.first));
|
||||
// Check if a moc job for a mocs_compilation.cpp entry was generated
|
||||
if (compFile) {
|
||||
MocEval().CompUpdated = true;
|
||||
this->MocEval().CompUpdated = true;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -1723,19 +1749,19 @@ bool cmQtAutoMocUicT::JobProbeDepsMocT::Probe(MappingT const& mapping,
|
||||
cmFileTime outputFileTime;
|
||||
if (!outputFileTime.Load(outputFile)) {
|
||||
if (reason != nullptr) {
|
||||
*reason =
|
||||
cmStrCat("Generating ", MessagePath(outputFile),
|
||||
", because it doesn't exist, from ", MessagePath(sourceFile));
|
||||
*reason = cmStrCat("Generating ", this->MessagePath(outputFile),
|
||||
", because it doesn't exist, from ",
|
||||
this->MessagePath(sourceFile));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Test if any setting changed
|
||||
if (MocConst().SettingsChanged) {
|
||||
if (this->MocConst().SettingsChanged) {
|
||||
if (reason != nullptr) {
|
||||
*reason = cmStrCat("Generating ", MessagePath(outputFile),
|
||||
*reason = cmStrCat("Generating ", this->MessagePath(outputFile),
|
||||
", because the uic settings changed, from ",
|
||||
MessagePath(sourceFile));
|
||||
this->MessagePath(sourceFile));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -1743,32 +1769,32 @@ bool cmQtAutoMocUicT::JobProbeDepsMocT::Probe(MappingT const& mapping,
|
||||
// Test if the source file is newer
|
||||
if (outputFileTime.Older(mapping.SourceFile->FileTime)) {
|
||||
if (reason != nullptr) {
|
||||
*reason = cmStrCat("Generating ", MessagePath(outputFile),
|
||||
*reason = cmStrCat("Generating ", this->MessagePath(outputFile),
|
||||
", because it's older than its source file, from ",
|
||||
MessagePath(sourceFile));
|
||||
this->MessagePath(sourceFile));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Test if the moc_predefs file is newer
|
||||
if (!MocConst().PredefsFileAbs.empty()) {
|
||||
if (outputFileTime.Older(MocEval().PredefsTime)) {
|
||||
if (!this->MocConst().PredefsFileAbs.empty()) {
|
||||
if (outputFileTime.Older(this->MocEval().PredefsTime)) {
|
||||
if (reason != nullptr) {
|
||||
*reason = cmStrCat("Generating ", MessagePath(outputFile),
|
||||
*reason = cmStrCat("Generating ", this->MessagePath(outputFile),
|
||||
", because it's older than ",
|
||||
MessagePath(MocConst().PredefsFileAbs), ", from ",
|
||||
MessagePath(sourceFile));
|
||||
this->MessagePath(this->MocConst().PredefsFileAbs),
|
||||
", from ", this->MessagePath(sourceFile));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Test if the moc executable is newer
|
||||
if (outputFileTime.Older(MocConst().ExecutableTime)) {
|
||||
if (outputFileTime.Older(this->MocConst().ExecutableTime)) {
|
||||
if (reason != nullptr) {
|
||||
*reason = cmStrCat("Generating ", MessagePath(outputFile),
|
||||
*reason = cmStrCat("Generating ", this->MessagePath(outputFile),
|
||||
", because it's older than the moc executable, from ",
|
||||
MessagePath(sourceFile));
|
||||
this->MessagePath(sourceFile));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -1782,26 +1808,26 @@ bool cmQtAutoMocUicT::JobProbeDepsMocT::Probe(MappingT const& mapping,
|
||||
auto& dep = *it;
|
||||
|
||||
// Find dependency file
|
||||
auto const depMatch = FindDependency(sourceDir, dep);
|
||||
auto const depMatch = this->FindDependency(sourceDir, dep);
|
||||
if (depMatch.first.empty()) {
|
||||
if (reason != nullptr) {
|
||||
*reason =
|
||||
cmStrCat("Generating ", MessagePath(outputFile), " from ",
|
||||
MessagePath(sourceFile), ", because its dependency ",
|
||||
MessagePath(dep), " vanished.");
|
||||
*reason = cmStrCat("Generating ", this->MessagePath(outputFile),
|
||||
" from ", this->MessagePath(sourceFile),
|
||||
", because its dependency ",
|
||||
this->MessagePath(dep), " vanished.");
|
||||
}
|
||||
dependencies.erase(it);
|
||||
BaseEval().ParseCacheChanged = true;
|
||||
this->BaseEval().ParseCacheChanged = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Test if dependency file is older
|
||||
if (outputFileTime.Older(depMatch.second)) {
|
||||
if (reason != nullptr) {
|
||||
*reason = cmStrCat("Generating ", MessagePath(outputFile),
|
||||
*reason = cmStrCat("Generating ", this->MessagePath(outputFile),
|
||||
", because it's older than its dependency file ",
|
||||
MessagePath(depMatch.first), ", from ",
|
||||
MessagePath(sourceFile));
|
||||
this->MessagePath(depMatch.first), ", from ",
|
||||
this->MessagePath(sourceFile));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -1817,7 +1843,7 @@ cmQtAutoMocUicT::JobProbeDepsMocT::FindDependency(
|
||||
{
|
||||
using ResPair = std::pair<std::string, cmFileTime>;
|
||||
// moc's dependency file contains absolute paths
|
||||
if (MocConst().CanOutputDependencies) {
|
||||
if (this->MocConst().CanOutputDependencies) {
|
||||
ResPair res{ includeString, {} };
|
||||
if (res.second.Load(res.first)) {
|
||||
return res;
|
||||
@@ -1832,7 +1858,7 @@ cmQtAutoMocUicT::JobProbeDepsMocT::FindDependency(
|
||||
}
|
||||
}
|
||||
// Search in include directories
|
||||
for (std::string const& includePath : MocConst().IncludePaths) {
|
||||
for (std::string const& includePath : this->MocConst().IncludePaths) {
|
||||
ResPair res{ cmStrCat(includePath, '/', includeString), {} };
|
||||
if (res.second.Load(res.first)) {
|
||||
return res;
|
||||
@@ -1844,20 +1870,22 @@ cmQtAutoMocUicT::JobProbeDepsMocT::FindDependency(
|
||||
|
||||
void cmQtAutoMocUicT::JobProbeDepsUicT::Process()
|
||||
{
|
||||
for (auto const& pair : Gen()->UicEval().Includes) {
|
||||
for (auto const& pair : this->Gen()->UicEval().Includes) {
|
||||
MappingHandleT const& mapping = pair.second;
|
||||
std::unique_ptr<std::string> reason;
|
||||
if (Log().Verbose()) {
|
||||
if (this->Log().Verbose()) {
|
||||
reason = cm::make_unique<std::string>();
|
||||
}
|
||||
if (!Probe(*mapping, reason.get())) {
|
||||
if (!this->Probe(*mapping, reason.get())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Register the parent directory for creation
|
||||
UicEval().OutputDirs.emplace(cmQtAutoGen::ParentDir(mapping->OutputFile));
|
||||
this->UicEval().OutputDirs.emplace(
|
||||
cmQtAutoGen::ParentDir(mapping->OutputFile));
|
||||
// Add uic job
|
||||
Gen()->WorkerPool().EmplaceJob<JobCompileUicT>(mapping, std::move(reason));
|
||||
this->Gen()->WorkerPool().EmplaceJob<JobCompileUicT>(mapping,
|
||||
std::move(reason));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1871,19 +1899,19 @@ bool cmQtAutoMocUicT::JobProbeDepsUicT::Probe(MappingT const& mapping,
|
||||
cmFileTime outputFileTime;
|
||||
if (!outputFileTime.Load(outputFile)) {
|
||||
if (reason != nullptr) {
|
||||
*reason =
|
||||
cmStrCat("Generating ", MessagePath(outputFile),
|
||||
", because it doesn't exist, from ", MessagePath(sourceFile));
|
||||
*reason = cmStrCat("Generating ", this->MessagePath(outputFile),
|
||||
", because it doesn't exist, from ",
|
||||
this->MessagePath(sourceFile));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Test if the uic settings changed
|
||||
if (UicConst().SettingsChanged) {
|
||||
if (this->UicConst().SettingsChanged) {
|
||||
if (reason != nullptr) {
|
||||
*reason = cmStrCat("Generating ", MessagePath(outputFile),
|
||||
*reason = cmStrCat("Generating ", this->MessagePath(outputFile),
|
||||
", because the uic settings changed, from ",
|
||||
MessagePath(sourceFile));
|
||||
this->MessagePath(sourceFile));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -1891,19 +1919,19 @@ bool cmQtAutoMocUicT::JobProbeDepsUicT::Probe(MappingT const& mapping,
|
||||
// Test if the source file is newer
|
||||
if (outputFileTime.Older(mapping.SourceFile->FileTime)) {
|
||||
if (reason != nullptr) {
|
||||
*reason = cmStrCat("Generating ", MessagePath(outputFile),
|
||||
*reason = cmStrCat("Generating ", this->MessagePath(outputFile),
|
||||
" because it's older than the source file ",
|
||||
MessagePath(sourceFile));
|
||||
this->MessagePath(sourceFile));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Test if the uic executable is newer
|
||||
if (outputFileTime.Older(UicConst().ExecutableTime)) {
|
||||
if (outputFileTime.Older(this->UicConst().ExecutableTime)) {
|
||||
if (reason != nullptr) {
|
||||
*reason = cmStrCat("Generating ", MessagePath(outputFile),
|
||||
*reason = cmStrCat("Generating ", this->MessagePath(outputFile),
|
||||
", because it's older than the uic executable, from ",
|
||||
MessagePath(sourceFile));
|
||||
this->MessagePath(sourceFile));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -1919,64 +1947,64 @@ void cmQtAutoMocUicT::JobProbeDepsFinishT::Process()
|
||||
auto createDirs = [this](GenT genType, StringSet const& dirSet) {
|
||||
for (std::string const& dirName : dirSet) {
|
||||
if (!cmSystemTools::MakeDirectory(dirName)) {
|
||||
this->LogError(
|
||||
genType,
|
||||
cmStrCat("Creating directory ", MessagePath(dirName), " failed."));
|
||||
this->LogError(genType,
|
||||
cmStrCat("Creating directory ",
|
||||
this->MessagePath(dirName), " failed."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
if (MocConst().Enabled && UicConst().Enabled) {
|
||||
StringSet outputDirs = MocEval().OutputDirs;
|
||||
outputDirs.insert(UicEval().OutputDirs.begin(),
|
||||
UicEval().OutputDirs.end());
|
||||
if (this->MocConst().Enabled && this->UicConst().Enabled) {
|
||||
StringSet outputDirs = this->MocEval().OutputDirs;
|
||||
outputDirs.insert(this->UicEval().OutputDirs.begin(),
|
||||
this->UicEval().OutputDirs.end());
|
||||
createDirs(GenT::GEN, outputDirs);
|
||||
} else if (MocConst().Enabled) {
|
||||
createDirs(GenT::MOC, MocEval().OutputDirs);
|
||||
} else if (UicConst().Enabled) {
|
||||
createDirs(GenT::UIC, UicEval().OutputDirs);
|
||||
} else if (this->MocConst().Enabled) {
|
||||
createDirs(GenT::MOC, this->MocEval().OutputDirs);
|
||||
} else if (this->UicConst().Enabled) {
|
||||
createDirs(GenT::UIC, this->UicEval().OutputDirs);
|
||||
}
|
||||
}
|
||||
|
||||
if (MocConst().Enabled) {
|
||||
if (this->MocConst().Enabled) {
|
||||
// Add mocs compilations job
|
||||
Gen()->WorkerPool().EmplaceJob<JobMocsCompilationT>();
|
||||
this->Gen()->WorkerPool().EmplaceJob<JobMocsCompilationT>();
|
||||
}
|
||||
|
||||
if (!BaseConst().DepFile.empty()) {
|
||||
if (!this->BaseConst().DepFile.empty()) {
|
||||
// Add job to merge dep files
|
||||
Gen()->WorkerPool().EmplaceJob<JobDepFilesMergeT>();
|
||||
this->Gen()->WorkerPool().EmplaceJob<JobDepFilesMergeT>();
|
||||
}
|
||||
|
||||
// Add finish job
|
||||
Gen()->WorkerPool().EmplaceJob<JobFinishT>();
|
||||
this->Gen()->WorkerPool().EmplaceJob<JobFinishT>();
|
||||
}
|
||||
|
||||
void cmQtAutoMocUicT::JobCompileMocT::Process()
|
||||
{
|
||||
std::string const& sourceFile = Mapping->SourceFile->FileName;
|
||||
std::string const& outputFile = Mapping->OutputFile;
|
||||
std::string const& sourceFile = this->Mapping->SourceFile->FileName;
|
||||
std::string const& outputFile = this->Mapping->OutputFile;
|
||||
|
||||
// Compose moc command
|
||||
std::vector<std::string> cmd;
|
||||
{
|
||||
// Reserve large enough
|
||||
cmd.reserve(MocConst().OptionsDefinitions.size() +
|
||||
MocConst().OptionsIncludes.size() +
|
||||
MocConst().OptionsExtra.size() + 16);
|
||||
cmd.push_back(MocConst().Executable);
|
||||
cmd.reserve(this->MocConst().OptionsDefinitions.size() +
|
||||
this->MocConst().OptionsIncludes.size() +
|
||||
this->MocConst().OptionsExtra.size() + 16);
|
||||
cmd.push_back(this->MocConst().Executable);
|
||||
// Add definitions
|
||||
cm::append(cmd, MocConst().OptionsDefinitions);
|
||||
cm::append(cmd, this->MocConst().OptionsDefinitions);
|
||||
// Add includes
|
||||
cm::append(cmd, MocConst().OptionsIncludes);
|
||||
cm::append(cmd, this->MocConst().OptionsIncludes);
|
||||
// Add predefs include
|
||||
if (!MocConst().PredefsFileAbs.empty()) {
|
||||
if (!this->MocConst().PredefsFileAbs.empty()) {
|
||||
cmd.emplace_back("--include");
|
||||
cmd.push_back(MocConst().PredefsFileAbs);
|
||||
cmd.push_back(this->MocConst().PredefsFileAbs);
|
||||
}
|
||||
// Add path prefix on demand
|
||||
if (MocConst().PathPrefix && Mapping->SourceFile->IsHeader) {
|
||||
for (std::string const& dir : MocConst().IncludePaths) {
|
||||
if (this->MocConst().PathPrefix && this->Mapping->SourceFile->IsHeader) {
|
||||
for (std::string const& dir : this->MocConst().IncludePaths) {
|
||||
cm::string_view prefix = sourceFile;
|
||||
if (cmHasPrefix(prefix, dir)) {
|
||||
prefix.remove_prefix(dir.size());
|
||||
@@ -1996,8 +2024,8 @@ void cmQtAutoMocUicT::JobCompileMocT::Process()
|
||||
}
|
||||
}
|
||||
// Add extra options
|
||||
cm::append(cmd, MocConst().OptionsExtra);
|
||||
if (MocConst().CanOutputDependencies) {
|
||||
cm::append(cmd, this->MocConst().OptionsExtra);
|
||||
if (this->MocConst().CanOutputDependencies) {
|
||||
cmd.emplace_back("--output-dep-file");
|
||||
}
|
||||
// Add output file
|
||||
@@ -2009,60 +2037,60 @@ void cmQtAutoMocUicT::JobCompileMocT::Process()
|
||||
|
||||
// Execute moc command
|
||||
cmWorkerPool::ProcessResultT result;
|
||||
if (!RunProcess(GenT::MOC, result, cmd, Reason.get())) {
|
||||
if (!this->RunProcess(GenT::MOC, result, cmd, this->Reason.get())) {
|
||||
// Moc command failed
|
||||
std::string includers;
|
||||
if (!Mapping->IncluderFiles.empty()) {
|
||||
if (!this->Mapping->IncluderFiles.empty()) {
|
||||
includers = "included by\n";
|
||||
for (auto const& item : Mapping->IncluderFiles) {
|
||||
includers += cmStrCat(" ", MessagePath(item->FileName), '\n');
|
||||
for (auto const& item : this->Mapping->IncluderFiles) {
|
||||
includers += cmStrCat(" ", this->MessagePath(item->FileName), '\n');
|
||||
}
|
||||
}
|
||||
LogCommandError(GenT::MOC,
|
||||
cmStrCat("The moc process failed to compile\n ",
|
||||
MessagePath(sourceFile), "\ninto\n ",
|
||||
MessagePath(outputFile), '\n', includers,
|
||||
result.ErrorMessage),
|
||||
cmd, result.StdOut);
|
||||
this->LogCommandError(GenT::MOC,
|
||||
cmStrCat("The moc process failed to compile\n ",
|
||||
this->MessagePath(sourceFile), "\ninto\n ",
|
||||
this->MessagePath(outputFile), '\n',
|
||||
includers, result.ErrorMessage),
|
||||
cmd, result.StdOut);
|
||||
return;
|
||||
}
|
||||
|
||||
// Moc command success. Print moc output.
|
||||
if (!result.StdOut.empty()) {
|
||||
Log().Info(GenT::MOC, result.StdOut);
|
||||
this->Log().Info(GenT::MOC, result.StdOut);
|
||||
}
|
||||
|
||||
// Extract dependencies from the dep file moc generated for us
|
||||
if (MocConst().CanOutputDependencies) {
|
||||
if (this->MocConst().CanOutputDependencies) {
|
||||
const std::string depfile = outputFile + ".d";
|
||||
if (Log().Verbose()) {
|
||||
Log().Info(GenT::MOC,
|
||||
"Reading dependencies from " + MessagePath(depfile));
|
||||
if (this->Log().Verbose()) {
|
||||
this->Log().Info(
|
||||
GenT::MOC, "Reading dependencies from " + this->MessagePath(depfile));
|
||||
}
|
||||
if (!cmSystemTools::FileExists(depfile)) {
|
||||
Log().Warning(GenT::MOC,
|
||||
"Dependency file " + MessagePath(depfile) +
|
||||
" does not exist.");
|
||||
this->Log().Warning(GenT::MOC,
|
||||
"Dependency file " + this->MessagePath(depfile) +
|
||||
" does not exist.");
|
||||
return;
|
||||
}
|
||||
CacheEntry->Moc.Depends = dependenciesFromDepFile(depfile.c_str());
|
||||
this->CacheEntry->Moc.Depends = dependenciesFromDepFile(depfile.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
void cmQtAutoMocUicT::JobCompileUicT::Process()
|
||||
{
|
||||
std::string const& sourceFile = Mapping->SourceFile->FileName;
|
||||
std::string const& outputFile = Mapping->OutputFile;
|
||||
std::string const& sourceFile = this->Mapping->SourceFile->FileName;
|
||||
std::string const& outputFile = this->Mapping->OutputFile;
|
||||
|
||||
// Compose uic command
|
||||
std::vector<std::string> cmd;
|
||||
cmd.push_back(UicConst().Executable);
|
||||
cmd.push_back(this->UicConst().Executable);
|
||||
{
|
||||
std::vector<std::string> allOpts = UicConst().Options;
|
||||
auto optionIt = UicConst().UiFiles.find(sourceFile);
|
||||
if (optionIt != UicConst().UiFiles.end()) {
|
||||
std::vector<std::string> allOpts = this->UicConst().Options;
|
||||
auto optionIt = this->UicConst().UiFiles.find(sourceFile);
|
||||
if (optionIt != this->UicConst().UiFiles.end()) {
|
||||
UicMergeOptions(allOpts, optionIt->second.Options,
|
||||
(BaseConst().QtVersion.Major == 5));
|
||||
(this->BaseConst().QtVersion.Major == 5));
|
||||
}
|
||||
cm::append(cmd, allOpts);
|
||||
}
|
||||
@@ -2071,24 +2099,25 @@ void cmQtAutoMocUicT::JobCompileUicT::Process()
|
||||
cmd.emplace_back(sourceFile);
|
||||
|
||||
cmWorkerPool::ProcessResultT result;
|
||||
if (RunProcess(GenT::UIC, result, cmd, Reason.get())) {
|
||||
if (this->RunProcess(GenT::UIC, result, cmd, this->Reason.get())) {
|
||||
// Uic command success
|
||||
// Print uic output
|
||||
if (!result.StdOut.empty()) {
|
||||
Log().Info(GenT::UIC, result.StdOut);
|
||||
this->Log().Info(GenT::UIC, result.StdOut);
|
||||
}
|
||||
} else {
|
||||
// Uic command failed
|
||||
std::string includers;
|
||||
for (auto const& item : Mapping->IncluderFiles) {
|
||||
includers += cmStrCat(" ", MessagePath(item->FileName), '\n');
|
||||
for (auto const& item : this->Mapping->IncluderFiles) {
|
||||
includers += cmStrCat(" ", this->MessagePath(item->FileName), '\n');
|
||||
}
|
||||
LogCommandError(GenT::UIC,
|
||||
cmStrCat("The uic process failed to compile\n ",
|
||||
MessagePath(sourceFile), "\ninto\n ",
|
||||
MessagePath(outputFile), "\nincluded by\n",
|
||||
includers, result.ErrorMessage),
|
||||
cmd, result.StdOut);
|
||||
this->LogCommandError(GenT::UIC,
|
||||
cmStrCat("The uic process failed to compile\n ",
|
||||
this->MessagePath(sourceFile), "\ninto\n ",
|
||||
this->MessagePath(outputFile),
|
||||
"\nincluded by\n", includers,
|
||||
result.ErrorMessage),
|
||||
cmd, result.StdOut);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2098,41 +2127,41 @@ void cmQtAutoMocUicT::JobMocsCompilationT::Process()
|
||||
std::string content =
|
||||
"// This file is autogenerated. Changes will be overwritten.\n";
|
||||
|
||||
if (MocEval().CompFiles.empty()) {
|
||||
if (this->MocEval().CompFiles.empty()) {
|
||||
// Placeholder content
|
||||
content += "// No files found that require moc or the moc files are "
|
||||
"included\n"
|
||||
"enum some_compilers { need_more_than_nothing };\n";
|
||||
} else {
|
||||
// Valid content
|
||||
const bool mc = BaseConst().MultiConfig;
|
||||
const bool mc = this->BaseConst().MultiConfig;
|
||||
cm::string_view const wrapFront = mc ? "#include <" : "#include \"";
|
||||
cm::string_view const wrapBack = mc ? ">\n" : "\"\n";
|
||||
content += cmWrap(wrapFront, MocEval().CompFiles, wrapBack, "");
|
||||
content += cmWrap(wrapFront, this->MocEval().CompFiles, wrapBack, "");
|
||||
}
|
||||
|
||||
std::string const& compAbs = MocConst().CompFileAbs;
|
||||
std::string const& compAbs = this->MocConst().CompFileAbs;
|
||||
if (cmQtAutoGenerator::FileDiffers(compAbs, content)) {
|
||||
// Actually write mocs compilation file
|
||||
if (Log().Verbose()) {
|
||||
Log().Info(GenT::MOC,
|
||||
"Generating MOC compilation " + MessagePath(compAbs));
|
||||
if (this->Log().Verbose()) {
|
||||
this->Log().Info(
|
||||
GenT::MOC, "Generating MOC compilation " + this->MessagePath(compAbs));
|
||||
}
|
||||
if (!FileWrite(compAbs, content)) {
|
||||
LogError(GenT::MOC,
|
||||
cmStrCat("Writing MOC compilation ", MessagePath(compAbs),
|
||||
" failed."));
|
||||
this->LogError(GenT::MOC,
|
||||
cmStrCat("Writing MOC compilation ",
|
||||
this->MessagePath(compAbs), " failed."));
|
||||
}
|
||||
} else if (MocEval().CompUpdated) {
|
||||
} else if (this->MocEval().CompUpdated) {
|
||||
// Only touch mocs compilation file
|
||||
if (Log().Verbose()) {
|
||||
Log().Info(GenT::MOC,
|
||||
"Touching MOC compilation " + MessagePath(compAbs));
|
||||
if (this->Log().Verbose()) {
|
||||
this->Log().Info(
|
||||
GenT::MOC, "Touching MOC compilation " + this->MessagePath(compAbs));
|
||||
}
|
||||
if (!cmSystemTools::Touch(compAbs, false)) {
|
||||
LogError(GenT::MOC,
|
||||
cmStrCat("Touching MOC compilation ", MessagePath(compAbs),
|
||||
" failed."));
|
||||
this->LogError(GenT::MOC,
|
||||
cmStrCat("Touching MOC compilation ",
|
||||
this->MessagePath(compAbs), " failed."));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2171,10 +2200,11 @@ std::string escapeDependencyPath(cm::string_view path)
|
||||
|
||||
void cmQtAutoMocUicT::JobDepFilesMergeT::Process()
|
||||
{
|
||||
if (Log().Verbose()) {
|
||||
Log().Info(GenT::MOC,
|
||||
cmStrCat("Merging MOC dependencies into ",
|
||||
MessagePath(BaseConst().DepFile.c_str())));
|
||||
if (this->Log().Verbose()) {
|
||||
this->Log().Info(
|
||||
GenT::MOC,
|
||||
cmStrCat("Merging MOC dependencies into ",
|
||||
this->MessagePath(this->BaseConst().DepFile.c_str())));
|
||||
}
|
||||
auto processDepFile =
|
||||
[](const std::string& mocOutputFile) -> std::vector<std::string> {
|
||||
@@ -2185,8 +2215,8 @@ void cmQtAutoMocUicT::JobDepFilesMergeT::Process()
|
||||
return dependenciesFromDepFile(f.c_str());
|
||||
};
|
||||
|
||||
std::vector<std::string> dependencies = BaseConst().ListFiles;
|
||||
ParseCacheT& parseCache = BaseEval().ParseCache;
|
||||
std::vector<std::string> dependencies = this->BaseConst().ListFiles;
|
||||
ParseCacheT& parseCache = this->BaseEval().ParseCache;
|
||||
auto processMappingEntry = [&](const MappingMapT::value_type& m) {
|
||||
auto cacheEntry = parseCache.GetOrInsert(m.first);
|
||||
if (cacheEntry.first->Moc.Depends.empty()) {
|
||||
@@ -2197,10 +2227,10 @@ void cmQtAutoMocUicT::JobDepFilesMergeT::Process()
|
||||
cacheEntry.first->Moc.Depends.end());
|
||||
};
|
||||
|
||||
std::for_each(MocEval().HeaderMappings.begin(),
|
||||
MocEval().HeaderMappings.end(), processMappingEntry);
|
||||
std::for_each(MocEval().SourceMappings.begin(),
|
||||
MocEval().SourceMappings.end(), processMappingEntry);
|
||||
std::for_each(this->MocEval().HeaderMappings.begin(),
|
||||
this->MocEval().HeaderMappings.end(), processMappingEntry);
|
||||
std::for_each(this->MocEval().SourceMappings.begin(),
|
||||
this->MocEval().SourceMappings.end(), processMappingEntry);
|
||||
|
||||
// Remove duplicates to make the depfile smaller
|
||||
std::sort(dependencies.begin(), dependencies.end());
|
||||
@@ -2208,39 +2238,42 @@ void cmQtAutoMocUicT::JobDepFilesMergeT::Process()
|
||||
dependencies.end());
|
||||
|
||||
// Add form files
|
||||
for (const auto& uif : UicEval().UiFiles) {
|
||||
for (const auto& uif : this->UicEval().UiFiles) {
|
||||
dependencies.push_back(uif.first);
|
||||
}
|
||||
|
||||
// Write the file
|
||||
cmsys::ofstream ofs;
|
||||
ofs.open(BaseConst().DepFile.c_str(),
|
||||
ofs.open(this->BaseConst().DepFile.c_str(),
|
||||
(std::ios::out | std::ios::binary | std::ios::trunc));
|
||||
if (!ofs) {
|
||||
LogError(GenT::GEN,
|
||||
cmStrCat("Cannot open ", MessagePath(BaseConst().DepFile),
|
||||
" for writing."));
|
||||
this->LogError(GenT::GEN,
|
||||
cmStrCat("Cannot open ",
|
||||
this->MessagePath(this->BaseConst().DepFile),
|
||||
" for writing."));
|
||||
return;
|
||||
}
|
||||
ofs << BaseConst().DepFileRuleName << ": \\\n";
|
||||
ofs << this->BaseConst().DepFileRuleName << ": \\\n";
|
||||
for (const std::string& file : dependencies) {
|
||||
ofs << '\t' << escapeDependencyPath(file) << " \\\n";
|
||||
if (!ofs.good()) {
|
||||
LogError(GenT::GEN,
|
||||
cmStrCat("Writing depfile", MessagePath(BaseConst().DepFile),
|
||||
" failed."));
|
||||
this->LogError(GenT::GEN,
|
||||
cmStrCat("Writing depfile",
|
||||
this->MessagePath(this->BaseConst().DepFile),
|
||||
" failed."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Add the CMake executable to re-new cache data if necessary.
|
||||
// Also, this is the last entry, so don't add a backslash.
|
||||
ofs << '\t' << escapeDependencyPath(BaseConst().CMakeExecutable) << '\n';
|
||||
ofs << '\t' << escapeDependencyPath(this->BaseConst().CMakeExecutable)
|
||||
<< '\n';
|
||||
}
|
||||
|
||||
void cmQtAutoMocUicT::JobFinishT::Process()
|
||||
{
|
||||
Gen()->AbortSuccess();
|
||||
this->Gen()->AbortSuccess();
|
||||
}
|
||||
|
||||
cmQtAutoMocUicT::cmQtAutoMocUicT()
|
||||
@@ -2252,42 +2285,51 @@ cmQtAutoMocUicT::~cmQtAutoMocUicT() = default;
|
||||
bool cmQtAutoMocUicT::InitFromInfo(InfoT const& info)
|
||||
{
|
||||
// -- Required settings
|
||||
if (!info.GetBool("MULTI_CONFIG", BaseConst_.MultiConfig, true) ||
|
||||
!info.GetUInt("QT_VERSION_MAJOR", BaseConst_.QtVersion.Major, true) ||
|
||||
!info.GetUInt("QT_VERSION_MINOR", BaseConst_.QtVersion.Minor, true) ||
|
||||
!info.GetUInt("PARALLEL", BaseConst_.ThreadCount, false) ||
|
||||
!info.GetString("BUILD_DIR", BaseConst_.AutogenBuildDir, true) ||
|
||||
!info.GetStringConfig("INCLUDE_DIR", BaseConst_.AutogenIncludeDir,
|
||||
if (!info.GetBool("MULTI_CONFIG", this->BaseConst_.MultiConfig, true) ||
|
||||
!info.GetUInt("QT_VERSION_MAJOR", this->BaseConst_.QtVersion.Major,
|
||||
true) ||
|
||||
!info.GetUInt("QT_VERSION_MINOR", this->BaseConst_.QtVersion.Minor,
|
||||
true) ||
|
||||
!info.GetUInt("PARALLEL", this->BaseConst_.ThreadCount, false) ||
|
||||
!info.GetString("BUILD_DIR", this->BaseConst_.AutogenBuildDir, true) ||
|
||||
!info.GetStringConfig("INCLUDE_DIR", this->BaseConst_.AutogenIncludeDir,
|
||||
true) ||
|
||||
!info.GetString("CMAKE_EXECUTABLE", BaseConst_.CMakeExecutable, true) ||
|
||||
!info.GetStringConfig("PARSE_CACHE_FILE", BaseConst_.ParseCacheFile,
|
||||
true) ||
|
||||
!info.GetString("DEP_FILE", BaseConst_.DepFile, false) ||
|
||||
!info.GetString("DEP_FILE_RULE_NAME", BaseConst_.DepFileRuleName,
|
||||
!info.GetString("CMAKE_EXECUTABLE", this->BaseConst_.CMakeExecutable,
|
||||
true) ||
|
||||
!info.GetStringConfig("PARSE_CACHE_FILE",
|
||||
this->BaseConst_.ParseCacheFile, true) ||
|
||||
!info.GetString("DEP_FILE", this->BaseConst_.DepFile, false) ||
|
||||
!info.GetString("DEP_FILE_RULE_NAME", this->BaseConst_.DepFileRuleName,
|
||||
false) ||
|
||||
!info.GetStringConfig("SETTINGS_FILE", SettingsFile_, true) ||
|
||||
!info.GetArray("CMAKE_LIST_FILES", BaseConst_.ListFiles, true) ||
|
||||
!info.GetArray("HEADER_EXTENSIONS", BaseConst_.HeaderExtensions, true) ||
|
||||
!info.GetString("QT_MOC_EXECUTABLE", MocConst_.Executable, false) ||
|
||||
!info.GetString("QT_UIC_EXECUTABLE", UicConst_.Executable, false)) {
|
||||
!info.GetStringConfig("SETTINGS_FILE", this->SettingsFile_, true) ||
|
||||
!info.GetArray("CMAKE_LIST_FILES", this->BaseConst_.ListFiles, true) ||
|
||||
!info.GetArray("HEADER_EXTENSIONS", this->BaseConst_.HeaderExtensions,
|
||||
true) ||
|
||||
!info.GetString("QT_MOC_EXECUTABLE", this->MocConst_.Executable,
|
||||
false) ||
|
||||
!info.GetString("QT_UIC_EXECUTABLE", this->UicConst_.Executable,
|
||||
false)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// -- Checks
|
||||
if (!BaseConst_.CMakeExecutableTime.Load(BaseConst_.CMakeExecutable)) {
|
||||
return info.LogError(cmStrCat("The CMake executable ",
|
||||
MessagePath(BaseConst_.CMakeExecutable),
|
||||
" does not exist."));
|
||||
if (!this->BaseConst_.CMakeExecutableTime.Load(
|
||||
this->BaseConst_.CMakeExecutable)) {
|
||||
return info.LogError(
|
||||
cmStrCat("The CMake executable ",
|
||||
this->MessagePath(this->BaseConst_.CMakeExecutable),
|
||||
" does not exist."));
|
||||
}
|
||||
|
||||
// -- Evaluate values
|
||||
BaseConst_.ThreadCount = std::min(BaseConst_.ThreadCount, ParallelMax);
|
||||
WorkerPool_.SetThreadCount(BaseConst_.ThreadCount);
|
||||
this->BaseConst_.ThreadCount =
|
||||
std::min(this->BaseConst_.ThreadCount, ParallelMax);
|
||||
this->WorkerPool_.SetThreadCount(this->BaseConst_.ThreadCount);
|
||||
|
||||
// -- Moc
|
||||
if (!MocConst_.Executable.empty()) {
|
||||
if (!this->MocConst_.Executable.empty()) {
|
||||
// -- Moc is enabled
|
||||
MocConst_.Enabled = true;
|
||||
this->MocConst_.Enabled = true;
|
||||
|
||||
// -- Temporary buffers
|
||||
struct
|
||||
@@ -2297,18 +2339,21 @@ bool cmQtAutoMocUicT::InitFromInfo(InfoT const& info)
|
||||
} tmp;
|
||||
|
||||
// -- Required settings
|
||||
if (!info.GetBool("MOC_RELAXED_MODE", MocConst_.RelaxedMode, false) ||
|
||||
!info.GetBool("MOC_PATH_PREFIX", MocConst_.PathPrefix, true) ||
|
||||
!info.GetArray("MOC_SKIP", MocConst_.SkipList, false) ||
|
||||
!info.GetArrayConfig("MOC_DEFINITIONS", MocConst_.Definitions,
|
||||
if (!info.GetBool("MOC_RELAXED_MODE", this->MocConst_.RelaxedMode,
|
||||
false) ||
|
||||
!info.GetBool("MOC_PATH_PREFIX", this->MocConst_.PathPrefix, true) ||
|
||||
!info.GetArray("MOC_SKIP", this->MocConst_.SkipList, false) ||
|
||||
!info.GetArrayConfig("MOC_DEFINITIONS", this->MocConst_.Definitions,
|
||||
false) ||
|
||||
!info.GetArrayConfig("MOC_INCLUDES", MocConst_.IncludePaths, false) ||
|
||||
!info.GetArray("MOC_OPTIONS", MocConst_.OptionsExtra, false) ||
|
||||
!info.GetStringConfig("MOC_COMPILATION_FILE", MocConst_.CompFileAbs,
|
||||
true) ||
|
||||
!info.GetArray("MOC_PREDEFS_CMD", MocConst_.PredefsCmd, false) ||
|
||||
!info.GetStringConfig("MOC_PREDEFS_FILE", MocConst_.PredefsFileAbs,
|
||||
!MocConst_.PredefsCmd.empty()) ||
|
||||
!info.GetArrayConfig("MOC_INCLUDES", this->MocConst_.IncludePaths,
|
||||
false) ||
|
||||
!info.GetArray("MOC_OPTIONS", this->MocConst_.OptionsExtra, false) ||
|
||||
!info.GetStringConfig("MOC_COMPILATION_FILE",
|
||||
this->MocConst_.CompFileAbs, true) ||
|
||||
!info.GetArray("MOC_PREDEFS_CMD", this->MocConst_.PredefsCmd, false) ||
|
||||
!info.GetStringConfig("MOC_PREDEFS_FILE",
|
||||
this->MocConst_.PredefsFileAbs,
|
||||
!this->MocConst_.PredefsCmd.empty()) ||
|
||||
!info.GetArray("MOC_MACRO_NAMES", tmp.MacroNames, true) ||
|
||||
!info.GetArray("MOC_DEPEND_FILTERS", tmp.DependFilters, false)) {
|
||||
return false;
|
||||
@@ -2316,12 +2361,12 @@ bool cmQtAutoMocUicT::InitFromInfo(InfoT const& info)
|
||||
|
||||
// -- Evaluate settings
|
||||
for (std::string const& item : tmp.MacroNames) {
|
||||
MocConst_.MacroFilters.emplace_back(
|
||||
this->MocConst_.MacroFilters.emplace_back(
|
||||
item, ("[\n][ \t]*{?[ \t]*" + item).append("[^a-zA-Z0-9_]"));
|
||||
}
|
||||
// Can moc output dependencies or do we need to setup dependency filters?
|
||||
if (BaseConst_.QtVersion >= IntegerVersion(5, 15)) {
|
||||
MocConst_.CanOutputDependencies = true;
|
||||
if (this->BaseConst_.QtVersion >= IntegerVersion(5, 15)) {
|
||||
this->MocConst_.CanOutputDependencies = true;
|
||||
} else {
|
||||
Json::Value const& val = info.GetValue("MOC_DEPEND_FILTERS");
|
||||
if (!val.isArray()) {
|
||||
@@ -2371,22 +2416,23 @@ bool cmQtAutoMocUicT::InitFromInfo(InfoT const& info)
|
||||
}
|
||||
}
|
||||
// Check if moc executable exists (by reading the file time)
|
||||
if (!MocConst_.ExecutableTime.Load(MocConst_.Executable)) {
|
||||
return info.LogError(cmStrCat("The moc executable ",
|
||||
MessagePath(MocConst_.Executable),
|
||||
" does not exist."));
|
||||
if (!this->MocConst_.ExecutableTime.Load(this->MocConst_.Executable)) {
|
||||
return info.LogError(cmStrCat(
|
||||
"The moc executable ", this->MessagePath(this->MocConst_.Executable),
|
||||
" does not exist."));
|
||||
}
|
||||
}
|
||||
|
||||
// -- Uic
|
||||
if (!UicConst_.Executable.empty()) {
|
||||
if (!this->UicConst_.Executable.empty()) {
|
||||
// Uic is enabled
|
||||
UicConst_.Enabled = true;
|
||||
this->UicConst_.Enabled = true;
|
||||
|
||||
// -- Required settings
|
||||
if (!info.GetArray("UIC_SKIP", UicConst_.SkipList, false) ||
|
||||
!info.GetArray("UIC_SEARCH_PATHS", UicConst_.SearchPaths, false) ||
|
||||
!info.GetArrayConfig("UIC_OPTIONS", UicConst_.Options, false)) {
|
||||
if (!info.GetArray("UIC_SKIP", this->UicConst_.SkipList, false) ||
|
||||
!info.GetArray("UIC_SEARCH_PATHS", this->UicConst_.SearchPaths,
|
||||
false) ||
|
||||
!info.GetArrayConfig("UIC_OPTIONS", this->UicConst_.Options, false)) {
|
||||
return false;
|
||||
}
|
||||
// .ui files
|
||||
@@ -2420,17 +2466,17 @@ bool cmQtAutoMocUicT::InitFromInfo(InfoT const& info)
|
||||
return false;
|
||||
}
|
||||
|
||||
auto& uiFile = UicConst_.UiFiles[entryName.asString()];
|
||||
auto& uiFile = this->UicConst_.UiFiles[entryName.asString()];
|
||||
InfoT::GetJsonArray(uiFile.Options, entryOptions);
|
||||
}
|
||||
}
|
||||
|
||||
// -- Evaluate settings
|
||||
// Check if uic executable exists (by reading the file time)
|
||||
if (!UicConst_.ExecutableTime.Load(UicConst_.Executable)) {
|
||||
return info.LogError(cmStrCat("The uic executable ",
|
||||
MessagePath(UicConst_.Executable),
|
||||
" does not exist."));
|
||||
if (!this->UicConst_.ExecutableTime.Load(this->UicConst_.Executable)) {
|
||||
return info.LogError(cmStrCat(
|
||||
"The uic executable ", this->MessagePath(this->UicConst_.Executable),
|
||||
" does not exist."));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2505,14 +2551,15 @@ bool cmQtAutoMocUicT::InitFromInfo(InfoT const& info)
|
||||
sourceHandle->IsHeader = true;
|
||||
sourceHandle->Moc = (flags[0] == 'M');
|
||||
sourceHandle->Uic = (flags[1] == 'U');
|
||||
if (sourceHandle->Moc && MocConst().Enabled) {
|
||||
if (sourceHandle->Moc && this->MocConst().Enabled) {
|
||||
if (build.empty()) {
|
||||
return info.LogError(
|
||||
cmStrCat("Header file ", ii, " build path is empty"));
|
||||
}
|
||||
sourceHandle->BuildPath = std::move(build);
|
||||
}
|
||||
BaseEval().Headers.emplace(std::move(name), std::move(sourceHandle));
|
||||
this->BaseEval().Headers.emplace(std::move(name),
|
||||
std::move(sourceHandle));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2583,18 +2630,19 @@ bool cmQtAutoMocUicT::InitFromInfo(InfoT const& info)
|
||||
sourceHandle->IsHeader = false;
|
||||
sourceHandle->Moc = (flags[0] == 'M');
|
||||
sourceHandle->Uic = (flags[1] == 'U');
|
||||
BaseEval().Sources.emplace(std::move(name), std::move(sourceHandle));
|
||||
this->BaseEval().Sources.emplace(std::move(name),
|
||||
std::move(sourceHandle));
|
||||
}
|
||||
}
|
||||
|
||||
// -- Init derived information
|
||||
// Moc variables
|
||||
if (MocConst().Enabled) {
|
||||
if (this->MocConst().Enabled) {
|
||||
// Compose moc includes list
|
||||
{
|
||||
// Compute framework paths
|
||||
std::set<std::string> frameworkPaths;
|
||||
for (std::string const& path : MocConst().IncludePaths) {
|
||||
for (std::string const& path : this->MocConst().IncludePaths) {
|
||||
// Extract framework path
|
||||
if (cmHasLiteralSuffix(path, ".framework/Headers")) {
|
||||
// Go up twice to get to the framework root
|
||||
@@ -2605,24 +2653,25 @@ bool cmQtAutoMocUicT::InitFromInfo(InfoT const& info)
|
||||
}
|
||||
}
|
||||
// Reserve options
|
||||
MocConst_.OptionsIncludes.reserve(MocConst().IncludePaths.size() +
|
||||
frameworkPaths.size() * 2);
|
||||
this->MocConst_.OptionsIncludes.reserve(
|
||||
this->MocConst().IncludePaths.size() + frameworkPaths.size() * 2);
|
||||
// Append includes
|
||||
for (std::string const& path : MocConst().IncludePaths) {
|
||||
MocConst_.OptionsIncludes.emplace_back("-I" + path);
|
||||
for (std::string const& path : this->MocConst().IncludePaths) {
|
||||
this->MocConst_.OptionsIncludes.emplace_back("-I" + path);
|
||||
}
|
||||
// Append framework includes
|
||||
for (std::string const& path : frameworkPaths) {
|
||||
MocConst_.OptionsIncludes.emplace_back("-F");
|
||||
MocConst_.OptionsIncludes.push_back(path);
|
||||
this->MocConst_.OptionsIncludes.emplace_back("-F");
|
||||
this->MocConst_.OptionsIncludes.push_back(path);
|
||||
}
|
||||
}
|
||||
|
||||
// Compose moc definitions list
|
||||
{
|
||||
MocConst_.OptionsDefinitions.reserve(MocConst().Definitions.size());
|
||||
for (std::string const& def : MocConst().Definitions) {
|
||||
MocConst_.OptionsDefinitions.emplace_back("-D" + def);
|
||||
this->MocConst_.OptionsDefinitions.reserve(
|
||||
this->MocConst().Definitions.size());
|
||||
for (std::string const& def : this->MocConst().Definitions) {
|
||||
this->MocConst_.OptionsDefinitions.emplace_back("-D" + def);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2633,16 +2682,16 @@ bool cmQtAutoMocUicT::InitFromInfo(InfoT const& info)
|
||||
template <class JOBTYPE>
|
||||
void cmQtAutoMocUicT::CreateParseJobs(SourceFileMapT const& sourceMap)
|
||||
{
|
||||
cmFileTime const parseCacheTime = BaseEval().ParseCacheTime;
|
||||
ParseCacheT& parseCache = BaseEval().ParseCache;
|
||||
cmFileTime const parseCacheTime = this->BaseEval().ParseCacheTime;
|
||||
ParseCacheT& parseCache = this->BaseEval().ParseCache;
|
||||
for (auto& src : sourceMap) {
|
||||
// Get or create the file parse data reference
|
||||
ParseCacheT::GetOrInsertT cacheEntry = parseCache.GetOrInsert(src.first);
|
||||
src.second->ParseData = std::move(cacheEntry.first);
|
||||
// Create a parse job if the cache file was missing or is older
|
||||
if (cacheEntry.second || src.second->FileTime.Newer(parseCacheTime)) {
|
||||
BaseEval().ParseCacheChanged = true;
|
||||
WorkerPool().EmplaceJob<JOBTYPE>(src.second);
|
||||
this->BaseEval().ParseCacheChanged = true;
|
||||
this->WorkerPool().EmplaceJob<JOBTYPE>(src.second);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2650,55 +2699,56 @@ void cmQtAutoMocUicT::CreateParseJobs(SourceFileMapT const& sourceMap)
|
||||
/** Concurrently callable implementation of cmSystemTools::CollapseFullPath */
|
||||
std::string cmQtAutoMocUicT::CollapseFullPathTS(std::string const& path) const
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(CMakeLibMutex_);
|
||||
return cmSystemTools::CollapseFullPath(path, ProjectDirs().CurrentSource);
|
||||
std::lock_guard<std::mutex> guard(this->CMakeLibMutex_);
|
||||
return cmSystemTools::CollapseFullPath(path,
|
||||
this->ProjectDirs().CurrentSource);
|
||||
}
|
||||
|
||||
void cmQtAutoMocUicT::InitJobs()
|
||||
{
|
||||
// Add moc_predefs.h job
|
||||
if (MocConst().Enabled && !MocConst().PredefsCmd.empty()) {
|
||||
WorkerPool().EmplaceJob<JobMocPredefsT>();
|
||||
if (this->MocConst().Enabled && !this->MocConst().PredefsCmd.empty()) {
|
||||
this->WorkerPool().EmplaceJob<JobMocPredefsT>();
|
||||
}
|
||||
|
||||
// Add header parse jobs
|
||||
CreateParseJobs<JobParseHeaderT>(BaseEval().Headers);
|
||||
this->CreateParseJobs<JobParseHeaderT>(this->BaseEval().Headers);
|
||||
// Add source parse jobs
|
||||
CreateParseJobs<JobParseSourceT>(BaseEval().Sources);
|
||||
this->CreateParseJobs<JobParseSourceT>(this->BaseEval().Sources);
|
||||
|
||||
// Add parse cache evaluations jobs
|
||||
{
|
||||
// Add a fence job to ensure all parsing has finished
|
||||
WorkerPool().EmplaceJob<JobFenceT>();
|
||||
if (MocConst().Enabled) {
|
||||
WorkerPool().EmplaceJob<JobEvalCacheMocT>();
|
||||
this->WorkerPool().EmplaceJob<JobFenceT>();
|
||||
if (this->MocConst().Enabled) {
|
||||
this->WorkerPool().EmplaceJob<JobEvalCacheMocT>();
|
||||
}
|
||||
if (UicConst().Enabled) {
|
||||
WorkerPool().EmplaceJob<JobEvalCacheUicT>();
|
||||
if (this->UicConst().Enabled) {
|
||||
this->WorkerPool().EmplaceJob<JobEvalCacheUicT>();
|
||||
}
|
||||
// Add evaluate job
|
||||
WorkerPool().EmplaceJob<JobEvalCacheFinishT>();
|
||||
this->WorkerPool().EmplaceJob<JobEvalCacheFinishT>();
|
||||
}
|
||||
}
|
||||
|
||||
bool cmQtAutoMocUicT::Process()
|
||||
{
|
||||
SettingsFileRead();
|
||||
ParseCacheRead();
|
||||
if (!CreateDirectories()) {
|
||||
this->SettingsFileRead();
|
||||
this->ParseCacheRead();
|
||||
if (!this->CreateDirectories()) {
|
||||
return false;
|
||||
}
|
||||
InitJobs();
|
||||
if (!WorkerPool_.Process(this)) {
|
||||
this->InitJobs();
|
||||
if (!this->WorkerPool_.Process(this)) {
|
||||
return false;
|
||||
}
|
||||
if (JobError_) {
|
||||
if (this->JobError_) {
|
||||
return false;
|
||||
}
|
||||
if (!ParseCacheWrite()) {
|
||||
if (!this->ParseCacheWrite()) {
|
||||
return false;
|
||||
}
|
||||
if (!SettingsFileWrite()) {
|
||||
if (!this->SettingsFileWrite()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -2714,70 +2764,72 @@ void cmQtAutoMocUicT::SettingsFileRead()
|
||||
cryptoHash.Append(";");
|
||||
};
|
||||
|
||||
if (MocConst_.Enabled) {
|
||||
if (this->MocConst_.Enabled) {
|
||||
cryptoHash.Initialize();
|
||||
cha(MocConst().Executable);
|
||||
for (auto const& item : MocConst().OptionsDefinitions) {
|
||||
cha(this->MocConst().Executable);
|
||||
for (auto const& item : this->MocConst().OptionsDefinitions) {
|
||||
cha(item);
|
||||
}
|
||||
for (auto const& item : MocConst().OptionsIncludes) {
|
||||
for (auto const& item : this->MocConst().OptionsIncludes) {
|
||||
cha(item);
|
||||
}
|
||||
for (auto const& item : MocConst().OptionsExtra) {
|
||||
for (auto const& item : this->MocConst().OptionsExtra) {
|
||||
cha(item);
|
||||
}
|
||||
for (auto const& item : MocConst().PredefsCmd) {
|
||||
for (auto const& item : this->MocConst().PredefsCmd) {
|
||||
cha(item);
|
||||
}
|
||||
for (auto const& filter : MocConst().DependFilters) {
|
||||
for (auto const& filter : this->MocConst().DependFilters) {
|
||||
cha(filter.Key);
|
||||
}
|
||||
for (auto const& filter : MocConst().MacroFilters) {
|
||||
for (auto const& filter : this->MocConst().MacroFilters) {
|
||||
cha(filter.Key);
|
||||
}
|
||||
SettingsStringMoc_ = cryptoHash.FinalizeHex();
|
||||
this->SettingsStringMoc_ = cryptoHash.FinalizeHex();
|
||||
}
|
||||
|
||||
if (UicConst().Enabled) {
|
||||
if (this->UicConst().Enabled) {
|
||||
cryptoHash.Initialize();
|
||||
cha(UicConst().Executable);
|
||||
std::for_each(UicConst().Options.begin(), UicConst().Options.end(), cha);
|
||||
for (const auto& item : UicConst().UiFiles) {
|
||||
cha(this->UicConst().Executable);
|
||||
std::for_each(this->UicConst().Options.begin(),
|
||||
this->UicConst().Options.end(), cha);
|
||||
for (const auto& item : this->UicConst().UiFiles) {
|
||||
cha(item.first);
|
||||
auto const& opts = item.second.Options;
|
||||
std::for_each(opts.begin(), opts.end(), cha);
|
||||
}
|
||||
SettingsStringUic_ = cryptoHash.FinalizeHex();
|
||||
this->SettingsStringUic_ = cryptoHash.FinalizeHex();
|
||||
}
|
||||
}
|
||||
|
||||
// Read old settings and compare
|
||||
{
|
||||
std::string content;
|
||||
if (cmQtAutoGenerator::FileRead(content, SettingsFile_)) {
|
||||
if (MocConst().Enabled) {
|
||||
if (SettingsStringMoc_ != SettingsFind(content, "moc")) {
|
||||
MocConst_.SettingsChanged = true;
|
||||
if (cmQtAutoGenerator::FileRead(content, this->SettingsFile_)) {
|
||||
if (this->MocConst().Enabled) {
|
||||
if (this->SettingsStringMoc_ != SettingsFind(content, "moc")) {
|
||||
this->MocConst_.SettingsChanged = true;
|
||||
}
|
||||
}
|
||||
if (UicConst().Enabled) {
|
||||
if (SettingsStringUic_ != SettingsFind(content, "uic")) {
|
||||
UicConst_.SettingsChanged = true;
|
||||
if (this->UicConst().Enabled) {
|
||||
if (this->SettingsStringUic_ != SettingsFind(content, "uic")) {
|
||||
this->UicConst_.SettingsChanged = true;
|
||||
}
|
||||
}
|
||||
// In case any setting changed remove the old settings file.
|
||||
// This triggers a full rebuild on the next run if the current
|
||||
// build is aborted before writing the current settings in the end.
|
||||
if (MocConst().SettingsChanged || UicConst().SettingsChanged) {
|
||||
cmSystemTools::RemoveFile(SettingsFile_);
|
||||
if (this->MocConst().SettingsChanged ||
|
||||
this->UicConst().SettingsChanged) {
|
||||
cmSystemTools::RemoveFile(this->SettingsFile_);
|
||||
}
|
||||
} else {
|
||||
// Settings file read failed
|
||||
if (MocConst().Enabled) {
|
||||
MocConst_.SettingsChanged = true;
|
||||
if (this->MocConst().Enabled) {
|
||||
this->MocConst_.SettingsChanged = true;
|
||||
}
|
||||
if (UicConst().Enabled) {
|
||||
UicConst_.SettingsChanged = true;
|
||||
if (this->UicConst().Enabled) {
|
||||
this->UicConst_.SettingsChanged = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2786,11 +2838,11 @@ void cmQtAutoMocUicT::SettingsFileRead()
|
||||
bool cmQtAutoMocUicT::SettingsFileWrite()
|
||||
{
|
||||
// Only write if any setting changed
|
||||
if (MocConst().SettingsChanged || UicConst().SettingsChanged) {
|
||||
if (Log().Verbose()) {
|
||||
Log().Info(
|
||||
GenT::GEN,
|
||||
cmStrCat("Writing the settings file ", MessagePath(SettingsFile_)));
|
||||
if (this->MocConst().SettingsChanged || this->UicConst().SettingsChanged) {
|
||||
if (this->Log().Verbose()) {
|
||||
this->Log().Info(GenT::GEN,
|
||||
cmStrCat("Writing the settings file ",
|
||||
this->MessagePath(this->SettingsFile_)));
|
||||
}
|
||||
// Compose settings file content
|
||||
std::string content;
|
||||
@@ -2801,17 +2853,18 @@ bool cmQtAutoMocUicT::SettingsFileWrite()
|
||||
content += cmStrCat(key, ':', value, '\n');
|
||||
}
|
||||
};
|
||||
SettingAppend("moc", SettingsStringMoc_);
|
||||
SettingAppend("uic", SettingsStringUic_);
|
||||
SettingAppend("moc", this->SettingsStringMoc_);
|
||||
SettingAppend("uic", this->SettingsStringUic_);
|
||||
}
|
||||
// Write settings file
|
||||
std::string error;
|
||||
if (!cmQtAutoGenerator::FileWrite(SettingsFile_, content, &error)) {
|
||||
Log().Error(GenT::GEN,
|
||||
cmStrCat("Writing the settings file ",
|
||||
MessagePath(SettingsFile_), " failed.\n", error));
|
||||
if (!cmQtAutoGenerator::FileWrite(this->SettingsFile_, content, &error)) {
|
||||
this->Log().Error(GenT::GEN,
|
||||
cmStrCat("Writing the settings file ",
|
||||
this->MessagePath(this->SettingsFile_),
|
||||
" failed.\n", error));
|
||||
// Remove old settings file to trigger a full rebuild on the next run
|
||||
cmSystemTools::RemoveFile(SettingsFile_);
|
||||
cmSystemTools::RemoveFile(this->SettingsFile_);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -2822,41 +2875,46 @@ void cmQtAutoMocUicT::ParseCacheRead()
|
||||
{
|
||||
cm::string_view reason;
|
||||
// Don't read the cache if it is invalid
|
||||
if (!BaseEval().ParseCacheTime.Load(BaseConst().ParseCacheFile)) {
|
||||
if (!this->BaseEval().ParseCacheTime.Load(
|
||||
this->BaseConst().ParseCacheFile)) {
|
||||
reason = "Refreshing parse cache because it doesn't exist.";
|
||||
} else if (MocConst().SettingsChanged || UicConst().SettingsChanged) {
|
||||
} else if (this->MocConst().SettingsChanged ||
|
||||
this->UicConst().SettingsChanged) {
|
||||
reason = "Refreshing parse cache because the settings changed.";
|
||||
} else if (BaseEval().ParseCacheTime.Older(
|
||||
BaseConst().CMakeExecutableTime)) {
|
||||
} else if (this->BaseEval().ParseCacheTime.Older(
|
||||
this->BaseConst().CMakeExecutableTime)) {
|
||||
reason =
|
||||
"Refreshing parse cache because it is older than the CMake executable.";
|
||||
}
|
||||
|
||||
if (!reason.empty()) {
|
||||
// Don't read but refresh the complete parse cache
|
||||
if (Log().Verbose()) {
|
||||
Log().Info(GenT::GEN, reason);
|
||||
if (this->Log().Verbose()) {
|
||||
this->Log().Info(GenT::GEN, reason);
|
||||
}
|
||||
BaseEval().ParseCacheChanged = true;
|
||||
this->BaseEval().ParseCacheChanged = true;
|
||||
} else {
|
||||
// Read parse cache
|
||||
BaseEval().ParseCache.ReadFromFile(BaseConst().ParseCacheFile);
|
||||
this->BaseEval().ParseCache.ReadFromFile(this->BaseConst().ParseCacheFile);
|
||||
}
|
||||
}
|
||||
|
||||
bool cmQtAutoMocUicT::ParseCacheWrite()
|
||||
{
|
||||
if (BaseEval().ParseCacheChanged) {
|
||||
if (Log().Verbose()) {
|
||||
Log().Info(GenT::GEN,
|
||||
cmStrCat("Writing the parse cache file ",
|
||||
MessagePath(BaseConst().ParseCacheFile)));
|
||||
if (this->BaseEval().ParseCacheChanged) {
|
||||
if (this->Log().Verbose()) {
|
||||
this->Log().Info(
|
||||
GenT::GEN,
|
||||
cmStrCat("Writing the parse cache file ",
|
||||
this->MessagePath(this->BaseConst().ParseCacheFile)));
|
||||
}
|
||||
if (!BaseEval().ParseCache.WriteToFile(BaseConst().ParseCacheFile)) {
|
||||
Log().Error(GenT::GEN,
|
||||
cmStrCat("Writing the parse cache file ",
|
||||
MessagePath(BaseConst().ParseCacheFile),
|
||||
" failed."));
|
||||
if (!this->BaseEval().ParseCache.WriteToFile(
|
||||
this->BaseConst().ParseCacheFile)) {
|
||||
this->Log().Error(
|
||||
GenT::GEN,
|
||||
cmStrCat("Writing the parse cache file ",
|
||||
this->MessagePath(this->BaseConst().ParseCacheFile),
|
||||
" failed."));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -2866,11 +2924,12 @@ bool cmQtAutoMocUicT::ParseCacheWrite()
|
||||
bool cmQtAutoMocUicT::CreateDirectories()
|
||||
{
|
||||
// Create AUTOGEN include directory
|
||||
if (!cmSystemTools::MakeDirectory(BaseConst().AutogenIncludeDir)) {
|
||||
Log().Error(GenT::GEN,
|
||||
cmStrCat("Creating the AUTOGEN include directory ",
|
||||
MessagePath(BaseConst().AutogenIncludeDir),
|
||||
" failed."));
|
||||
if (!cmSystemTools::MakeDirectory(this->BaseConst().AutogenIncludeDir)) {
|
||||
this->Log().Error(
|
||||
GenT::GEN,
|
||||
cmStrCat("Creating the AUTOGEN include directory ",
|
||||
this->MessagePath(this->BaseConst().AutogenIncludeDir),
|
||||
" failed."));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -2892,21 +2951,21 @@ std::vector<std::string> cmQtAutoMocUicT::dependenciesFromDepFile(
|
||||
void cmQtAutoMocUicT::Abort(bool error)
|
||||
{
|
||||
if (error) {
|
||||
JobError_.store(true);
|
||||
this->JobError_.store(true);
|
||||
}
|
||||
WorkerPool_.Abort();
|
||||
this->WorkerPool_.Abort();
|
||||
}
|
||||
|
||||
std::string cmQtAutoMocUicT::AbsoluteBuildPath(
|
||||
cm::string_view relativePath) const
|
||||
{
|
||||
return cmStrCat(BaseConst().AutogenBuildDir, '/', relativePath);
|
||||
return cmStrCat(this->BaseConst().AutogenBuildDir, '/', relativePath);
|
||||
}
|
||||
|
||||
std::string cmQtAutoMocUicT::AbsoluteIncludePath(
|
||||
cm::string_view relativePath) const
|
||||
{
|
||||
return cmStrCat(BaseConst().AutogenIncludeDir, '/', relativePath);
|
||||
return cmStrCat(this->BaseConst().AutogenIncludeDir, '/', relativePath);
|
||||
}
|
||||
|
||||
} // End of unnamed namespace
|
||||
|
||||
+192
-168
@@ -35,7 +35,7 @@ public:
|
||||
|
||||
private:
|
||||
// -- Utility
|
||||
bool IsMultiConfig() const { return MultiConfig_; }
|
||||
bool IsMultiConfig() const { return this->MultiConfig_; }
|
||||
std::string MultiConfigOutput() const;
|
||||
|
||||
// -- Abstract processing interface
|
||||
@@ -93,38 +93,41 @@ cmQtAutoRccT::~cmQtAutoRccT() = default;
|
||||
bool cmQtAutoRccT::InitFromInfo(InfoT const& info)
|
||||
{
|
||||
// -- Required settings
|
||||
if (!info.GetBool("MULTI_CONFIG", MultiConfig_, true) ||
|
||||
!info.GetString("BUILD_DIR", AutogenBuildDir_, true) ||
|
||||
!info.GetStringConfig("INCLUDE_DIR", IncludeDir_, true) ||
|
||||
!info.GetString("RCC_EXECUTABLE", RccExecutable_, true) ||
|
||||
!info.GetArray("RCC_LIST_OPTIONS", RccListOptions_, false) ||
|
||||
!info.GetString("LOCK_FILE", LockFile_, true) ||
|
||||
!info.GetStringConfig("SETTINGS_FILE", SettingsFile_, true) ||
|
||||
!info.GetString("SOURCE", QrcFile_, true) ||
|
||||
!info.GetString("OUTPUT_CHECKSUM", RccPathChecksum_, true) ||
|
||||
!info.GetString("OUTPUT_NAME", RccFileName_, true) ||
|
||||
!info.GetArray("OPTIONS", Options_, false) ||
|
||||
!info.GetArray("INPUTS", Inputs_, false)) {
|
||||
if (!info.GetBool("MULTI_CONFIG", this->MultiConfig_, true) ||
|
||||
!info.GetString("BUILD_DIR", this->AutogenBuildDir_, true) ||
|
||||
!info.GetStringConfig("INCLUDE_DIR", this->IncludeDir_, true) ||
|
||||
!info.GetString("RCC_EXECUTABLE", this->RccExecutable_, true) ||
|
||||
!info.GetArray("RCC_LIST_OPTIONS", this->RccListOptions_, false) ||
|
||||
!info.GetString("LOCK_FILE", this->LockFile_, true) ||
|
||||
!info.GetStringConfig("SETTINGS_FILE", this->SettingsFile_, true) ||
|
||||
!info.GetString("SOURCE", this->QrcFile_, true) ||
|
||||
!info.GetString("OUTPUT_CHECKSUM", this->RccPathChecksum_, true) ||
|
||||
!info.GetString("OUTPUT_NAME", this->RccFileName_, true) ||
|
||||
!info.GetArray("OPTIONS", this->Options_, false) ||
|
||||
!info.GetArray("INPUTS", this->Inputs_, false)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// -- Derive information
|
||||
QrcFileName_ = cmSystemTools::GetFilenameName(QrcFile_);
|
||||
QrcFileDir_ = cmSystemTools::GetFilenamePath(QrcFile_);
|
||||
RccFilePublic_ =
|
||||
cmStrCat(AutogenBuildDir_, '/', RccPathChecksum_, '/', RccFileName_);
|
||||
this->QrcFileName_ = cmSystemTools::GetFilenameName(this->QrcFile_);
|
||||
this->QrcFileDir_ = cmSystemTools::GetFilenamePath(this->QrcFile_);
|
||||
this->RccFilePublic_ =
|
||||
cmStrCat(this->AutogenBuildDir_, '/', this->RccPathChecksum_, '/',
|
||||
this->RccFileName_);
|
||||
|
||||
// rcc output file name
|
||||
if (IsMultiConfig()) {
|
||||
RccFileOutput_ = cmStrCat(IncludeDir_, '/', MultiConfigOutput());
|
||||
if (this->IsMultiConfig()) {
|
||||
this->RccFileOutput_ =
|
||||
cmStrCat(this->IncludeDir_, '/', this->MultiConfigOutput());
|
||||
} else {
|
||||
RccFileOutput_ = RccFilePublic_;
|
||||
this->RccFileOutput_ = this->RccFilePublic_;
|
||||
}
|
||||
|
||||
// -- Checks
|
||||
if (!RccExecutableTime_.Load(RccExecutable_)) {
|
||||
return info.LogError(cmStrCat(
|
||||
"The rcc executable ", MessagePath(RccExecutable_), " does not exist."));
|
||||
if (!this->RccExecutableTime_.Load(this->RccExecutable_)) {
|
||||
return info.LogError(cmStrCat("The rcc executable ",
|
||||
this->MessagePath(this->RccExecutable_),
|
||||
" does not exist."));
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -132,41 +135,41 @@ bool cmQtAutoRccT::InitFromInfo(InfoT const& info)
|
||||
|
||||
bool cmQtAutoRccT::Process()
|
||||
{
|
||||
if (!SettingsFileRead()) {
|
||||
if (!this->SettingsFileRead()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Test if the rcc output needs to be regenerated
|
||||
bool generate = false;
|
||||
if (!TestQrcRccFiles(generate)) {
|
||||
if (!this->TestQrcRccFiles(generate)) {
|
||||
return false;
|
||||
}
|
||||
if (!generate && !TestResources(generate)) {
|
||||
if (!generate && !this->TestResources(generate)) {
|
||||
return false;
|
||||
}
|
||||
// Generate on demand
|
||||
if (generate) {
|
||||
if (!GenerateRcc()) {
|
||||
if (!this->GenerateRcc()) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
// Test if the info file is newer than the output file
|
||||
if (!TestInfoFile()) {
|
||||
if (!this->TestInfoFile()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!GenerateWrapper()) {
|
||||
if (!this->GenerateWrapper()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return SettingsFileWrite();
|
||||
return this->SettingsFileWrite();
|
||||
}
|
||||
|
||||
std::string cmQtAutoRccT::MultiConfigOutput() const
|
||||
{
|
||||
return cmStrCat(RccPathChecksum_, '/',
|
||||
AppendFilenameSuffix(RccFileName_, "_CMAKE_"));
|
||||
return cmStrCat(this->RccPathChecksum_, '/',
|
||||
AppendFilenameSuffix(this->RccFileName_, "_CMAKE_"));
|
||||
}
|
||||
|
||||
bool cmQtAutoRccT::SettingsFileRead()
|
||||
@@ -178,23 +181,25 @@ bool cmQtAutoRccT::SettingsFileRead()
|
||||
cryptoHash.Append(value);
|
||||
cryptoHash.Append(";");
|
||||
};
|
||||
cha(RccExecutable_);
|
||||
std::for_each(RccListOptions_.begin(), RccListOptions_.end(), cha);
|
||||
cha(QrcFile_);
|
||||
cha(RccPathChecksum_);
|
||||
cha(RccFileName_);
|
||||
std::for_each(Options_.begin(), Options_.end(), cha);
|
||||
std::for_each(Inputs_.begin(), Inputs_.end(), cha);
|
||||
SettingsString_ = cryptoHash.FinalizeHex();
|
||||
cha(this->RccExecutable_);
|
||||
std::for_each(this->RccListOptions_.begin(), this->RccListOptions_.end(),
|
||||
cha);
|
||||
cha(this->QrcFile_);
|
||||
cha(this->RccPathChecksum_);
|
||||
cha(this->RccFileName_);
|
||||
std::for_each(this->Options_.begin(), this->Options_.end(), cha);
|
||||
std::for_each(this->Inputs_.begin(), this->Inputs_.end(), cha);
|
||||
this->SettingsString_ = cryptoHash.FinalizeHex();
|
||||
}
|
||||
|
||||
// Make sure the settings file exists
|
||||
if (!cmSystemTools::FileExists(SettingsFile_, true)) {
|
||||
if (!cmSystemTools::FileExists(this->SettingsFile_, true)) {
|
||||
// Touch the settings file to make sure it exists
|
||||
if (!cmSystemTools::Touch(SettingsFile_, true)) {
|
||||
Log().Error(GenT::RCC,
|
||||
cmStrCat("Touching the settings file ",
|
||||
MessagePath(SettingsFile_), " failed."));
|
||||
if (!cmSystemTools::Touch(this->SettingsFile_, true)) {
|
||||
this->Log().Error(GenT::RCC,
|
||||
cmStrCat("Touching the settings file ",
|
||||
this->MessagePath(this->SettingsFile_),
|
||||
" failed."));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -202,21 +207,23 @@ bool cmQtAutoRccT::SettingsFileRead()
|
||||
// Lock the lock file
|
||||
{
|
||||
// Make sure the lock file exists
|
||||
if (!cmSystemTools::FileExists(LockFile_, true)) {
|
||||
if (!cmSystemTools::Touch(LockFile_, true)) {
|
||||
Log().Error(GenT::RCC,
|
||||
cmStrCat("Touching the lock file ", MessagePath(LockFile_),
|
||||
" failed."));
|
||||
if (!cmSystemTools::FileExists(this->LockFile_, true)) {
|
||||
if (!cmSystemTools::Touch(this->LockFile_, true)) {
|
||||
this->Log().Error(GenT::RCC,
|
||||
cmStrCat("Touching the lock file ",
|
||||
this->MessagePath(this->LockFile_),
|
||||
" failed."));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Lock the lock file
|
||||
cmFileLockResult lockResult =
|
||||
LockFileLock_.Lock(LockFile_, static_cast<unsigned long>(-1));
|
||||
cmFileLockResult lockResult = this->LockFileLock_.Lock(
|
||||
this->LockFile_, static_cast<unsigned long>(-1));
|
||||
if (!lockResult.IsOk()) {
|
||||
Log().Error(GenT::RCC,
|
||||
cmStrCat("Locking of the lock file ", MessagePath(LockFile_),
|
||||
" failed.\n", lockResult.GetOutputMessage()));
|
||||
this->Log().Error(GenT::RCC,
|
||||
cmStrCat("Locking of the lock file ",
|
||||
this->MessagePath(this->LockFile_),
|
||||
" failed.\n", lockResult.GetOutputMessage()));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -224,23 +231,24 @@ bool cmQtAutoRccT::SettingsFileRead()
|
||||
// Read old settings
|
||||
{
|
||||
std::string content;
|
||||
if (FileRead(content, SettingsFile_)) {
|
||||
SettingsChanged_ = (SettingsString_ != SettingsFind(content, "rcc"));
|
||||
if (FileRead(content, this->SettingsFile_)) {
|
||||
this->SettingsChanged_ =
|
||||
(this->SettingsString_ != SettingsFind(content, "rcc"));
|
||||
// In case any setting changed clear the old settings file.
|
||||
// This triggers a full rebuild on the next run if the current
|
||||
// build is aborted before writing the current settings in the end.
|
||||
if (SettingsChanged_) {
|
||||
if (this->SettingsChanged_) {
|
||||
std::string error;
|
||||
if (!FileWrite(SettingsFile_, "", &error)) {
|
||||
Log().Error(GenT::RCC,
|
||||
cmStrCat("Clearing of the settings file ",
|
||||
MessagePath(SettingsFile_), " failed.\n",
|
||||
error));
|
||||
if (!FileWrite(this->SettingsFile_, "", &error)) {
|
||||
this->Log().Error(GenT::RCC,
|
||||
cmStrCat("Clearing of the settings file ",
|
||||
this->MessagePath(this->SettingsFile_),
|
||||
" failed.\n", error));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
SettingsChanged_ = true;
|
||||
this->SettingsChanged_ = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,26 +258,28 @@ bool cmQtAutoRccT::SettingsFileRead()
|
||||
bool cmQtAutoRccT::SettingsFileWrite()
|
||||
{
|
||||
// Only write if any setting changed
|
||||
if (SettingsChanged_) {
|
||||
if (Log().Verbose()) {
|
||||
Log().Info(GenT::RCC,
|
||||
"Writing settings file " + MessagePath(SettingsFile_));
|
||||
if (this->SettingsChanged_) {
|
||||
if (this->Log().Verbose()) {
|
||||
this->Log().Info(GenT::RCC,
|
||||
"Writing settings file " +
|
||||
this->MessagePath(this->SettingsFile_));
|
||||
}
|
||||
// Write settings file
|
||||
std::string content = cmStrCat("rcc:", SettingsString_, '\n');
|
||||
std::string content = cmStrCat("rcc:", this->SettingsString_, '\n');
|
||||
std::string error;
|
||||
if (!FileWrite(SettingsFile_, content, &error)) {
|
||||
Log().Error(GenT::RCC,
|
||||
cmStrCat("Writing of the settings file ",
|
||||
MessagePath(SettingsFile_), " failed.\n", error));
|
||||
if (!FileWrite(this->SettingsFile_, content, &error)) {
|
||||
this->Log().Error(GenT::RCC,
|
||||
cmStrCat("Writing of the settings file ",
|
||||
this->MessagePath(this->SettingsFile_),
|
||||
" failed.\n", error));
|
||||
// Remove old settings file to trigger a full rebuild on the next run
|
||||
cmSystemTools::RemoveFile(SettingsFile_);
|
||||
cmSystemTools::RemoveFile(this->SettingsFile_);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Unlock the lock file
|
||||
LockFileLock_.Release();
|
||||
this->LockFileLock_.Release();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -277,52 +287,57 @@ bool cmQtAutoRccT::SettingsFileWrite()
|
||||
bool cmQtAutoRccT::TestQrcRccFiles(bool& generate)
|
||||
{
|
||||
// Test if the rcc input file exists
|
||||
if (!QrcFileTime_.Load(QrcFile_)) {
|
||||
Log().Error(GenT::RCC,
|
||||
cmStrCat("The resources file ", MessagePath(QrcFile_),
|
||||
" does not exist"));
|
||||
if (!this->QrcFileTime_.Load(this->QrcFile_)) {
|
||||
this->Log().Error(GenT::RCC,
|
||||
cmStrCat("The resources file ",
|
||||
this->MessagePath(this->QrcFile_),
|
||||
" does not exist"));
|
||||
return false;
|
||||
}
|
||||
|
||||
// Test if the rcc output file exists
|
||||
if (!RccFileTime_.Load(RccFileOutput_)) {
|
||||
if (Log().Verbose()) {
|
||||
Reason =
|
||||
cmStrCat("Generating ", MessagePath(RccFileOutput_),
|
||||
", because it doesn't exist, from ", MessagePath(QrcFile_));
|
||||
if (!this->RccFileTime_.Load(this->RccFileOutput_)) {
|
||||
if (this->Log().Verbose()) {
|
||||
this->Reason =
|
||||
cmStrCat("Generating ", this->MessagePath(this->RccFileOutput_),
|
||||
", because it doesn't exist, from ",
|
||||
this->MessagePath(this->QrcFile_));
|
||||
}
|
||||
generate = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Test if the settings changed
|
||||
if (SettingsChanged_) {
|
||||
if (Log().Verbose()) {
|
||||
Reason = cmStrCat("Generating ", MessagePath(RccFileOutput_),
|
||||
", because the rcc settings changed, from ",
|
||||
MessagePath(QrcFile_));
|
||||
if (this->SettingsChanged_) {
|
||||
if (this->Log().Verbose()) {
|
||||
this->Reason =
|
||||
cmStrCat("Generating ", this->MessagePath(this->RccFileOutput_),
|
||||
", because the rcc settings changed, from ",
|
||||
this->MessagePath(this->QrcFile_));
|
||||
}
|
||||
generate = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Test if the rcc output file is older than the .qrc file
|
||||
if (RccFileTime_.Older(QrcFileTime_)) {
|
||||
if (Log().Verbose()) {
|
||||
Reason = cmStrCat("Generating ", MessagePath(RccFileOutput_),
|
||||
", because it is older than ", MessagePath(QrcFile_),
|
||||
", from ", MessagePath(QrcFile_));
|
||||
if (this->RccFileTime_.Older(this->QrcFileTime_)) {
|
||||
if (this->Log().Verbose()) {
|
||||
this->Reason = cmStrCat(
|
||||
"Generating ", this->MessagePath(this->RccFileOutput_),
|
||||
", because it is older than ", this->MessagePath(this->QrcFile_),
|
||||
", from ", this->MessagePath(this->QrcFile_));
|
||||
}
|
||||
generate = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Test if the rcc output file is older than the rcc executable
|
||||
if (RccFileTime_.Older(RccExecutableTime_)) {
|
||||
if (Log().Verbose()) {
|
||||
Reason = cmStrCat("Generating ", MessagePath(RccFileOutput_),
|
||||
", because it is older than the rcc executable, from ",
|
||||
MessagePath(QrcFile_));
|
||||
if (this->RccFileTime_.Older(this->RccExecutableTime_)) {
|
||||
if (this->Log().Verbose()) {
|
||||
this->Reason =
|
||||
cmStrCat("Generating ", this->MessagePath(this->RccFileOutput_),
|
||||
", because it is older than the rcc executable, from ",
|
||||
this->MessagePath(this->QrcFile_));
|
||||
}
|
||||
generate = true;
|
||||
return true;
|
||||
@@ -334,34 +349,38 @@ bool cmQtAutoRccT::TestQrcRccFiles(bool& generate)
|
||||
bool cmQtAutoRccT::TestResources(bool& generate)
|
||||
{
|
||||
// Read resource files list
|
||||
if (Inputs_.empty()) {
|
||||
if (this->Inputs_.empty()) {
|
||||
std::string error;
|
||||
RccLister const lister(RccExecutable_, RccListOptions_);
|
||||
if (!lister.list(QrcFile_, Inputs_, error, Log().Verbose())) {
|
||||
Log().Error(
|
||||
GenT::RCC,
|
||||
cmStrCat("Listing of ", MessagePath(QrcFile_), " failed.\n", error));
|
||||
RccLister const lister(this->RccExecutable_, this->RccListOptions_);
|
||||
if (!lister.list(this->QrcFile_, this->Inputs_, error,
|
||||
this->Log().Verbose())) {
|
||||
this->Log().Error(GenT::RCC,
|
||||
cmStrCat("Listing of ",
|
||||
this->MessagePath(this->QrcFile_),
|
||||
" failed.\n", error));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if any resource file is newer than the rcc output file
|
||||
for (std::string const& resFile : Inputs_) {
|
||||
for (std::string const& resFile : this->Inputs_) {
|
||||
// Check if the resource file exists
|
||||
cmFileTime fileTime;
|
||||
if (!fileTime.Load(resFile)) {
|
||||
Log().Error(GenT::RCC,
|
||||
cmStrCat("The resource file ", MessagePath(resFile),
|
||||
" listed in ", MessagePath(QrcFile_),
|
||||
" does not exist."));
|
||||
this->Log().Error(GenT::RCC,
|
||||
cmStrCat("The resource file ",
|
||||
this->MessagePath(resFile), " listed in ",
|
||||
this->MessagePath(this->QrcFile_),
|
||||
" does not exist."));
|
||||
return false;
|
||||
}
|
||||
// Check if the resource file is newer than the rcc output file
|
||||
if (RccFileTime_.Older(fileTime)) {
|
||||
if (Log().Verbose()) {
|
||||
Reason = cmStrCat("Generating ", MessagePath(RccFileOutput_),
|
||||
", because it is older than ", MessagePath(resFile),
|
||||
", from ", MessagePath(QrcFile_));
|
||||
if (this->RccFileTime_.Older(fileTime)) {
|
||||
if (this->Log().Verbose()) {
|
||||
this->Reason =
|
||||
cmStrCat("Generating ", this->MessagePath(this->RccFileOutput_),
|
||||
", because it is older than ", this->MessagePath(resFile),
|
||||
", from ", this->MessagePath(this->QrcFile_));
|
||||
}
|
||||
generate = true;
|
||||
break;
|
||||
@@ -373,21 +392,23 @@ bool cmQtAutoRccT::TestResources(bool& generate)
|
||||
bool cmQtAutoRccT::TestInfoFile()
|
||||
{
|
||||
// Test if the rcc output file is older than the info file
|
||||
if (RccFileTime_.Older(InfoFileTime())) {
|
||||
if (Log().Verbose()) {
|
||||
Log().Info(GenT::RCC,
|
||||
cmStrCat("Touching ", MessagePath(RccFileOutput_),
|
||||
" because it is older than ",
|
||||
MessagePath(InfoFile())));
|
||||
if (this->RccFileTime_.Older(this->InfoFileTime())) {
|
||||
if (this->Log().Verbose()) {
|
||||
this->Log().Info(GenT::RCC,
|
||||
cmStrCat("Touching ",
|
||||
this->MessagePath(this->RccFileOutput_),
|
||||
" because it is older than ",
|
||||
this->MessagePath(this->InfoFile())));
|
||||
}
|
||||
// Touch build file
|
||||
if (!cmSystemTools::Touch(RccFileOutput_, false)) {
|
||||
Log().Error(
|
||||
GenT::RCC,
|
||||
cmStrCat("Touching ", MessagePath(RccFileOutput_), " failed."));
|
||||
if (!cmSystemTools::Touch(this->RccFileOutput_, false)) {
|
||||
this->Log().Error(GenT::RCC,
|
||||
cmStrCat("Touching ",
|
||||
this->MessagePath(this->RccFileOutput_),
|
||||
" failed."));
|
||||
return false;
|
||||
}
|
||||
BuildFileChanged_ = true;
|
||||
this->BuildFileChanged_ = true;
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -396,51 +417,53 @@ bool cmQtAutoRccT::TestInfoFile()
|
||||
bool cmQtAutoRccT::GenerateRcc()
|
||||
{
|
||||
// Make parent directory
|
||||
if (!MakeParentDirectory(RccFileOutput_)) {
|
||||
Log().Error(GenT::RCC,
|
||||
cmStrCat("Could not create parent directory of ",
|
||||
MessagePath(RccFileOutput_)));
|
||||
if (!MakeParentDirectory(this->RccFileOutput_)) {
|
||||
this->Log().Error(GenT::RCC,
|
||||
cmStrCat("Could not create parent directory of ",
|
||||
this->MessagePath(this->RccFileOutput_)));
|
||||
return false;
|
||||
}
|
||||
|
||||
// Compose rcc command
|
||||
std::vector<std::string> cmd;
|
||||
cmd.push_back(RccExecutable_);
|
||||
cm::append(cmd, Options_);
|
||||
cmd.push_back(this->RccExecutable_);
|
||||
cm::append(cmd, this->Options_);
|
||||
cmd.emplace_back("-o");
|
||||
cmd.push_back(RccFileOutput_);
|
||||
cmd.push_back(QrcFile_);
|
||||
cmd.push_back(this->RccFileOutput_);
|
||||
cmd.push_back(this->QrcFile_);
|
||||
|
||||
// Log reason and command
|
||||
if (Log().Verbose()) {
|
||||
Log().Info(GenT::RCC,
|
||||
cmStrCat(Reason, cmHasSuffix(Reason, '\n') ? "" : "\n",
|
||||
QuotedCommand(cmd), '\n'));
|
||||
if (this->Log().Verbose()) {
|
||||
this->Log().Info(GenT::RCC,
|
||||
cmStrCat(this->Reason,
|
||||
cmHasSuffix(this->Reason, '\n') ? "" : "\n",
|
||||
QuotedCommand(cmd), '\n'));
|
||||
}
|
||||
|
||||
std::string rccStdOut;
|
||||
std::string rccStdErr;
|
||||
int retVal = 0;
|
||||
bool result = cmSystemTools::RunSingleCommand(
|
||||
cmd, &rccStdOut, &rccStdErr, &retVal, AutogenBuildDir_.c_str(),
|
||||
cmd, &rccStdOut, &rccStdErr, &retVal, this->AutogenBuildDir_.c_str(),
|
||||
cmSystemTools::OUTPUT_NONE, cmDuration::zero(), cmProcessOutput::Auto);
|
||||
if (!result || (retVal != 0)) {
|
||||
// rcc process failed
|
||||
Log().ErrorCommand(GenT::RCC,
|
||||
cmStrCat("The rcc process failed to compile\n ",
|
||||
MessagePath(QrcFile_), "\ninto\n ",
|
||||
MessagePath(RccFileOutput_)),
|
||||
cmd, rccStdOut + rccStdErr);
|
||||
cmSystemTools::RemoveFile(RccFileOutput_);
|
||||
this->Log().ErrorCommand(GenT::RCC,
|
||||
cmStrCat("The rcc process failed to compile\n ",
|
||||
this->MessagePath(this->QrcFile_),
|
||||
"\ninto\n ",
|
||||
this->MessagePath(this->RccFileOutput_)),
|
||||
cmd, rccStdOut + rccStdErr);
|
||||
cmSystemTools::RemoveFile(this->RccFileOutput_);
|
||||
return false;
|
||||
}
|
||||
|
||||
// rcc process success
|
||||
// Print rcc output
|
||||
if (!rccStdOut.empty()) {
|
||||
Log().Info(GenT::RCC, rccStdOut);
|
||||
this->Log().Info(GenT::RCC, rccStdOut);
|
||||
}
|
||||
BuildFileChanged_ = true;
|
||||
this->BuildFileChanged_ = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -448,47 +471,48 @@ bool cmQtAutoRccT::GenerateRcc()
|
||||
bool cmQtAutoRccT::GenerateWrapper()
|
||||
{
|
||||
// Generate a wrapper source file on demand
|
||||
if (IsMultiConfig()) {
|
||||
if (this->IsMultiConfig()) {
|
||||
// Wrapper file content
|
||||
std::string content =
|
||||
cmStrCat("// This is an autogenerated configuration wrapper file.\n",
|
||||
"// Changes will be overwritten.\n", "#include <",
|
||||
MultiConfigOutput(), ">\n");
|
||||
this->MultiConfigOutput(), ">\n");
|
||||
|
||||
// Compare with existing file content
|
||||
bool fileDiffers = true;
|
||||
{
|
||||
std::string oldContents;
|
||||
if (FileRead(oldContents, RccFilePublic_)) {
|
||||
if (FileRead(oldContents, this->RccFilePublic_)) {
|
||||
fileDiffers = (oldContents != content);
|
||||
}
|
||||
}
|
||||
if (fileDiffers) {
|
||||
// Write new wrapper file
|
||||
if (Log().Verbose()) {
|
||||
Log().Info(GenT::RCC,
|
||||
cmStrCat("Generating RCC wrapper file ",
|
||||
MessagePath(RccFilePublic_)));
|
||||
if (this->Log().Verbose()) {
|
||||
this->Log().Info(GenT::RCC,
|
||||
cmStrCat("Generating RCC wrapper file ",
|
||||
this->MessagePath(this->RccFilePublic_)));
|
||||
}
|
||||
std::string error;
|
||||
if (!FileWrite(RccFilePublic_, content, &error)) {
|
||||
Log().Error(GenT::RCC,
|
||||
cmStrCat("Generating RCC wrapper file ",
|
||||
MessagePath(RccFilePublic_), " failed.\n",
|
||||
error));
|
||||
if (!FileWrite(this->RccFilePublic_, content, &error)) {
|
||||
this->Log().Error(GenT::RCC,
|
||||
cmStrCat("Generating RCC wrapper file ",
|
||||
this->MessagePath(this->RccFilePublic_),
|
||||
" failed.\n", error));
|
||||
return false;
|
||||
}
|
||||
} else if (BuildFileChanged_) {
|
||||
} else if (this->BuildFileChanged_) {
|
||||
// Just touch the wrapper file
|
||||
if (Log().Verbose()) {
|
||||
Log().Info(
|
||||
GenT::RCC,
|
||||
cmStrCat("Touching RCC wrapper file ", MessagePath(RccFilePublic_)));
|
||||
if (this->Log().Verbose()) {
|
||||
this->Log().Info(GenT::RCC,
|
||||
cmStrCat("Touching RCC wrapper file ",
|
||||
this->MessagePath(this->RccFilePublic_)));
|
||||
}
|
||||
if (!cmSystemTools::Touch(RccFilePublic_, false)) {
|
||||
Log().Error(GenT::RCC,
|
||||
cmStrCat("Touching RCC wrapper file ",
|
||||
MessagePath(RccFilePublic_), " failed."));
|
||||
if (!cmSystemTools::Touch(this->RccFilePublic_, false)) {
|
||||
this->Log().Error(GenT::RCC,
|
||||
cmStrCat("Touching RCC wrapper file ",
|
||||
this->MessagePath(this->RccFilePublic_),
|
||||
" failed."));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -524,7 +524,7 @@ bool cmState::AddScriptedCommand(std::string const& name, BT<Command> command,
|
||||
|
||||
cmState::Command cmState::GetCommand(std::string const& name) const
|
||||
{
|
||||
return GetCommandByExactName(cmSystemTools::LowerCase(name));
|
||||
return this->GetCommandByExactName(cmSystemTools::LowerCase(name));
|
||||
}
|
||||
|
||||
cmState::Command cmState::GetCommandByExactName(std::string const& name) const
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user