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

Method ProcessComponents

Source/CPack/cmCPackInnoSetupGenerator.cxx:571–757  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

569}
570
571bool cmCPackInnoSetupGenerator::ProcessComponents()
572{
573 codeIncludes.emplace_back(
574 "{ The following lines are required by CPack because "
575 "this script uses components }");
576
577 // Installation types
578 std::vector<cmCPackInstallationType*> types(InstallationTypes.size());
579 for (auto& i : InstallationTypes) {
580 types[i.second.Index - 1] = &i.second;
581 }
582
583 std::vector<std::string> allTypes; // For required components
584 for (cmCPackInstallationType* i : types) {
585 cmCPackInnoSetupKeyValuePairs params;
586
587 params["Name"] = Quote(i->Name);
588 params["Description"] = Quote(i->DisplayName);
589
590 allTypes.push_back(i->Name);
591 typeInstructions.push_back(ISKeyValueLine(params));
592 }
593
594 // Inno Setup requires the additional "custom" type
595 cmCPackInnoSetupKeyValuePairs customTypeParams;
596
597 customTypeParams["Name"] = "\"custom\"";
598 customTypeParams["Description"] =
599 "\"{code:CPackGetCustomInstallationMessage}\"";
600 customTypeParams["Flags"] = "iscustom";
601
602 allTypes.emplace_back("custom");
603 typeInstructions.push_back(ISKeyValueLine(customTypeParams));
604
605 // Components
606 std::vector<cmCPackComponent*> downloadedComponents;
607 for (auto& i : Components) {
608 cmCPackInnoSetupKeyValuePairs params;
609 cmCPackComponent* component = &i.second;
610
611 if (component->IsHidden) {
612 continue;
613 }
614
615 CreateRecursiveComponentGroups(component->Group);
616
617 params["Name"] =
618 Quote(CreateRecursiveComponentPath(component->Group, component->Name));
619 params["Description"] = Quote(component->DisplayName);
620
621 if (component->IsRequired) {
622 params["Types"] = cmJoin(allTypes, " ");
623 params["Flags"] = "fixed";
624 } else if (!component->InstallationTypes.empty()) {
625 std::vector<std::string> installationTypes;
626
627 installationTypes.reserve(component->InstallationTypes.size());
628 for (cmCPackInstallationType* j : component->InstallationTypes) {

Callers

nothing calls this directly

Calls 13

cmHasSuffixFunction · 0.85
cmNonemptyFunction · 0.85
to_stringFunction · 0.85
emplace_backMethod · 0.80
push_backMethod · 0.80
reserveMethod · 0.80
GetCStrMethod · 0.80
cmJoinFunction · 0.50
cmStrCatFunction · 0.50
FileExistsFunction · 0.50
sizeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected