diff options
Diffstat (limited to 'Source/cmQtAutoGeneratorMocUic.cxx')
-rw-r--r-- | Source/cmQtAutoGeneratorMocUic.cxx | 52 |
1 files changed, 30 insertions, 22 deletions
diff --git a/Source/cmQtAutoGeneratorMocUic.cxx b/Source/cmQtAutoGeneratorMocUic.cxx index 6be65ee..e2fd158 100644 --- a/Source/cmQtAutoGeneratorMocUic.cxx +++ b/Source/cmQtAutoGeneratorMocUic.cxx @@ -26,7 +26,7 @@ std::string cmQtAutoGeneratorMocUic::BaseSettingsT::AbsoluteBuildPath( std::string const& relativePath) const { - return cmSystemTools::CollapseCombinedPath(AutogenBuildDir, relativePath); + return FileSys->CollapseCombinedPath(AutogenBuildDir, relativePath); } /** @@ -106,7 +106,7 @@ std::string cmQtAutoGeneratorMocUic::MocSettingsT::FindIncludedFile( std::string testPath = sourcePath; testPath += includeString; if (FileSys->FileExists(testPath)) { - return FileSys->RealPath(testPath); + return FileSys->GetRealPath(testPath); } } // Search in include directories @@ -115,7 +115,7 @@ std::string cmQtAutoGeneratorMocUic::MocSettingsT::FindIncludedFile( fullPath.push_back('/'); fullPath += includeString; if (FileSys->FileExists(fullPath)) { - return FileSys->RealPath(fullPath); + return FileSys->GetRealPath(fullPath); } } // Return empty string @@ -166,9 +166,9 @@ void cmQtAutoGeneratorMocUic::JobParseT::Process(WorkerT& wrk) MetaT meta; if (wrk.FileSys().FileRead(meta.Content, FileName, &error)) { if (!meta.Content.empty()) { - meta.FileDir = SubDirPrefix(FileName); + meta.FileDir = wrk.FileSys().SubDirPrefix(FileName); meta.FileBase = - cmSystemTools::GetFilenameWithoutLastExtension(FileName); + wrk.FileSys().GetFilenameWithoutLastExtension(FileName); bool success = true; if (AutoMoc) { @@ -222,9 +222,9 @@ bool cmQtAutoGeneratorMocUic::JobParseT::ParseMocSource(WorkerT& wrk, cmsys::RegularExpressionMatch match; while (wrk.Moc().RegExpInclude.find(contentChars, match)) { std::string incString = match.match(2); - std::string incDir(SubDirPrefix(incString)); + std::string incDir(wrk.FileSys().SubDirPrefix(incString)); std::string incBase = - cmSystemTools::GetFilenameWithoutLastExtension(incString); + wrk.FileSys().GetFilenameWithoutLastExtension(incString); if (cmHasLiteralPrefix(incBase, "moc_")) { // moc_<BASE>.cxx // Remove the moc_ part from the base name @@ -487,7 +487,7 @@ std::string cmQtAutoGeneratorMocUic::JobParseT::MocFindIncludedHeader( } // Sanitize if (!header.empty()) { - header = wrk.FileSys().RealPath(header); + header = wrk.FileSys().GetRealPath(header); } return header; } @@ -533,12 +533,12 @@ std::string cmQtAutoGeneratorMocUic::JobParseT::UicFindIncludedFile( { std::string res; std::string searchFile = - cmSystemTools::GetFilenameWithoutLastExtension(includeString).substr(3); + wrk.FileSys().GetFilenameWithoutLastExtension(includeString).substr(3); searchFile += ".ui"; // Collect search paths list std::deque<std::string> testFiles; { - std::string const searchPath = SubDirPrefix(includeString); + std::string const searchPath = wrk.FileSys().SubDirPrefix(includeString); std::string searchFileFull; if (!searchPath.empty()) { @@ -569,7 +569,7 @@ std::string cmQtAutoGeneratorMocUic::JobParseT::UicFindIncludedFile( // Search for the .ui file! for (std::string const& testFile : testFiles) { if (wrk.FileSys().FileExists(testFile)) { - res = wrk.FileSys().RealPath(testFile); + res = wrk.FileSys().GetRealPath(testFile); break; } } @@ -676,9 +676,9 @@ void cmQtAutoGeneratorMocUic::JobMocT::Process(WorkerT& wrk) BuildFile += '/'; BuildFile += IncludeString; } else { - std::string rel = wrk.Base().FilePathChecksum.getPart(SourceFile); + std::string rel = wrk.FileSys().GetFilePathChecksum(SourceFile); rel += "/moc_"; - rel += cmSystemTools::GetFilenameWithoutLastExtension(SourceFile); + rel += wrk.FileSys().GetFilenameWithoutLastExtension(SourceFile); rel += ".cpp"; // Register relative file path wrk.Gen().ParallelMocAutoRegister(rel); @@ -798,7 +798,7 @@ bool cmQtAutoGeneratorMocUic::JobMocT::UpdateRequired(WorkerT& wrk) } // Check dependency timestamps std::string error; - std::string sourceDir = SubDirPrefix(SourceFile); + std::string sourceDir = wrk.FileSys().SubDirPrefix(SourceFile); for (std::string const& depFileRel : Depends) { std::string depFileAbs = wrk.Moc().FindIncludedFile(sourceDir, depFileRel); @@ -853,8 +853,12 @@ void cmQtAutoGeneratorMocUic::JobMocT::GenerateMoc(WorkerT& wrk) ProcessResultT result; if (wrk.RunProcess(GeneratorT::MOC, result, cmd)) { // Moc command success + // Print moc output + if (!result.StdOut.empty()) { + wrk.LogInfo(GeneratorT::MOC, result.StdOut); + } + // Notify the generator that a not included file changed (on demand) if (IncludeString.empty()) { - // Notify the generator that a not included file changed wrk.Gen().ParallelMocAutoUpdated(); } } else { @@ -963,9 +967,13 @@ void cmQtAutoGeneratorMocUic::JobUicT::GenerateUic(WorkerT& wrk) ProcessResultT result; if (wrk.RunProcess(GeneratorT::UIC, result, cmd)) { - // Success + // Uic command success + // Print uic output + if (!result.StdOut.empty()) { + wrk.LogInfo(GeneratorT::UIC, result.StdOut); + } } else { - // Command failed + // Uic command failed { std::string emsg = "The uic process failed to compile\n "; emsg += Quoted(SourceFile); @@ -1416,8 +1424,8 @@ bool cmQtAutoGeneratorMocUic::Init(cmMakefile* makefile) // Search for the default header file and a private header { std::array<std::string, 2> bases; - bases[0] = SubDirPrefix(src); - bases[0] += cmSystemTools::GetFilenameWithoutLastExtension(src); + bases[0] = FileSys().SubDirPrefix(src); + bases[0] += FileSys().GetFilenameWithoutLastExtension(src); bases[1] = bases[0]; bases[1] += "_p"; for (std::string const& headerBase : bases) { @@ -1444,7 +1452,7 @@ bool cmQtAutoGeneratorMocUic::Init(cmMakefile* makefile) // ------------------------ // Init file path checksum generator - Base_.FilePathChecksum.setupParentDirs( + FileSys().setupFilePathChecksum( Base().CurrentSourceDir, Base().CurrentBinaryDir, Base().ProjectSourceDir, Base().ProjectBinaryDir); @@ -1503,8 +1511,8 @@ bool cmQtAutoGeneratorMocUic::Init(cmMakefile* makefile) if (cmHasLiteralSuffix(path, ".framework/Headers")) { // Go up twice to get to the framework root std::vector<std::string> pathComponents; - cmSystemTools::SplitPath(path, pathComponents); - std::string frameworkPath = cmSystemTools::JoinPath( + FileSys().SplitPath(path, pathComponents); + std::string frameworkPath = FileSys().JoinPath( pathComponents.begin(), pathComponents.end() - 2); frameworkPaths.insert(frameworkPath); } |