productbuild: Simplify internal CPACK_PRODUCTBUILD_DOMAINS usage

There's no benefit to storing the CPACK_PRODUCTBUILD_DOMAINS
prefix in a variable and appending to it in the C++ code. It has the
disadvantage of making it harder to find usages of the variables with
a suffix appended to that string. Expand out the strings at the places
they are used so that they are easier to spot.
This commit is contained in:
Craig Scott
2022-03-21 13:36:48 +11:00
parent 66ba460810
commit 28fdc3a536

View File

@@ -293,8 +293,7 @@ void cmCPackPKGGenerator::CreateChoice(const cmCPackComponent& component,
void cmCPackPKGGenerator::CreateDomains(cmXMLWriter& xout)
{
std::string opt = "CPACK_PRODUCTBUILD_DOMAINS";
if (cmIsOff(this->GetOption(opt))) {
if (cmIsOff(this->GetOption("CPACK_PRODUCTBUILD_DOMAINS"))) {
return;
}
@@ -302,19 +301,19 @@ void cmCPackPKGGenerator::CreateDomains(cmXMLWriter& xout)
// Product can be installed at the root of any volume by default
// unless specified
cmValue param = this->GetOption(cmStrCat(opt, "_ANYWHERE"));
cmValue param = this->GetOption("CPACK_PRODUCTBUILD_DOMAINS_ANYWHERE");
xout.Attribute("enable_anywhere",
(param && cmIsOff(param)) ? "false" : "true");
// Product cannot be installed into the current user's home directory
// by default unless specified
param = this->GetOption(cmStrCat(opt, "_USER"));
param = this->GetOption("CPACK_PRODUCTBUILD_DOMAINS_USER");
xout.Attribute("enable_currentUserHome",
(param && cmIsOn(param)) ? "true" : "false");
// Product can be installed into the root directory by default
// unless specified
param = this->GetOption(cmStrCat(opt, "_ROOT"));
param = this->GetOption("CPACK_PRODUCTBUILD_DOMAINS_ROOT");
xout.Attribute("enable_localSystem",
(param && cmIsOff(param)) ? "false" : "true");