[cmake-commits] hoffman committed cmMessageCommand.cxx 1.19 1.20 cmake.cxx 1.268 1.269 cmake.h 1.70 1.71 cmakemain.cxx 1.54 1.55

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Oct 6 11:12:02 EDT 2006


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

Modified Files:
	cmMessageCommand.cxx cmake.cxx cmake.h cmakemain.cxx 
Log Message:
ENH: do not print a call stack if the user does a message error unless --debug-output is used


Index: cmake.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmake.h,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -d -r1.70 -r1.71
--- cmake.h	15 Jun 2006 20:17:11 -0000	1.70
+++ cmake.h	6 Oct 2006 15:11:59 -0000	1.71
@@ -281,6 +281,9 @@
   const char* GetCPackCommand();
   const char* GetCMakeCommand() { return this->CMakeCommand.c_str(); }
 
+  // Do we want debug output during the cmake run.
+  bool GetDebugOutput() { return this->DebugOutput; }
+  void DebugOutputOn() { this->DebugOutput = true;}
 protected:
   typedef cmGlobalGenerator* (*CreateGeneratorFunctionType)();
   typedef std::map<cmStdString,
@@ -326,13 +329,14 @@
   static int ExecuteLinkScript(std::vector<std::string>& args);
   
   cmVariableWatch* VariableWatch;
-
+  
 private:
   ProgressCallbackType ProgressCallback;
   void* ProgressCallbackClientData;
   bool Verbose;
   bool InTryCompile;
   bool ScriptMode;
+  bool DebugOutput;
   std::string CMakeCommand;
   std::string CXXEnvironment;
   std::string CCEnvironment;

Index: cmakemain.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmakemain.cxx,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -r1.54 -r1.55
--- cmakemain.cxx	7 Jun 2006 12:47:44 -0000	1.54
+++ cmakemain.cxx	6 Oct 2006 15:11:59 -0000	1.55
@@ -85,6 +85,9 @@
   {"--debug-trycompile", "Do not delete the try compile directories..",
    "Do not delete the files and directories created for try_compile calls. "
    "This is useful in debugging failed try_compiles."},
+  {"--debug-output", "Put cmake in a debug mode.",
+   "Print extra stuff during the cmake run like stack traces with "
+   "message(send_error ) calls."},
   {"--help-command cmd [file]", "Print help for a single command and exit.",
    "Full documentation specific to the given command is displayed."},
   {"--help-command-list [file]", "List available listfile commands and exit.",

Index: cmake.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmake.cxx,v
retrieving revision 1.268
retrieving revision 1.269
diff -u -d -r1.268 -r1.269
--- cmake.cxx	3 Oct 2006 15:55:55 -0000	1.268
+++ cmake.cxx	6 Oct 2006 15:11:59 -0000	1.269
@@ -111,6 +111,7 @@
 
 cmake::cmake()
 {
+  this->DebugOutput = false;
   this->DebugTryCompile = false;
   this->ClearBuildSystem = false;
   this->FileComparison = new cmFileTimeComparison;
@@ -446,6 +447,11 @@
       std::cout << "debug trycompile on\n";
       this->DebugTryCompileOn();
       }
+    else if(arg.find("--debug-output",0) == 0)
+      {
+      std::cout << "Running with debug output on.\n";
+      this->DebugOutputOn();
+      }
     else if(arg.find("-G",0) == 0)
       {
       std::string value = arg.substr(2);

Index: cmMessageCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMessageCommand.cxx,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- cmMessageCommand.cxx	22 Jun 2006 19:37:58 -0000	1.19
+++ cmMessageCommand.cxx	6 Oct 2006 15:11:59 -0000	1.20
@@ -59,8 +59,14 @@
 
   if (send_error || fatal_error)
     {
-    //cmSystemTools::Error(message.c_str());
-    this->SetError(message.c_str());
+    if( !this->Makefile->GetCMakeInstance()->GetDebugOutput())
+      {
+      cmSystemTools::Error(message.c_str());
+      }
+    else
+      {
+      this->SetError(message.c_str());
+      }
     }
   else
     {
@@ -77,6 +83,11 @@
     {
     cmSystemTools::SetFatalErrorOccured();
     }
-  return (!send_error && !fatal_error);
+  // if debug is on then retru
+  if(this->Makefile->GetCMakeInstance()->GetDebugOutput())
+    {
+    return (!send_error && !fatal_error);
+    }
+  return true;
 }
 



More information about the Cmake-commits mailing list