diff options
author | Brad King <brad.king@kitware.com> | 2016-09-19 17:47:51 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-09-19 18:00:50 (GMT) |
commit | d0be1e15c383f17502d0f47a36d16ba3571b0b79 (patch) | |
tree | b4355818f7516e5cc63ceefda6108cd7c22c6e53 /Source/cmState.cxx | |
parent | cbca65826c2bf49ba8c99efe8fa315d2942c4836 (diff) | |
download | CMake-d0be1e15c383f17502d0f47a36d16ba3571b0b79.zip CMake-d0be1e15c383f17502d0f47a36d16ba3571b0b79.tar.gz CMake-d0be1e15c383f17502d0f47a36d16ba3571b0b79.tar.bz2 |
Add directory properties to get source and binary directories
Add SOURCE_DIR and BINARY_DIR directory properties that return the
absolute paths to the corresponding directories. These correspond
to the target properties of the same names that we already have.
Diffstat (limited to 'Source/cmState.cxx')
-rw-r--r-- | Source/cmState.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/cmState.cxx b/Source/cmState.cxx index 37e41ad..6b37b92 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -29,7 +29,9 @@ #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 @@ -1673,6 +1675,14 @@ 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 = |