[cmake-commits] martink committed cmGlobalGenerator.cxx 1.223 1.224

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Feb 1 16:05:43 EST 2008


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv339/Source

Modified Files:
	cmGlobalGenerator.cxx 
Log Message:
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


Index: cmGlobalGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalGenerator.cxx,v
retrieving revision 1.223
retrieving revision 1.224
diff -u -d -r1.223 -r1.224
--- cmGlobalGenerator.cxx	31 Jan 2008 17:19:00 -0000	1.223
+++ cmGlobalGenerator.cxx	1 Feb 2008 21:05:40 -0000	1.224
@@ -998,31 +998,49 @@
   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 @@
       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 @@
        makeCommand.c_str());
     if (output)
       {
+      *output += *outputPtr;
       *output += "\nGenerator: execution of make failed. Make command was: "
         + makeCommand + "\n";
       }
@@ -1053,7 +1083,10 @@
     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



More information about the Cmake-commits mailing list