|
|
@@ -75,6 +75,14 @@ int cmCPackProductBuildGenerator::PackageFiles()
|
|
|
|
|
|
std::string version = this->GetOption("CPACK_PACKAGE_VERSION");
|
|
|
std::string productbuild = this->GetOption("CPACK_COMMAND_PRODUCTBUILD");
|
|
|
+ std::string identityName;
|
|
|
+ if (const char* n = this->GetOption("CPACK_PRODUCTBUILD_IDENTITY_NAME")) {
|
|
|
+ identityName = n;
|
|
|
+ }
|
|
|
+ std::string keychainPath;
|
|
|
+ if (const char* p = this->GetOption("CPACK_PRODUCTBUILD_KEYCHAIN_PATH")) {
|
|
|
+ keychainPath = p;
|
|
|
+ }
|
|
|
|
|
|
pkgCmd << productbuild << " --distribution \"" << packageDirFileName
|
|
|
<< "/Contents/distribution.dist\""
|
|
|
@@ -82,6 +90,9 @@ int cmCPackProductBuildGenerator::PackageFiles()
|
|
|
<< "\""
|
|
|
<< " --resources \"" << resDir << "\""
|
|
|
<< " --version \"" << version << "\""
|
|
|
+ << (identityName.empty() ? "" : " --sign \"" + identityName + "\"")
|
|
|
+ << (keychainPath.empty() ? ""
|
|
|
+ : " --keychain \"" + keychainPath + "\"")
|
|
|
<< " \"" << packageFileNames[0] << "\"";
|
|
|
|
|
|
// Run ProductBuild
|
|
|
@@ -193,12 +204,23 @@ bool cmCPackProductBuildGenerator::GenerateComponentPackage(
|
|
|
|
|
|
std::string version = this->GetOption("CPACK_PACKAGE_VERSION");
|
|
|
std::string pkgbuild = this->GetOption("CPACK_COMMAND_PKGBUILD");
|
|
|
+ std::string identityName;
|
|
|
+ if (const char* n = this->GetOption("CPACK_PKGBUILD_IDENTITY_NAME")) {
|
|
|
+ identityName = n;
|
|
|
+ }
|
|
|
+ std::string keychainPath;
|
|
|
+ if (const char* p = this->GetOption("CPACK_PKGBUILD_KEYCHAIN_PATH")) {
|
|
|
+ keychainPath = p;
|
|
|
+ }
|
|
|
|
|
|
pkgCmd << pkgbuild << " --root \"" << packageDir << "\""
|
|
|
<< " --identifier \"" << pkgId << "\""
|
|
|
<< " --scripts \"" << scriptDir << "\""
|
|
|
<< " --version \"" << version << "\""
|
|
|
<< " --install-location \"/\""
|
|
|
+ << (identityName.empty() ? "" : " --sign \"" + identityName + "\"")
|
|
|
+ << (keychainPath.empty() ? ""
|
|
|
+ : " --keychain \"" + keychainPath + "\"")
|
|
|
<< " \"" << packageFile << "\"";
|
|
|
|
|
|
// Run ProductBuild
|