<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Dec 15, 2020, 17:23 Kevin AndrĂ© <<a href="mailto:hyperquantum@gmail.com">hyperquantum@gmail.com</a>> wrote:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I think it could be done without understanding the structure of a<br>
CMake file, but with some kind of pattern matching instead. Try to<br>
emulate what a person would do when a new file is to be added: find<br>
out where the pre-existing source files are in the CMake file, and<br>
insert the name of the new file using the same pattern used for the<br>
existing files.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">This goes up in flames when the CMakeLists.txt file is in an unusual place. But creator can error out and warn.</div><div dir="auto"><br></div><div dir="auto">It also goes up in flames when several targets are defined in one CMakeLists.txt file. Creator might add your file to the wrong target then and has no way to notice this.</div><div dir="auto"><br></div><div dir="auto">Adding files into cmake does not work as long as the tool doing the insertion is able to understand cmake code. There is no way around that, cmake projects differ to much from each other and best practices to make anything else possible.</div><div dir="auto"><br></div><div dir="auto">Best Regards,</div><div dir="auto">Tobias</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>