diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-07-18 17:11:05 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-07-18 17:37:58 (GMT) |
commit | 9ebc7502b2e4cf991e721b695aead2c366eb0bef (patch) | |
tree | fc15903bb08ee8a4a8006c30d170cd2ec7d09cb1 /Source/cmOutputConverter.cxx | |
parent | 27ec21dbb2370ac71aebc0089d4269f27661f4b8 (diff) | |
download | CMake-9ebc7502b2e4cf991e721b695aead2c366eb0bef.zip CMake-9ebc7502b2e4cf991e721b695aead2c366eb0bef.tar.gz CMake-9ebc7502b2e4cf991e721b695aead2c366eb0bef.tar.bz2 |
cmState: Extract a Directory class.
Move Directory-scoped state accessors to it. This will be expanded
with directory property state soon.
Diffstat (limited to 'Source/cmOutputConverter.cxx')
-rw-r--r-- | Source/cmOutputConverter.cxx | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx index 7cd6a47..91f3c0a 100644 --- a/Source/cmOutputConverter.cxx +++ b/Source/cmOutputConverter.cxx @@ -81,11 +81,15 @@ const char* cmOutputConverter::GetRelativeRootPath(RelativeRoot relroot) const { switch (relroot) { - case HOME: return this->GetState()->GetSourceDirectory(); - case START: return this->StateSnapshot.GetCurrentSourceDirectory(); - case HOME_OUTPUT: return this->GetState()->GetBinaryDirectory(); - case START_OUTPUT: return this->StateSnapshot.GetCurrentBinaryDirectory(); - default: break; + case HOME: + return this->GetState()->GetSourceDirectory(); + case START: + return this->StateSnapshot.GetDirectory().GetCurrentSource(); + case HOME_OUTPUT: + return this->GetState()->GetBinaryDirectory(); + case START_OUTPUT: + return this->StateSnapshot.GetDirectory().GetCurrentBinary(); + default: break; } return 0; } @@ -105,7 +109,8 @@ std::string cmOutputConverter::Convert(const std::string& source, break; case START: result = this->ConvertToRelativePath( - this->StateSnapshot.GetCurrentSourceDirectoryComponents(), result); + this->StateSnapshot.GetDirectory().GetCurrentSourceComponents(), + result); break; case HOME_OUTPUT: result = this->ConvertToRelativePath( @@ -113,7 +118,8 @@ std::string cmOutputConverter::Convert(const std::string& source, break; case START_OUTPUT: result = this->ConvertToRelativePath( - this->StateSnapshot.GetCurrentBinaryDirectoryComponents(), result); + this->StateSnapshot.GetDirectory().GetCurrentBinaryComponents(), + result); break; case FULL: result = cmSystemTools::CollapseFullPath(result); @@ -213,13 +219,13 @@ cmOutputConverter::ConvertToRelativePath(const std::vector<std::string>& local, // or both in the binary tree. std::string local_path = cmSystemTools::JoinPath(local); if(!((cmOutputConverterNotAbove(local_path.c_str(), - this->StateSnapshot.GetRelativePathTopBinary()) && - cmOutputConverterNotAbove(in_remote.c_str(), - this->StateSnapshot.GetRelativePathTopBinary())) || - (cmOutputConverterNotAbove(local_path.c_str(), - this->StateSnapshot.GetRelativePathTopSource()) && - cmOutputConverterNotAbove(in_remote.c_str(), - this->StateSnapshot.GetRelativePathTopSource())))) + this->StateSnapshot.GetDirectory().GetRelativePathTopBinary()) + && cmOutputConverterNotAbove(in_remote.c_str(), + this->StateSnapshot.GetDirectory().GetRelativePathTopBinary())) + || (cmOutputConverterNotAbove(local_path.c_str(), + this->StateSnapshot.GetDirectory().GetRelativePathTopSource()) + && cmOutputConverterNotAbove(in_remote.c_str(), + this->StateSnapshot.GetDirectory().GetRelativePathTopSource())))) { return in_remote; } |