<div dir="ltr">Hi all,<div><br></div><div style>We have a rather big project and use cmake for building it. At some point our cmake scripts became very slow (around 4 minutes for single cmake run). We are thinking now how to speed up it. Searching the web and this list didn't give any results. It looks like there is no such thing as profiler for cmake scripts. Am I right?</div>
<div style><br></div><div style>What about adding such capability to cmake? It looks like cmake's trace provides enough info for time profiling, the only thing that it lacks is a time stamp. Below is a small patch that adds time stamp and nesting level (to simplify building a stack trace) to each trace line. Would it be possible to integrate this change to the main line or are there better options for time profiling of cmake?</div>
<div style><br></div><div style><div>diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx</div><div>index 25ccbc7..0e6725c 100644</div><div>--- a/Source/cmMakefile.cxx</div><div>+++ b/Source/cmMakefile.cxx</div><div>
@@ -361,6 +361,8 @@ bool cmMakefile::GetBacktrace(cmListFileBacktrace& backtrace) const</div><div> void cmMakefile::PrintCommandTrace(const cmListFileFunction& lff)</div><div> {</div><div> cmOStringStream msg;</div>
<div>+ msg << "(" << std::fixed << cmSystemTools::GetTime();</div><div>+ msg << ") (" << this->CallStack.size() << ") ";</div><div> msg << lff.FilePath << "(" << lff.Line << "): ";</div>
<div> msg << lff.Name << "(";</div><div> for(std::vector<cmListFileArgument>::const_iterator i =</div></div></div>