diff options
author | Brad King <brad.king@kitware.com> | 2006-02-15 15:22:55 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2006-02-15 15:22:55 (GMT) |
commit | f2cf7e91973c6275bdca98fc106d5406e23be40d (patch) | |
tree | 33aed79eda1d55da6c1dcac9ef85d205e7e850a4 | |
parent | 79b7e0c37cb60a44b4311e47a1dcc575dedd5acb (diff) | |
download | CMake-f2cf7e91973c6275bdca98fc106d5406e23be40d.zip CMake-f2cf7e91973c6275bdca98fc106d5406e23be40d.tar.gz CMake-f2cf7e91973c6275bdca98fc106d5406e23be40d.tar.bz2 |
ENH: Enable capture of output from VCExpress.exe and devenv.exe.
-rw-r--r-- | Source/cmCTest.cxx | 3 | ||||
-rw-r--r-- | Source/cmSystemTools.cxx | 14 | ||||
-rw-r--r-- | Source/cmSystemTools.h | 3 | ||||
-rw-r--r-- | Source/cmake.cxx | 2 |
4 files changed, 22 insertions, 0 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index fd96447..cffcfea 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -255,6 +255,9 @@ cmCTest::cmCTest() { it->second->SetCTestInstance(this); } + + // Make sure we can capture the build tool output. + cmSystemTools::EnableVSConsoleOutput(); } //---------------------------------------------------------------------- diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 1bee080..abe3ed6 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1266,6 +1266,20 @@ bool cmSystemTools::PutEnv(const char* value) 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::vector<char> result; diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index a07a7b8..264eaf8 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -291,6 +291,9 @@ public: of the form var=value */ static bool PutEnv(const char* value); + /** Setup the environment to enable VS 8 IDE output. */ + static void EnableVSConsoleOutput(); + /** Make string XML safe */ static std::string MakeXMLSafe(const char* str); diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 6033565..c730548 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -148,6 +148,8 @@ cmake::cmake() this->AddDefaultGenerators(); this->AddDefaultCommands(); + // Make sure we can capture the build tool output. + cmSystemTools::EnableVSConsoleOutput(); } cmake::~cmake() |