summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2018-04-03 11:28:40 +0200
committerSebastian Holtermann <sebholt@xwmw.org>2018-04-03 17:20:29 +0200
commit14a86c9ea7efae1b3acb01bc79f2f1f5ef23c5f1 (patch)
tree917b96ff693ca0b72e932f0f4bc11e70078d8bfe
parent61fd4c742013a7f9139db190f936703b656540ff (diff)
downloadcmake-14a86c9ea7efae1b3acb01bc79f2f1f5ef23c5f1.tar.gz
Autogen: Protected calls to cmSystemTools::CollapseCombinedPath
-rw-r--r--Source/cmQtAutoGenerator.cxx9
-rw-r--r--Source/cmQtAutoGenerator.h12
-rw-r--r--Source/cmQtAutoGeneratorMocUic.cxx10
3 files changed, 24 insertions, 7 deletions
diff --git a/Source/cmQtAutoGenerator.cxx b/Source/cmQtAutoGenerator.cxx
index 1939bd4e66..7f133ab661 100644
--- a/Source/cmQtAutoGenerator.cxx
+++ b/Source/cmQtAutoGenerator.cxx
@@ -146,13 +146,20 @@ void cmQtAutoGenerator::Logger::ErrorCommand(
}
}
-std::string cmQtAutoGenerator::FileSystem::RealPath(
+std::string cmQtAutoGenerator::FileSystem::GetRealPath(
std::string const& filename)
{
std::lock_guard<std::mutex> lock(Mutex_);
return cmSystemTools::GetRealPath(filename);
}
+std::string cmQtAutoGenerator::FileSystem::CollapseCombinedPath(
+ std::string const& dir, std::string const& file)
+{
+ std::lock_guard<std::mutex> lock(Mutex_);
+ return cmSystemTools::CollapseCombinedPath(dir, file);
+}
+
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 e029d8d6bd..5f59b5d0db 100644
--- a/Source/cmQtAutoGenerator.h
+++ b/Source/cmQtAutoGenerator.h
@@ -68,8 +68,17 @@ public:
{
}
+ /// @brief Logger
Logger* Log() const { return Log_; }
- std::string RealPath(std::string const& filename);
+
+ // -- Paths
+ /// @brief Wrapper for cmSystemTools::GetRealPath
+ std::string GetRealPath(std::string const& filename);
+ /// @brief Wrapper for cmSystemTools::CollapseCombinedPath
+ std::string CollapseCombinedPath(std::string const& dir,
+ std::string const& file);
+
+ // -- File access
bool FileExists(std::string const& filename);
bool FileIsOlderThan(std::string const& buildFile,
std::string const& sourceFile,
@@ -92,6 +101,7 @@ public:
bool FileRemove(std::string const& filename);
bool Touch(std::string const& filename);
+ // -- Directory access
bool MakeDirectory(std::string const& dirname);
/// @brief Error logging version
bool MakeDirectory(GeneratorT genType, std::string const& dirname);
diff --git a/Source/cmQtAutoGeneratorMocUic.cxx b/Source/cmQtAutoGeneratorMocUic.cxx
index 6be65eea56..b034ec7cd3 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
@@ -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;
}
@@ -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;
}
}