diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2006-03-17 16:14:14 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2006-03-17 16:14:14 (GMT) |
commit | fe1fda64310caad84e183da3a2e830b293578ceb (patch) | |
tree | 457a23bf8050e175b92183e3e3e3847887cd9fb9 /Source/cmake.cxx | |
parent | f44fedd3e9e249d1587b12b01e50725089557c36 (diff) | |
download | CMake-fe1fda64310caad84e183da3a2e830b293578ceb.zip CMake-fe1fda64310caad84e183da3a2e830b293578ceb.tar.gz CMake-fe1fda64310caad84e183da3a2e830b293578ceb.tar.bz2 |
ENH: Use vector of plain strings and add cmake -E command for getting environment
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r-- | Source/cmake.cxx | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 8411b92..ef43c61 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -745,18 +745,18 @@ void CMakeCommandUsage(const char* program) "content to directory 'destination'\n" << " compare_files file1 file2 - check if file1 is same as file2\n" << " echo [string]... - displays arguments as text\n" + << " environment - display the current enviroment\n" << " remove file1 file2 ... - remove the file(s)\n" << " tar [cxt][vfz] file.tar file/dir1 file/dir2 ... - create a tar.\n" - << " time command [args] ... - run command and return elapsed time\n"; + << " time command [args] ... - run command and return elapsed time\n" #if defined(_WIN32) && !defined(__CYGWIN__) - errorStream << " write_regv key value - write registry value\n" << " delete_regv key - delete registry value\n" - << " comspec - on windows 9x use this for RunCommand\n"; + << " comspec - on windows 9x use this for RunCommand\n" #else - errorStream - << " create_symlink old new - create a symbolic link new -> old\n"; + << " create_symlink old new - create a symbolic link new -> old\n" #endif + ; cmSystemTools::Error(errorStream.str().c_str()); } @@ -831,6 +831,19 @@ int cmake::ExecuteCMakeCommand(std::vector<std::string>& args) return 0; } + // Command to create a symbolic link. Fails on platforms not + // supporting them. + else if (args[1] == "environment" ) + { + std::vector<std::string> env = cmSystemTools::GetEnvironmentVariables(); + std::vector<std::string>::iterator it; + for ( it = env.begin(); it != env.end(); ++ it ) + { + std::cout << it->c_str() << std::endl; + } + return 0; + } + // Remove file else if (args[1] == "remove" && args.size() > 2) { |