diff options
author | Brad King <brad.king@kitware.com> | 2021-05-12 19:51:47 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-05-13 16:47:25 (GMT) |
commit | 15fa3200715869d5acb94a282feb301d2e10a0eb (patch) | |
tree | 9c5d6c18b03b2917cc54d7fa2cfa5b9c89d8e4b0 /Source/cmLocalGenerator.h | |
parent | 1879f1bcbc4e2fbd9eaca4eff351ab928c4a3268 (diff) | |
download | CMake-15fa3200715869d5acb94a282feb301d2e10a0eb.zip CMake-15fa3200715869d5acb94a282feb301d2e10a0eb.tar.gz CMake-15fa3200715869d5acb94a282feb301d2e10a0eb.tar.bz2 |
cmLocalGenerator: Factor out relative path conversion helpers
Most calls to `MaybeConvertToRelativePath` use one of our common work
directories (e.g. top of the build tree) as the local path. Add helpers
for each of the common cases to simplify and clarify call sites.
Diffstat (limited to 'Source/cmLocalGenerator.h')
-rw-r--r-- | Source/cmLocalGenerator.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index f597120..5ebf70c 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -464,13 +464,14 @@ public: /** * Convert the given remote path to a relative path with respect to - * the given local path. Both paths must use forward slashes and not - * already be escaped or quoted. + * one of our common work directories. The path must use forward + * slashes and not already be escaped or quoted. * The conversion is skipped if the paths are not both in the source * or both in the binary tree. */ - std::string MaybeConvertToRelativePath(std::string const& local_path, - std::string const& remote_path) const; + std::string MaybeRelativeToTopBinDir(std::string const& path) const; + std::string MaybeRelativeToCurBinDir(std::string const& path) const; + std::string MaybeRelativeToCurSrcDir(std::string const& path) const; /** * Generate a macOS application bundle Info.plist file. @@ -558,6 +559,9 @@ public: cmProp GetRuleLauncher(cmGeneratorTarget* target, const std::string& prop); protected: + std::string MaybeRelativeTo(std::string const& local_path, + std::string const& remote_path) const; + // The default implementation ignores the IncludePathStyle and always // uses absolute paths. A generator may override this to use relative // paths in some cases. |