diff options
author | Ken Martin <ken.martin@kitware.com> | 2005-05-13 18:12:05 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2005-05-13 18:12:05 (GMT) |
commit | 3744464c5e7599affb3ba3cc81e48ff9df7a0e49 (patch) | |
tree | 1490d48a93e15128c654b2906e50567c7bae43ce /Source/cmGlobalGenerator.cxx | |
parent | 8c651793398848063945ab94e4e5f50c6bd7aaf8 (diff) | |
download | CMake-3744464c5e7599affb3ba3cc81e48ff9df7a0e49.zip CMake-3744464c5e7599affb3ba3cc81e48ff9df7a0e49.tar.gz CMake-3744464c5e7599affb3ba3cc81e48ff9df7a0e49.tar.bz2 |
BUG: filx for old bug in rel path computaiton code
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 5158cf0..7818c0e 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -933,16 +933,14 @@ cmGlobalGenerator::ConvertToRelativePath(const std::vector<std::string>& local, // The local path should never have a trailing slash. assert(local.size() > 0 && !(local[local.size()-1] == "")); - // If the path is already relative or relative paths are disabled - // then just return the path. - if(m_RelativePathTop.size() == 0 || - !cmSystemTools::FileIsFullPath(in_remote)) + // If the path is already relative then just return the path. + if(!cmSystemTools::FileIsFullPath(in_remote)) { return in_remote; } - // If the path does not begin with the minimum relative path prefix - // then do not convert it. + // if the path does not contain all of the relative top path then return + // because it is going too far out of the tree std::string original = in_remote; if(original.size() < m_RelativePathTop.size() || !cmSystemTools::ComparePath( @@ -965,6 +963,12 @@ cmGlobalGenerator::ConvertToRelativePath(const std::vector<std::string>& local, ++common; } + // if nothiong is in common the return + if (common == 0) + { + return in_remote; + } + // If the entire path is in common then just return a ".". if(common == remote.size() && common == local.size()) |