ENH: Enable capture of output from VCExpress.exe and devenv.exe.

This commit is contained in:
Brad King 2006-02-15 10:22:55 -05:00
parent 79b7e0c37c
commit f2cf7e9197
4 changed files with 22 additions and 0 deletions

View File

@ -255,6 +255,9 @@ cmCTest::cmCTest()
{ {
it->second->SetCTestInstance(this); it->second->SetCTestInstance(this);
} }
// Make sure we can capture the build tool output.
cmSystemTools::EnableVSConsoleOutput();
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -1266,6 +1266,20 @@ bool cmSystemTools::PutEnv(const char* value)
return ret == 0; return ret == 0;
} }
void cmSystemTools::EnableVSConsoleOutput()
{
// Visual Studio 8 2005 (devenv.exe or VCExpress.exe) will not
// display output to the console unless this environment variable is
// set. We need it to capture the output of these build tools.
// Note for future work that one could pass "/out \\.\pipe\NAME" to
// either of these executables where NAME is created with
// CreateNamedPipe. This would bypass the internal buffering of the
// output and allow it to be captured on the fly.
#ifdef _WIN32
cmSystemTools::PutEnv("vsconsoleoutput=1");
#endif
}
std::string cmSystemTools::MakeXMLSafe(const char* str) std::string cmSystemTools::MakeXMLSafe(const char* str)
{ {
std::vector<char> result; std::vector<char> result;

View File

@ -291,6 +291,9 @@ public:
of the form var=value */ of the form var=value */
static bool PutEnv(const char* value); static bool PutEnv(const char* value);
/** Setup the environment to enable VS 8 IDE output. */
static void EnableVSConsoleOutput();
/** Make string XML safe */ /** Make string XML safe */
static std::string MakeXMLSafe(const char* str); static std::string MakeXMLSafe(const char* str);

View File

@ -148,6 +148,8 @@ cmake::cmake()
this->AddDefaultGenerators(); this->AddDefaultGenerators();
this->AddDefaultCommands(); this->AddDefaultCommands();
// Make sure we can capture the build tool output.
cmSystemTools::EnableVSConsoleOutput();
} }
cmake::~cmake() cmake::~cmake()