Browse Source

cmState: Truncate snapshot data in Initialize.

When Configure is executed multiple times with the same cmake
instance (either using CTest --two-config or a interactive gui), the
location and structural data was preserved though it would not be used
again.  Fix that by clearing the data in a method called early in
the configure step.
Stephen Kelly 10 years ago
parent
commit
83dc483e4e
1 changed files with 5 additions and 2 deletions
  1. 5 2
      Source/cmState.cxx

+ 5 - 2
Source/cmState.cxx

@@ -22,7 +22,6 @@ cmState::cmState(cmake* cm)
   : CMakeInstance(cm),
     IsInTryCompile(false)
 {
-  this->CreateSnapshot(Snapshot());
   this->Initialize();
 }
 
@@ -194,8 +193,12 @@ void cmState::RemoveCacheEntryProperty(std::string const& key,
 void cmState::Initialize()
 {
   this->GlobalProperties.clear();
-
   this->PropertyDefinitions.clear();
+  this->Locations.clear();
+  this->OutputLocations.clear();
+  this->ParentPositions.clear();
+
+  this->CreateSnapshot(Snapshot());
   this->DefineProperty
     ("RULE_LAUNCH_COMPILE", cmProperty::DIRECTORY,
      "", "", true);