diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-05-04 21:08:19 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-05-16 06:12:01 (GMT) |
commit | 991f5e4968ce7b86aea12224b4cecc1be3ed92d9 (patch) | |
tree | ed86360fdaa42be85834ef9da62fdf23c3e15c7e /Source/cmState.cxx | |
parent | 57bdc1a2f7d416c106c4bef8f3543eec74c3c391 (diff) | |
download | CMake-991f5e4968ce7b86aea12224b4cecc1be3ed92d9.zip CMake-991f5e4968ce7b86aea12224b4cecc1be3ed92d9.tar.gz CMake-991f5e4968ce7b86aea12224b4cecc1be3ed92d9.tar.bz2 |
cmState::Snapshot: Store components for current directories.
Remove this responsibility from cmLocalGenerator.
Diffstat (limited to 'Source/cmState.cxx')
-rw-r--r-- | Source/cmState.cxx | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/Source/cmState.cxx b/Source/cmState.cxx index aa690dc..27a36bc 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -197,6 +197,8 @@ void cmState::Initialize() this->Locations.clear(); this->OutputLocations.clear(); this->ParentPositions.clear(); + this->CurrentSourceDirectoryComponents.clear(); + this->CurrentBinaryDirectoryComponents.clear(); this->CreateSnapshot(Snapshot()); this->DefineProperty @@ -500,6 +502,10 @@ cmState::Snapshot cmState::CreateSnapshot(Snapshot originSnapshot) this->ParentPositions.push_back(originSnapshot.Position); this->Locations.resize(this->Locations.size() + 1); this->OutputLocations.resize(this->OutputLocations.size() + 1); + this->CurrentSourceDirectoryComponents.resize( + this->CurrentSourceDirectoryComponents.size() + 1); + this->CurrentBinaryDirectoryComponents.resize( + this->CurrentBinaryDirectoryComponents.size() + 1); return cmState::Snapshot(this, pos); } @@ -523,6 +529,10 @@ void cmState::Snapshot::SetCurrentSourceDirectory(std::string const& dir) this->State->Locations[this->Position]); this->State->Locations[this->Position] = cmSystemTools::CollapseFullPath(this->State->Locations[this->Position]); + + cmSystemTools::SplitPath( + this->State->Locations[this->Position], + this->State->CurrentSourceDirectoryComponents[this->Position]); } const char* cmState::Snapshot::GetCurrentBinaryDirectory() const @@ -539,6 +549,22 @@ void cmState::Snapshot::SetCurrentBinaryDirectory(std::string const& dir) this->State->OutputLocations[this->Position] = cmSystemTools::CollapseFullPath( this->State->OutputLocations[this->Position]); + + cmSystemTools::SplitPath( + this->State->OutputLocations[this->Position], + this->State->CurrentBinaryDirectoryComponents[this->Position]); +} + +std::vector<std::string> const& +cmState::Snapshot::GetCurrentSourceDirectoryComponents() +{ + return this->State->CurrentSourceDirectoryComponents[this->Position]; +} + +std::vector<std::string> const& +cmState::Snapshot::GetCurrentBinaryDirectoryComponents() +{ + return this->State->CurrentBinaryDirectoryComponents[this->Position]; } bool cmState::Snapshot::IsValid() const |