Browse Source

cmStateSnapshot: Add method to get current directory snapshot

Brad King 7 years ago
parent
commit
03d40110dc
2 changed files with 7 additions and 0 deletions
  1. 6 0
      Source/cmStateSnapshot.cxx
  2. 1 0
      Source/cmStateSnapshot.h

+ 6 - 0
Source/cmStateSnapshot.cxx

@@ -66,6 +66,12 @@ bool cmStateSnapshot::IsValid() const
     : false;
     : false;
 }
 }
 
 
+cmStateSnapshot cmStateSnapshot::GetBuildsystemDirectory() const
+{
+  return cmStateSnapshot(this->State,
+                         this->Position->BuildSystemDirectory->DirectoryEnd);
+}
+
 cmStateSnapshot cmStateSnapshot::GetBuildsystemDirectoryParent() const
 cmStateSnapshot cmStateSnapshot::GetBuildsystemDirectoryParent() const
 {
 {
   cmStateSnapshot snapshot;
   cmStateSnapshot snapshot;

+ 1 - 0
Source/cmStateSnapshot.h

@@ -37,6 +37,7 @@ public:
   std::vector<cmStateSnapshot> GetChildren();
   std::vector<cmStateSnapshot> GetChildren();
 
 
   bool IsValid() const;
   bool IsValid() const;
+  cmStateSnapshot GetBuildsystemDirectory() const;
   cmStateSnapshot GetBuildsystemDirectoryParent() const;
   cmStateSnapshot GetBuildsystemDirectoryParent() const;
   cmStateSnapshot GetCallStackParent() const;
   cmStateSnapshot GetCallStackParent() const;
   cmStateSnapshot GetCallStackBottom() const;
   cmStateSnapshot GetCallStackBottom() const;