MCPcopy Create free account
hub / github.com/Kitware/CMake / IndentText

Function IndentText

Source/cmMessageCommand.cxx:29–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27namespace {
28
29std::string IndentText(std::string text, cmMakefile& mf)
30{
31 auto indent =
32 cmList{ mf.GetSafeDefinition("CMAKE_MESSAGE_INDENT") }.join("");
33
34 auto const showContext = mf.GetCMakeInstance()->GetShowLogContext() ||
35 mf.IsOn("CMAKE_MESSAGE_CONTEXT_SHOW");
36 if (showContext) {
37 auto context =
38 cmList{ mf.GetSafeDefinition("CMAKE_MESSAGE_CONTEXT") }.join(".");
39 if (!context.empty()) {
40 indent.insert(0u, cmStrCat("["_s, context, "] "_s));
41 }
42 }
43
44 if (!indent.empty()) {
45 cmSystemTools::ReplaceString(text, "\n", "\n" + indent);
46 text.insert(0u, indent);
47 }
48 return text;
49}
50
51void ReportCheckResult(cm::string_view what, std::string result,
52 cmMakefile& mf)

Callers 2

ReportCheckResultFunction · 0.85
cmMessageCommandFunction · 0.85

Calls 7

joinMethod · 0.80
GetShowLogContextMethod · 0.80
cmStrCatFunction · 0.70
GetCMakeInstanceMethod · 0.45
IsOnMethod · 0.45
emptyMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…