diff options
author | Ken Martin <ken.martin@kitware.com> | 2001-08-23 15:12:19 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2001-08-23 15:12:19 (GMT) |
commit | 2190ddc4e931339c7f55f2fe7bbb4038c0a1199a (patch) | |
tree | ed3d1ac37a83d827b3bfc08a04356dd0608da34d /Source/cmSystemTools.cxx | |
parent | abff98fb9dfb72a69aa34eddd53c34a2cf208f35 (diff) | |
download | CMake-2190ddc4e931339c7f55f2fe7bbb4038c0a1199a.zip CMake-2190ddc4e931339c7f55f2fe7bbb4038c0a1199a.tar.gz CMake-2190ddc4e931339c7f55f2fe7bbb4038c0a1199a.tar.bz2 |
added test driver for make test target
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r-- | Source/cmSystemTools.cxx | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index bd2eb70..8ecd0c3 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -825,16 +825,24 @@ bool cmSystemTools::RunCommand(const char* command, std::string& output, bool verbose) { + int foo; + return cmSystemTools::RunCommand(command, output, foo, verbose); +} + +bool cmSystemTools::RunCommand(const char* command, + std::string& output, + int &retVal, bool verbose) +{ const int BUFFER_SIZE = 4096; char buffer[BUFFER_SIZE]; - + #if defined(WIN32) && !defined(__CYGWIN__) std::string commandToFile = command; commandToFile += " > "; std::string tempFile; tempFile += cmSystemTools::TemporaryFileName(); commandToFile += tempFile; - system(commandToFile.c_str()); + retVal = system(commandToFile.c_str()); std::ifstream fin(tempFile.c_str()); if(!fin) { @@ -879,7 +887,7 @@ bool cmSystemTools::RunCommand(const char* command, output += buffer; fgets(buffer, BUFFER_SIZE, cpipe); } - pclose(cpipe); + retVal = pclose(cpipe); return true; #endif } |