diff options
-rw-r--r-- | Source/cmQtAutoGenerator.cxx | 7 | ||||
-rw-r--r-- | Source/cmQtAutoGenerator.h | 2 | ||||
-rw-r--r-- | Source/cmQtAutoGeneratorMocUic.cxx | 10 |
3 files changed, 14 insertions, 5 deletions
diff --git a/Source/cmQtAutoGenerator.cxx b/Source/cmQtAutoGenerator.cxx index 1716189..77bf2ec 100644 --- a/Source/cmQtAutoGenerator.cxx +++ b/Source/cmQtAutoGenerator.cxx @@ -183,6 +183,13 @@ std::string cmQtAutoGenerator::FileSystem::JoinPath( return cmSystemTools::JoinPath(first, last); } +std::string cmQtAutoGenerator::FileSystem::GetFilenameWithoutLastExtension( + const std::string& filename) +{ + std::lock_guard<std::mutex> lock(Mutex_); + return cmSystemTools::GetFilenameWithoutLastExtension(filename); +} + bool cmQtAutoGenerator::FileSystem::FileExists(std::string const& filename) { std::lock_guard<std::mutex> lock(Mutex_); diff --git a/Source/cmQtAutoGenerator.h b/Source/cmQtAutoGenerator.h index 33d0221..d6ddbc3 100644 --- a/Source/cmQtAutoGenerator.h +++ b/Source/cmQtAutoGenerator.h @@ -85,6 +85,8 @@ public: /// @brief Wrapper for cmSystemTools::JoinPath std::string JoinPath(std::vector<std::string>::const_iterator first, std::vector<std::string>::const_iterator last); + /// @brief Wrapper for cmSystemTools::GetFilenameWithoutLastExtension + std::string GetFilenameWithoutLastExtension(const std::string& filename); // -- File access bool FileExists(std::string const& filename); diff --git a/Source/cmQtAutoGeneratorMocUic.cxx b/Source/cmQtAutoGeneratorMocUic.cxx index 1cdbb96..a8ba2ba 100644 --- a/Source/cmQtAutoGeneratorMocUic.cxx +++ b/Source/cmQtAutoGeneratorMocUic.cxx @@ -168,7 +168,7 @@ void cmQtAutoGeneratorMocUic::JobParseT::Process(WorkerT& wrk) if (!meta.Content.empty()) { meta.FileDir = SubDirPrefix(FileName); meta.FileBase = - cmSystemTools::GetFilenameWithoutLastExtension(FileName); + wrk.FileSys().GetFilenameWithoutLastExtension(FileName); bool success = true; if (AutoMoc) { @@ -224,7 +224,7 @@ bool cmQtAutoGeneratorMocUic::JobParseT::ParseMocSource(WorkerT& wrk, std::string incString = match.match(2); std::string incDir(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 @@ -533,7 +533,7 @@ 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; @@ -678,7 +678,7 @@ void cmQtAutoGeneratorMocUic::JobMocT::Process(WorkerT& wrk) } else { std::string rel = wrk.Base().FilePathChecksum.getPart(SourceFile); rel += "/moc_"; - rel += cmSystemTools::GetFilenameWithoutLastExtension(SourceFile); + rel += wrk.FileSys().GetFilenameWithoutLastExtension(SourceFile); rel += ".cpp"; // Register relative file path wrk.Gen().ParallelMocAutoRegister(rel); @@ -1417,7 +1417,7 @@ bool cmQtAutoGeneratorMocUic::Init(cmMakefile* makefile) { std::array<std::string, 2> bases; bases[0] = SubDirPrefix(src); - bases[0] += cmSystemTools::GetFilenameWithoutLastExtension(src); + bases[0] += FileSys().GetFilenameWithoutLastExtension(src); bases[1] = bases[0]; bases[1] += "_p"; for (std::string const& headerBase : bases) { |