/*************************************************************************************************** Copyright (C) 2025 The Qt Company Ltd. SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only ***************************************************************************************************/ namespace Test_Qt.DotNet.Project { internal static class CMake { public static string InjectQtSourcesTargets(params string[] extraSources) { var sources = string.Join(";", extraSources); const string xmlTemplate = """ = lines.Count) break; var indent = new string(lines[i].TakeWhile(char.IsWhiteSpace).ToArray()) + " "; foreach (var src in extra) lines.Insert(j++, indent + src); break; } File.WriteAllLines(CMakePath, lines); ]]> $(ProjectIntermediateDir)qtdotnet\native\source\ """; return xmlTemplate.Replace("__EXTRA_SOURCES__", sources); } } }