From 28fdc3a5363cc8b7b141e9bc28d8e88ce99a431c Mon Sep 17 00:00:00 2001 From: Craig Scott Date: Mon, 21 Mar 2022 13:36:48 +1100 Subject: 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. --- Source/CPack/cmCPackPKGGenerator.cxx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Source/CPack/cmCPackPKGGenerator.cxx b/Source/CPack/cmCPackPKGGenerator.cxx index d8095cc..b2d8d9a 100644 --- a/Source/CPack/cmCPackPKGGenerator.cxx +++ b/Source/CPack/cmCPackPKGGenerator.cxx @@ -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"); -- cgit v0.12