MCPcopy Create free account
hub / github.com/Kitware/CMake / GenerateSolution

Method GenerateSolution

Source/cmGlobalVisualStudioGenerator.cxx:1200–1230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1198}
1199
1200void cmGlobalVisualStudioGenerator::GenerateSolution(
1201 cmLocalGenerator const* root,
1202 std::vector<cmLocalGenerator*> const& generators)
1203{
1204 if (generators.empty()) {
1205 return;
1206 }
1207
1208 // Collect all targets under this root generator and the transitive
1209 // closure of their dependencies.
1210 TargetDependSet const projectTargets =
1211 this->GetTargetsForProject(root, generators);
1212
1213 std::string fname = GetSLNFile(root);
1214 cmGeneratedFileStream fout(fname);
1215 fout.SetCopyIfDifferent(true);
1216 if (!fout) {
1217 return;
1218 }
1219
1220 cm::VS::Solution const solution = this->CreateSolution(root, projectTargets);
1221 if (this->Version >= cmGlobalVisualStudioGenerator::VSVersion::VS18) {
1222 WriteSlnx(fout, solution);
1223 } else {
1224 WriteSln(fout, solution);
1225 }
1226
1227 if (fout.Close()) {
1228 this->FileReplacedDuringGenerate(fname);
1229 }
1230}

Callers 1

GenerateMethod · 0.95

Calls 8

CreateSolutionMethod · 0.95
WriteSlnxFunction · 0.85
WriteSlnFunction · 0.85
GetTargetsForProjectMethod · 0.80
SetCopyIfDifferentMethod · 0.80
CloseMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected