[Cmake-commits] [cmake-commits] hoffman committed cmMakefile.cxx 1.477 1.478 cmake.cxx 1.390 1.391 cmake.h 1.115 1.116 cmakemain.cxx 1.81 1.82

cmake-commits at cmake.org cmake-commits at cmake.org
Thu Jul 31 10:33:27 EDT 2008


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

Modified Files:
	cmMakefile.cxx cmake.cxx cmake.h cmakemain.cxx 
Log Message:
ENH: add a --trace option


Index: cmake.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmake.h,v
retrieving revision 1.115
retrieving revision 1.116
diff -C 2 -d -r1.115 -r1.116
*** cmake.h	20 Jun 2008 20:25:01 -0000	1.115
--- cmake.h	31 Jul 2008 14:33:25 -0000	1.116
***************
*** 315,318 ****
--- 315,321 ----
    void SetDebugOutputOn(bool b) { this->DebugOutput = b;}
  
+   // Do we want trace output during the cmake run.
+   bool GetTrace() { return this->Trace;}
+   void SetTrace(bool b) {  this->Trace = b;}
    // Define a property
    void DefineProperty(const char *name, cmProperty::ScopeType scope,
***************
*** 439,442 ****
--- 442,446 ----
    bool ScriptMode;
    bool DebugOutput;
+   bool Trace;
    std::string CMakeEditCommand;
    std::string CMakeCommand;

Index: cmakemain.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmakemain.cxx,v
retrieving revision 1.81
retrieving revision 1.82
diff -C 2 -d -r1.81 -r1.82
*** cmakemain.cxx	13 May 2008 19:43:00 -0000	1.81
--- cmakemain.cxx	31 Jul 2008 14:33:25 -0000	1.82
***************
*** 102,105 ****
--- 102,108 ----
     "Print extra stuff during the cmake run like stack traces with "
     "message(send_error ) calls."},
+   {"--trace", "Put cmake in trace mode.",
+    "Print a trace of all calls made and from where 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. "

Index: cmake.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmake.cxx,v
retrieving revision 1.390
retrieving revision 1.391
diff -C 2 -d -r1.390 -r1.391
*** cmake.cxx	30 Jul 2008 19:26:34 -0000	1.390
--- cmake.cxx	31 Jul 2008 14:33:25 -0000	1.391
***************
*** 141,144 ****
--- 141,145 ----
  cmake::cmake()
  {
+   this->Trace = false;
    this->SuppressDevWarnings = false;
    this->DoSuppressDevWarnings = false;
***************
*** 619,622 ****
--- 620,628 ----
        this->SetDebugOutputOn(true);
        }
+     else if(arg.find("--trace",0) == 0)
+       {
+       std::cout << "Running with trace output on.\n";
+       this->SetTrace(true);
+       }
      else if(arg.find("-G",0) == 0)
        {

Index: cmMakefile.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefile.cxx,v
retrieving revision 1.477
retrieving revision 1.478
diff -C 2 -d -r1.477 -r1.478
*** cmMakefile.cxx	26 Jun 2008 17:30:10 -0000	1.477
--- cmMakefile.cxx	31 Jul 2008 14:33:25 -0000	1.478
***************
*** 396,399 ****
--- 396,414 ----
         (!this->GetCMakeInstance()->GetScriptMode() || pcmd->IsScriptable()))
        {
+       // if trace is one, print out invoke information
+       if(this->GetCMakeInstance()->GetTrace())
+         {
+         cmOStringStream msg;
+         msg << lff.FilePath << "(" << lff.Line << "):  ";
+         msg << lff.Name << "(";
+         for(std::vector<cmListFileArgument>::const_iterator i = 
+               lff.Arguments.begin(); i != lff.Arguments.end(); ++i)
+           {
+           msg << i->Value;
+           msg << " ";
+           }
+         msg << ")";
+         cmSystemTools::Message(msg.str().c_str());
+         }
        // Try invoking the command.
        if(!pcmd->InvokeInitialPass(lff.Arguments,status) ||



More information about the Cmake-commits mailing list