Note that the blind replacement you are doing breaks the JSON if there are newlines not already represented by
\nin any string content.
You mean strings used inside the json elements? At least I can and do take care of those beforehand. So, what the ‘cache handler’ recognizes, are new lines after json elements (and these are created by string(JSON...)) - strings, lists, objects, etc. - I assume
Which leads to the question: What exactly is cmake itself 'truncating" here?