diff options
author | Brad King <brad.king@kitware.com> | 2005-02-24 21:04:54 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2005-02-24 21:04:54 (GMT) |
commit | cb48e0c16178738c3d3bafd551f0f3e0b906c6c1 (patch) | |
tree | e6a6b05c3bf993e74eca255d6a00c70175956f1d /Source/cmGlobalGenerator.h | |
parent | 9bf0811e34e7d26eb4aaf7bb250b1fd8be5cbb87 (diff) | |
download | CMake-cb48e0c16178738c3d3bafd551f0f3e0b906c6c1.zip CMake-cb48e0c16178738c3d3bafd551f0f3e0b906c6c1.tar.gz CMake-cb48e0c16178738c3d3bafd551f0f3e0b906c6c1.tar.bz2 |
ENH: Merged implementations of ConvertToRelative*Path methods. The main ConvertToRelativePath method is now in cmGlobalGenerator. It converts paths only if they are at least inside the deepest common directory between the top-level source and build trees. Each cmLocalGenerator instance calls this global method with its own output directory as the "local" argument from which paths are relative. Added separate ConvertToOptionallyRelative path that pays attention to the CMAKE_USE_RELATIVE_PATHS option.
Diffstat (limited to 'Source/cmGlobalGenerator.h')
-rw-r--r-- | Source/cmGlobalGenerator.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 6f4d3b4..7832a96 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -129,11 +129,24 @@ public: const char* GetLanguageOutputExtensionForLanguage(const char* lang); ///! What is the output extension for a given source file extension. const char* GetLanguageOutputExtensionFromExtension(const char* lang); + + /** + * Convert the given remote path to a relative path with respect to + * the given local path. The local path must be given in component + * form (see SystemTools::SplitPath) without a trailing slash. The + * remote path must use forward slashes and not already be escaped + * or quoted. + */ + std::string ConvertToRelativePath(const std::vector<std::string>& local, + const char* remote); + protected: // Fill the m_ProjectMap, this must be called after m_LocalGenerators has been populated. void FillProjectMap(); bool IsExcluded(cmLocalGenerator* root, cmLocalGenerator* gen); void FindMakeProgram(cmMakefile*); + + void ConfigureRelativePaths(); bool m_ForceUnixPaths; cmStdString m_FindMakeProgramFile; @@ -157,6 +170,11 @@ private: std::map<cmStdString, cmStdString> m_LanguageToOutputExtension; std::map<cmStdString, cmStdString> m_ExtensionToLanguage; std::map<cmStdString, cmStdString> m_LanguageToLinkerPreference; + + // The prefix required of a path to be converted to a relative path. + // No sequence of ../.. will ever go past this path. This is the + // longest common path between the top level source and build trees. + std::string m_RelativePathTop; }; #endif |