diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2018-04-03 10:17:14 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2018-04-03 15:20:30 (GMT) |
commit | 65203ce407f589a6ba148baf64b07ada09205030 (patch) | |
tree | 5b7955575ae7f578ee7f3f8afa822944ef93e2a6 | |
parent | 14a86c9ea7efae1b3acb01bc79f2f1f5ef23c5f1 (diff) | |
download | CMake-65203ce407f589a6ba148baf64b07ada09205030.zip CMake-65203ce407f589a6ba148baf64b07ada09205030.tar.gz CMake-65203ce407f589a6ba148baf64b07ada09205030.tar.bz2 |
Autogen: Protected calls to cmSystemTools::Split/JoinPath
-rw-r--r-- | Source/cmQtAutoGenerator.cxx | 23 | ||||
-rw-r--r-- | Source/cmQtAutoGenerator.h | 8 | ||||
-rw-r--r-- | Source/cmQtAutoGeneratorMocUic.cxx | 4 |
3 files changed, 33 insertions, 2 deletions
diff --git a/Source/cmQtAutoGenerator.cxx b/Source/cmQtAutoGenerator.cxx index 7f133ab..1716189 100644 --- a/Source/cmQtAutoGenerator.cxx +++ b/Source/cmQtAutoGenerator.cxx @@ -160,6 +160,29 @@ std::string cmQtAutoGenerator::FileSystem::CollapseCombinedPath( return cmSystemTools::CollapseCombinedPath(dir, file); } +void cmQtAutoGenerator::FileSystem::SplitPath( + const std::string& p, std::vector<std::string>& components, + bool expand_home_dir) +{ + std::lock_guard<std::mutex> lock(Mutex_); + cmSystemTools::SplitPath(p, components, expand_home_dir); +} + +std::string cmQtAutoGenerator::FileSystem::JoinPath( + const std::vector<std::string>& components) +{ + std::lock_guard<std::mutex> lock(Mutex_); + return cmSystemTools::JoinPath(components); +} + +std::string cmQtAutoGenerator::FileSystem::JoinPath( + std::vector<std::string>::const_iterator first, + std::vector<std::string>::const_iterator last) +{ + std::lock_guard<std::mutex> lock(Mutex_); + return cmSystemTools::JoinPath(first, last); +} + 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 5f59b5d..33d0221 100644 --- a/Source/cmQtAutoGenerator.h +++ b/Source/cmQtAutoGenerator.h @@ -77,6 +77,14 @@ public: /// @brief Wrapper for cmSystemTools::CollapseCombinedPath std::string CollapseCombinedPath(std::string const& dir, std::string const& file); + /// @brief Wrapper for cmSystemTools::SplitPath + void SplitPath(const std::string& p, std::vector<std::string>& components, + bool expand_home_dir = true); + /// @brief Wrapper for cmSystemTools::JoinPath + std::string JoinPath(const std::vector<std::string>& components); + /// @brief Wrapper for cmSystemTools::JoinPath + std::string JoinPath(std::vector<std::string>::const_iterator first, + std::vector<std::string>::const_iterator last); // -- File access bool FileExists(std::string const& filename); diff --git a/Source/cmQtAutoGeneratorMocUic.cxx b/Source/cmQtAutoGeneratorMocUic.cxx index b034ec7..1cdbb96 100644 --- a/Source/cmQtAutoGeneratorMocUic.cxx +++ b/Source/cmQtAutoGeneratorMocUic.cxx @@ -1503,8 +1503,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); } |