diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2004-02-24 15:04:02 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2004-02-24 15:04:02 (GMT) |
commit | c6c1f7001284d1e33e026d393cf689ea65547a36 (patch) | |
tree | 32540d5d782d92447eeed47d16710de1c7425d14 | |
parent | 34b8852dbe07e89b5f073c5c3c03e666c08b7a21 (diff) | |
download | CMake-c6c1f7001284d1e33e026d393cf689ea65547a36.zip CMake-c6c1f7001284d1e33e026d393cf689ea65547a36.tar.gz CMake-c6c1f7001284d1e33e026d393cf689ea65547a36.tar.bz2 |
ENH: Put Process execution errors in output and honor verbosity
-rw-r--r-- | Source/cmSystemTools.cxx | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 43206c8..edb88b5 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -478,17 +478,32 @@ bool cmSystemTools::RunSingleCommand( } else if(cmsysProcess_GetState(cp) == cmsysProcess_State_Exception) { - std::cerr << cmsysProcess_GetExceptionString(cp) << "\n"; + const char* exception_str = cmsysProcess_GetExceptionString(cp); + if ( verbose ) + { + std::cerr << exception_str << std::endl; + } + output->append(exception_str, strlen(exception_str)); result = false; } else if(cmsysProcess_GetState(cp) == cmsysProcess_State_Error) { - std::cerr << cmsysProcess_GetErrorString(cp) << "\n"; + const char* error_str = cmsysProcess_GetErrorString(cp); + if ( verbose ) + { + std::cerr << error_str << std::endl; + } + output->append(error_str, strlen(error_str)); result = false; } else if(cmsysProcess_GetState(cp) == cmsysProcess_State_Expired) { - std::cerr << "Process terminated due to timeout\n"; + const char* error_str = "Process terminated due to timeout\n"; + if ( verbose ) + { + std::cerr << error_str << std::endl; + } + output->append(error_str, strlen(error_str)); result = false; } |