diff options
Diffstat (limited to 'Source/cmState.cxx')
-rw-r--r-- | Source/cmState.cxx | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/Source/cmState.cxx b/Source/cmState.cxx index ffb104b..6b37b92 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -29,6 +29,11 @@ #include <string.h> #include <utility> +static std::string const kBINARY_DIR = "BINARY_DIR"; +static std::string const kBUILDSYSTEM_TARGETS = "BUILDSYSTEM_TARGETS"; +static std::string const kSOURCE_DIR = "SOURCE_DIR"; +static std::string const kSUBDIRECTORIES = "SUBDIRECTORIES"; + struct cmState::SnapshotDataType { cmState::PositionType ScopeParent; @@ -94,6 +99,8 @@ struct cmState::BuildsystemDirectoryStateType std::vector<std::string> CompileOptions; std::vector<cmListFileBacktrace> CompileOptionsBacktraces; + std::vector<std::string> NormalTargetNames; + std::string ProjectName; cmPropertyMap Properties; @@ -324,6 +331,7 @@ cmState::Snapshot cmState::Reset() it->CompileOptions.clear(); it->CompileOptionsBacktraces.clear(); it->DirectoryEnd = pos; + it->NormalTargetNames.clear(); it->Properties.clear(); it->Children.clear(); } @@ -1667,6 +1675,30 @@ const char* cmState::Directory::GetProperty(const std::string& prop, } return ""; } + if (prop == kBINARY_DIR) { + output = this->GetCurrentBinary(); + return output.c_str(); + } + if (prop == kSOURCE_DIR) { + output = this->GetCurrentSource(); + return output.c_str(); + } + if (prop == kSUBDIRECTORIES) { + std::vector<std::string> child_dirs; + std::vector<cmState::Snapshot> const& children = + this->DirectoryState->Children; + for (std::vector<cmState::Snapshot>::const_iterator ci = children.begin(); + ci != children.end(); ++ci) { + child_dirs.push_back(ci->GetDirectory().GetCurrentSource()); + } + output = cmJoin(child_dirs, ";"); + return output.c_str(); + } + if (prop == kBUILDSYSTEM_TARGETS) { + output = cmJoin(this->DirectoryState->NormalTargetNames, ";"); + return output.c_str(); + } + if (prop == "LISTFILE_STACK") { std::vector<std::string> listFiles; cmState::Snapshot snp = this->Snapshot_; @@ -1733,6 +1765,11 @@ std::vector<std::string> cmState::Directory::GetPropertyKeys() const return keys; } +void cmState::Directory::AddNormalTargetName(std::string const& name) +{ + this->DirectoryState->NormalTargetNames.push_back(name); +} + bool operator==(const cmState::Snapshot& lhs, const cmState::Snapshot& rhs) { return lhs.Position == rhs.Position; |