Maybe it would make sense just to get rid of legacy stuff and cmake and move to msbuild and .net 6 (which would work on both windows and linux). That would improve maintainability quite a bit, as on every new VS version and framework version - there are issues to be fixed.