summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2022-03-21 02:36:48 (GMT)
committerCraig Scott <craig.scott@crascit.com>2022-03-21 02:36:48 (GMT)
commit28fdc3a5363cc8b7b141e9bc28d8e88ce99a431c (patch)
treeaafd064a70890400cc3f1b32f4fc3ba2f67c6734 /Source
parent66ba460810afdc0e0f65c20b1bc057a204acc82c (diff)
downloadCMake-28fdc3a5363cc8b7b141e9bc28d8e88ce99a431c.zip
CMake-28fdc3a5363cc8b7b141e9bc28d8e88ce99a431c.tar.gz
CMake-28fdc3a5363cc8b7b141e9bc28d8e88ce99a431c.tar.bz2
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.
Diffstat (limited to 'Source')
-rw-r--r--Source/CPack/cmCPackPKGGenerator.cxx9
1 files 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");