diff options
author | Brad King <brad.king@kitware.com> | 2013-11-15 18:30:10 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-11-15 19:40:55 (GMT) |
commit | ee6e4ac841d8094b59cd0a48c61d7ca3b68c68c2 (patch) | |
tree | 80e2f1de5cd9711726ab9951a32d1e16e6984a76 /Source | |
parent | 2d072069e2ef44780c214c847285df8ed8e70bba (diff) | |
download | CMake-ee6e4ac841d8094b59cd0a48c61d7ca3b68c68c2.zip CMake-ee6e4ac841d8094b59cd0a48c61d7ca3b68c68c2.tar.gz CMake-ee6e4ac841d8094b59cd0a48c61d7ca3b68c68c2.tar.bz2 |
cmSystemTools: Add RunSingleCommand overload for std::vector<std::string>
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmSystemTools.cxx | 18 | ||||
-rw-r--r-- | Source/cmSystemTools.h | 5 |
2 files changed, 22 insertions, 1 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index f5376eb..8a0d8dc 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -616,8 +616,24 @@ bool cmSystemTools::RunSingleCommand(std::vector<cmStdString>const& command, OutputOption outputflag , double timeout ) { + std::vector<std::string> cmd; + for(std::vector<cmStdString>::const_iterator i = command.begin(); + i != command.end(); ++i) + { + cmd.push_back(*i); + } + return cmSystemTools::RunSingleCommand(cmd, output, retVal, dir, + outputflag, timeout); +} + +bool cmSystemTools::RunSingleCommand(std::vector<std::string>const& command, + std::string* output , + int* retVal , const char* dir , + OutputOption outputflag , + double timeout ) +{ std::vector<const char*> argv; - for(std::vector<cmStdString>::const_iterator a = command.begin(); + for(std::vector<std::string>::const_iterator a = command.begin(); a != command.end(); ++a) { argv.push_back(a->c_str()); diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 69f6381..95c7029 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -228,6 +228,11 @@ public: * the command to run, and each argument to the command should * be in comand[1]...command[command.size()] */ + static bool RunSingleCommand(std::vector<std::string> const& command, + std::string* output = 0, + int* retVal = 0, const char* dir = 0, + OutputOption outputflag = OUTPUT_MERGE, + double timeout = 0.0); static bool RunSingleCommand(std::vector<cmStdString> const& command, std::string* output = 0, int* retVal = 0, const char* dir = 0, |