diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmMakefile.cxx | 16 | ||||
-rw-r--r-- | Source/cmake.cxx | 8 | ||||
-rw-r--r-- | Source/cmake.h | 3 | ||||
-rw-r--r-- | Source/cmakemain.cxx | 1 |
4 files changed, 26 insertions, 2 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index ae69b24..7c98970 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -307,10 +307,21 @@ void cmMakefile::PrintCommandTrace(const cmListFileFunction& lff) const std::ostringstream msg; msg << this->GetExecutionFilePath() << "(" << lff.Line << "): "; msg << lff.Name << "("; + bool expand = this->GetCMakeInstance()->GetTraceExpand(); + std::string temp; for(std::vector<cmListFileArgument>::const_iterator i = lff.Arguments.begin(); i != lff.Arguments.end(); ++i) { - msg << i->Value; + if (expand) + { + temp = i->Value; + this->ExpandVariablesInString(temp); + msg << temp; + } + else + { + msg << i->Value; + } msg << " "; } msg << ")"; @@ -4802,7 +4813,8 @@ bool cmMakefile::PolicyOptionalWarningEnabled(std::string const& var) return cmSystemTools::IsOn(val); } } - // Enable optional policy warnings with --debug-output or --trace. + // Enable optional policy warnings with --debug-output, --trace, + // or --trace-expand. cmake* cm = this->GetCMakeInstance(); return cm->GetDebugOutput() || cm->GetTrace(); } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 7bf3832..6abdbed 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -121,6 +121,7 @@ void cmWarnUnusedCliWarning(const std::string& variable, cmake::cmake() { this->Trace = false; + this->TraceExpand = false; this->WarnUninitialized = false; this->WarnUnused = false; this->WarnUnusedCli = true; @@ -617,10 +618,17 @@ void cmake::SetArgs(const std::vector<std::string>& args, std::cout << "Running with debug output on.\n"; this->SetDebugOutputOn(true); } + else if(arg.find("--trace-expand",0) == 0) + { + std::cout << "Running with expanded trace output on.\n"; + this->SetTrace(true); + this->SetTraceExpand(true); + } else if(arg.find("--trace",0) == 0) { std::cout << "Running with trace output on.\n"; this->SetTrace(true); + this->SetTraceExpand(false); } else if(arg.find("--warn-uninitialized",0) == 0) { diff --git a/Source/cmake.h b/Source/cmake.h index f0f9411..20e49e3 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -270,6 +270,8 @@ class cmake // Do we want trace output during the cmake run. bool GetTrace() { return this->Trace;} void SetTrace(bool b) { this->Trace = b;} + bool GetTraceExpand() { return this->TraceExpand;} + void SetTraceExpand(bool b) { this->TraceExpand = b;} bool GetWarnUninitialized() { return this->WarnUninitialized;} void SetWarnUninitialized(bool b) { this->WarnUninitialized = b;} bool GetWarnUnused() { return this->WarnUnused;} @@ -378,6 +380,7 @@ private: WorkingMode CurrentWorkingMode; bool DebugOutput; bool Trace; + bool TraceExpand; bool WarnUninitialized; bool WarnUnused; bool WarnUnusedCli; diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index c94ffec..a06b26f 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -83,6 +83,7 @@ static const char * cmDocumentationOptions[][2] = "useful on one try_compile at a time."}, {"--debug-output", "Put cmake in a debug mode."}, {"--trace", "Put cmake in trace mode."}, + {"--trace-expand", "Put cmake in trace mode with variable expansion."}, {"--warn-uninitialized", "Warn about uninitialized values."}, {"--warn-unused-vars", "Warn about unused variables."}, {"--no-warn-unused-cli", "Don't warn about command line options."}, |