diff options
author | David Cole <david.cole@kitware.com> | 2009-12-23 19:34:46 (GMT) |
---|---|---|
committer | David Cole <david.cole@kitware.com> | 2009-12-23 19:34:46 (GMT) |
commit | 4d3a387ac6cca006ca3b35c67f562fa15702fa4c (patch) | |
tree | f7d0f06bf126cc88243847f982c37cfd9eb68a5b /Source/cmSystemTools.cxx | |
parent | 68ed752b7db18013641683c139c3aa0671f2d757 (diff) | |
download | CMake-4d3a387ac6cca006ca3b35c67f562fa15702fa4c.zip CMake-4d3a387ac6cca006ca3b35c67f562fa15702fa4c.tar.gz CMake-4d3a387ac6cca006ca3b35c67f562fa15702fa4c.tar.bz2 |
Preserve environment variables across calls to cmCTestScriptHandler::RunConfigurationScript. This will help prevent problems like we are currently experiencing (regarding CMake continuous dashboards only running once each day because the HOME environment variable is modified indirectly by a command in a called script, but affects the environment in the calling script).
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r-- | Source/cmSystemTools.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 89a241d..351e1b1 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1673,6 +1673,18 @@ void cmSystemTools::RestoreEnv(const std::vector<std::string>& env) PutEnv(eit->c_str()); } } + +//---------------------------------------------------------------------- +cmSystemTools::SaveRestoreEnvironment::SaveRestoreEnvironment() +{ + this->Env = cmSystemTools::GetEnvironmentVariables(); +} + +//---------------------------------------------------------------------- +cmSystemTools::SaveRestoreEnvironment::~SaveRestoreEnvironment() +{ + cmSystemTools::RestoreEnv(this->Env); +} #endif void cmSystemTools::EnableVSConsoleOutput() |