CMake code rely on cmList class for CMake lists management (part. 1)

This commit is contained in:
Marc Chevrier
2023-04-14 16:48:16 +02:00
parent 51b0d45d91
commit e08ba229ee
77 changed files with 374 additions and 381 deletions
+4 -3
View File
@@ -10,6 +10,7 @@
#include "cmConfigureLog.h"
#include "cmExecutionStatus.h"
#include "cmList.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmMessenger.h"
@@ -31,13 +32,13 @@ enum class CheckingType
std::string IndentText(std::string text, cmMakefile& mf)
{
auto indent =
cmJoin(cmExpandedList(mf.GetSafeDefinition("CMAKE_MESSAGE_INDENT")), "");
cmList{ mf.GetSafeDefinition("CMAKE_MESSAGE_INDENT") }.join("");
const auto showContext = mf.GetCMakeInstance()->GetShowLogContext() ||
mf.IsOn("CMAKE_MESSAGE_CONTEXT_SHOW");
if (showContext) {
auto context = cmJoin(
cmExpandedList(mf.GetSafeDefinition("CMAKE_MESSAGE_CONTEXT")), ".");
auto context =
cmList{ mf.GetSafeDefinition("CMAKE_MESSAGE_CONTEXT") }.join(".");
if (!context.empty()) {
indent.insert(0u, cmStrCat("["_s, context, "] "_s));
}