summaryrefslogtreecommitdiffstats
path: root/Source/CPack/cmCPackPKGGenerator.cxx
diff options
context:
space:
mode:
authorGreg Fiumara <greg@gregfiumara.com>2021-11-16 21:39:34 (GMT)
committerGreg Fiumara <greg@gregfiumara.com>2021-11-18 18:01:35 (GMT)
commit7213ceb869bfe50acda93eaeab9f3d928f517cd8 (patch)
tree56cbbbfd63b4863de08ee5b425eea903da7747af /Source/CPack/cmCPackPKGGenerator.cxx
parentd98b61c68770150e4773ce30eb8145ad487016da (diff)
downloadCMake-7213ceb869bfe50acda93eaeab9f3d928f517cd8.zip
CMake-7213ceb869bfe50acda93eaeab9f3d928f517cd8.tar.gz
CMake-7213ceb869bfe50acda93eaeab9f3d928f517cd8.tar.bz2
CPack/productbuild: Add option to customize product identifier
This adds a new option, CPACK_PRODUCTBUILD_IDENTIFIER, which allows for customization of the productbuild product identifier within the CPack productbuild generator. Fixes: #20830
Diffstat (limited to 'Source/CPack/cmCPackPKGGenerator.cxx')
-rw-r--r--Source/CPack/cmCPackPKGGenerator.cxx11
1 files changed, 8 insertions, 3 deletions
diff --git a/Source/CPack/cmCPackPKGGenerator.cxx b/Source/CPack/cmCPackPKGGenerator.cxx
index 91adf32..b62fab8 100644
--- a/Source/CPack/cmCPackPKGGenerator.cxx
+++ b/Source/CPack/cmCPackPKGGenerator.cxx
@@ -210,9 +210,14 @@ void cmCPackPKGGenerator::CreateChoice(const cmCPackComponentGroup& group,
void cmCPackPKGGenerator::CreateChoice(const cmCPackComponent& component,
cmXMLWriter& xout)
{
- std::string packageId =
- cmStrCat("com.", this->GetOption("CPACK_PACKAGE_VENDOR"), '.',
- this->GetOption("CPACK_PACKAGE_NAME"), '.', component.Name);
+ std::string packageId;
+ if (cmValue i = this->GetOption("CPACK_PRODUCTBUILD_IDENTIFIER")) {
+ packageId = cmStrCat(i, '.', component.Name);
+ } else {
+ packageId =
+ cmStrCat("com.", this->GetOption("CPACK_PACKAGE_VENDOR"), '.',
+ this->GetOption("CPACK_PACKAGE_NAME"), '.', component.Name);
+ }
xout.StartElement("choice");
xout.Attribute("id", component.Name + "Choice");