1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-16 05:26:58 +08:00

cmStateDirectory: Comment relative path top directory selection approach

This commit is contained in:
Brad King
2021-05-13 09:47:33 -04:00
parent f0ffb1e2d4
commit f6d4fa63f8

View File

@@ -44,6 +44,9 @@ void cmStateDirectory::ComputeRelativePathTopSource()
std::string result = snapshots.front().GetDirectory().GetCurrentSource();
// Walk up the buildsystem directory tree to find the highest source
// directory that contains the current source directory and the
// intermediate ancestors.
for (cmStateSnapshot const& snp : cmMakeRange(snapshots).advance(1)) {
std::string currentSource = snp.GetDirectory().GetCurrentSource();
if (cmSystemTools::IsSubDirectory(result, currentSource)) {
@@ -69,6 +72,9 @@ void cmStateDirectory::ComputeRelativePathTopBinary()
std::string result = snapshots.front().GetDirectory().GetCurrentBinary();
// Walk up the buildsystem directory tree to find the highest binary
// directory that contains the current binary directory and the
// intermediate ancestors.
for (cmStateSnapshot const& snp : cmMakeRange(snapshots).advance(1)) {
std::string currentBinary = snp.GetDirectory().GetCurrentBinary();
if (cmSystemTools::IsSubDirectory(result, currentBinary)) {