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

Method GetComponentGroup

Source/CPack/cmCPackGenerator.cxx:1806–1840  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1804}
1805
1806cmCPackComponentGroup* cmCPackGenerator::GetComponentGroup(
1807 std::string const& projectName, std::string const& name)
1808{
1809 (void)projectName;
1810 std::string macroPrefix =
1811 "CPACK_COMPONENT_GROUP_" + cmsys::SystemTools::UpperCase(name);
1812 bool hasGroup = this->ComponentGroups.count(name) != 0;
1813 cmCPackComponentGroup* group = &this->ComponentGroups[name];
1814 if (!hasGroup) {
1815 // Define the group
1816 group->Name = name;
1817 cmValue displayName = this->GetOption(macroPrefix + "_DISPLAY_NAME");
1818 if (cmNonempty(displayName)) {
1819 group->DisplayName = *displayName;
1820 } else {
1821 group->DisplayName = group->Name;
1822 }
1823
1824 cmValue description = this->GetOption(macroPrefix + "_DESCRIPTION");
1825 if (cmNonempty(description)) {
1826 group->Description = *description;
1827 }
1828 group->IsBold = this->IsOn(macroPrefix + "_BOLD_TITLE");
1829 group->IsExpandedByDefault = this->IsOn(macroPrefix + "_EXPANDED");
1830 cmValue parentGroupName = this->GetOption(macroPrefix + "_PARENT_GROUP");
1831 if (cmNonempty(parentGroupName)) {
1832 group->ParentGroup =
1833 this->GetComponentGroup(projectName, *parentGroupName);
1834 group->ParentGroup->Subgroups.push_back(group);
1835 } else {
1836 group->ParentGroup = nullptr;
1837 }
1838 }
1839 return group;
1840}

Callers 1

GetComponentMethod · 0.95

Calls 5

GetOptionMethod · 0.95
IsOnMethod · 0.95
cmNonemptyFunction · 0.85
push_backMethod · 0.80
countMethod · 0.45

Tested by

no test coverage detected