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

Method GetComponentPackageName

Source/CPack/IFW/cmCPackIFWGenerator.cxx:641–668  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

639}
640
641std::string cmCPackIFWGenerator::GetComponentPackageName(
642 cmCPackComponent* component) const
643{
644 std::string name;
645 if (!component) {
646 return name;
647 }
648 if (cmCPackIFWPackage* package = this->GetComponentPackage(component)) {
649 return package->Name;
650 }
651 std::string prefix = "CPACK_IFW_COMPONENT_" +
652 cmsys::SystemTools::UpperCase(component->Name) + "_";
653 cmValue option = this->GetOption(prefix + "NAME");
654 name = option ? *option : component->Name;
655 if (component->Group) {
656 cmCPackIFWPackage* package = this->GetGroupPackage(component->Group);
657 if ((this->componentPackageMethod ==
658 cmCPackGenerator::ONE_PACKAGE_PER_GROUP) ||
659 this->IsOn(prefix + "COMMON")) {
660 return package->Name;
661 }
662 bool dot = !this->ResolveDuplicateNames;
663 if (dot && !cmHasPrefix(name, package->Name)) {
664 name = package->Name + "." + name;
665 }
666 }
667 return name;
668}
669
670cmCPackIFWPackage* cmCPackIFWGenerator::GetGroupPackage(
671 cmCPackComponentGroup* group) const

Callers 3

GetComponentMethod · 0.95

Calls 5

GetComponentPackageMethod · 0.95
GetGroupPackageMethod · 0.95
cmHasPrefixFunction · 0.85
GetOptionMethod · 0.45
IsOnMethod · 0.45

Tested by

no test coverage detected