summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2006-03-17 15:58:37 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2006-03-17 15:58:37 (GMT)
commitf44fedd3e9e249d1587b12b01e50725089557c36 (patch)
tree4244f4fd4e67f6682f8e14e459d59d36ffdfabc2 /Source/cmSystemTools.cxx
parentc499c0d2735b972e688caa1baa76ca7eea99f442 (diff)
downloadCMake-f44fedd3e9e249d1587b12b01e50725089557c36.zip
CMake-f44fedd3e9e249d1587b12b01e50725089557c36.tar.gz
CMake-f44fedd3e9e249d1587b12b01e50725089557c36.tar.bz2
ENH: Add access for all environment variables
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index e32fc53..b140e31 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -56,6 +56,8 @@
# pragma set woff 1375 /* base class destructor not virtual */
#endif
+extern char** environ; // For GetEnvironmentVariables
+
bool cmSystemTools::s_RunCommandHideConsole = false;
bool cmSystemTools::s_DisableRunCommandOutput = false;
bool cmSystemTools::s_ErrorOccured = false;
@@ -1278,6 +1280,17 @@ bool cmSystemTools::PutEnv(const char* value)
return ret == 0;
}
+std::vector<cmStdString> cmSystemTools::GetEnvironmentVariables()
+{
+ std::vector<cmStdString> env;
+ int cc;
+ for ( cc = 0; environ[cc]; ++ cc )
+ {
+ env.push_back(environ[cc]);
+ }
+ return env;
+}
+
void cmSystemTools::EnableVSConsoleOutput()
{
// Visual Studio 8 2005 (devenv.exe or VCExpress.exe) will not