summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2008-02-01 21:05:40 (GMT)
committerKen Martin <ken.martin@kitware.com>2008-02-01 21:05:40 (GMT)
commit22835a71cd0948bc839011da1df72fd6b8233047 (patch)
treed4c18cd4ee59605c174282572f8da8115493ee6b /Source
parent0dac20cd20563fa5cc7f1a6c2f42ee7511e008cb (diff)
downloadCMake-22835a71cd0948bc839011da1df72fd6b8233047.zip
CMake-22835a71cd0948bc839011da1df72fd6b8233047.tar.gz
CMake-22835a71cd0948bc839011da1df72fd6b8233047.tar.bz2
ENH: really Bill, using Ken's checkout, fix output in ctest so clean output in build and test is not lost, also display the command lines used
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalGenerator.cxx45
1 files changed, 39 insertions, 6 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index a001f6d..0c7845f 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -998,31 +998,49 @@ int cmGlobalGenerator::Build(
bool clean, bool fast,
double timeout)
{
- *output += "\nTesting TryCompileWithoutMakefile\n";
-
/**
* Run an executable command and put the stdout in output.
*/
std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
cmSystemTools::ChangeDirectory(bindir);
+ if(output)
+ {
+ *output += "Change Dir: ";
+ *output += bindir;
+ *output += "\n";
+ }
int retVal;
bool hideconsole = cmSystemTools::GetRunCommandHideConsole();
cmSystemTools::SetRunCommandHideConsole(true);
-
+ std::string outputBuffer;
+ std::string* outputPtr = 0;
+ if(output)
+ {
+ outputPtr = &outputBuffer;
+ }
+
// should we do a clean first?
if (clean)
{
std::string cleanCommand =
this->GenerateBuildCommand(makeCommandCSTR, projectName,
0, "clean", config, false, fast);
- if (!cmSystemTools::RunSingleCommand(cleanCommand.c_str(), output,
+ if(output)
+ {
+ *output += "\nRun Clean Command:";
+ *output += cleanCommand;
+ *output += "\n";
+ }
+
+ if (!cmSystemTools::RunSingleCommand(cleanCommand.c_str(), outputPtr,
&retVal, 0, false, timeout))
{
cmSystemTools::SetRunCommandHideConsole(hideconsole);
cmSystemTools::Error("Generator: execution of make clean failed.");
if (output)
{
+ *output += *outputPtr;
*output += "\nGenerator: execution of make clean failed.\n";
}
@@ -1030,13 +1048,24 @@ int cmGlobalGenerator::Build(
cmSystemTools::ChangeDirectory(cwd.c_str());
return 1;
}
+ if (output)
+ {
+ *output += *outputPtr;
+ }
}
// now build
std::string makeCommand =
this->GenerateBuildCommand(makeCommandCSTR, projectName,
0, target, config, false, fast);
- if (!cmSystemTools::RunSingleCommand(makeCommand.c_str(), output,
+ if(output)
+ {
+ *output += "\nRun Build Command:";
+ *output += makeCommand;
+ *output += "\n";
+ }
+
+ if (!cmSystemTools::RunSingleCommand(makeCommand.c_str(), outputPtr,
&retVal, 0, false, timeout))
{
cmSystemTools::SetRunCommandHideConsole(hideconsole);
@@ -1045,6 +1074,7 @@ int cmGlobalGenerator::Build(
makeCommand.c_str());
if (output)
{
+ *output += *outputPtr;
*output += "\nGenerator: execution of make failed. Make command was: "
+ makeCommand + "\n";
}
@@ -1053,7 +1083,10 @@ int cmGlobalGenerator::Build(
cmSystemTools::ChangeDirectory(cwd.c_str());
return 1;
}
-
+ if (output)
+ {
+ *output += *outputPtr;
+ }
cmSystemTools::SetRunCommandHideConsole(hideconsole);
// The SGI MipsPro 7.3 compiler does not return an error code when