diff options
author | Erlend E. Aasland <erlend.aasland@innova.no> | 2021-11-21 23:50:25 +0100 |
---|---|---|
committer | Erlend E. Aasland <erlend.aasland@innova.no> | 2021-11-22 23:30:57 +0100 |
commit | e8e07a90c12b45eee66889bba2623492efe4c3d6 (patch) | |
tree | efd6d75244cc1a6d7d5aa509e67a8a09ca32fa2c /Source/CPack | |
parent | f13b8a52ee48baba3631eba789e07d09f3c33827 (diff) | |
download | cmake-e8e07a90c12b45eee66889bba2623492efe4c3d6.tar.gz |
CPackIFW: add support for signing the generated app bundles on macOS
Adds the CPACK_IFW_PACKAGE_SIGNING_IDENTITY CPackIFW variable.
This variable mirrors the --sign option of the binarycreator tool.
Fixes: #22927
Diffstat (limited to 'Source/CPack')
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWGenerator.cxx | 11 | ||||
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWInstaller.cxx | 7 | ||||
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWInstaller.h | 5 |
3 files changed, 23 insertions, 0 deletions
diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.cxx b/Source/CPack/IFW/cmCPackIFWGenerator.cxx index f35d7e9b6f..9ca7a69e57 100644 --- a/Source/CPack/IFW/cmCPackIFWGenerator.cxx +++ b/Source/CPack/IFW/cmCPackIFWGenerator.cxx @@ -179,6 +179,17 @@ std::vector<std::string> cmCPackIFWGenerator::BuildBinaryCreatorCommmand() } } + if (!this->IsVersionLess("3.0")) { +#ifdef __APPLE__ + // macOS only + std::string signingIdentity = this->Installer.SigningIdentity; + if (!signingIdentity.empty()) { + ifwCmd.emplace_back("--sign"); + ifwCmd.emplace_back(signingIdentity); + } +#endif + } + ifwCmd.emplace_back("-c"); ifwCmd.emplace_back(this->toplevel + "/config/config.xml"); diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.cxx b/Source/CPack/IFW/cmCPackIFWInstaller.cxx index a94ca48b22..6fc48480ef 100644 --- a/Source/CPack/IFW/cmCPackIFWInstaller.cxx +++ b/Source/CPack/IFW/cmCPackIFWInstaller.cxx @@ -306,6 +306,13 @@ void cmCPackIFWInstaller::ConfigureFromOptions() this->GetOption("CPACK_IFW_PACKAGE_RUN_PROGRAM_DESCRIPTION")) { this->RunProgramDescription = *description; } + +#ifdef __APPLE__ + // Code signing identity for signing the generated app bundle + if (cmValue id = this->GetOption("CPACK_IFW_PACKAGE_SIGNING_IDENTITY")) { + this->SigningIdentity = *id; + } +#endif } /** \class cmCPackIFWResourcesParser diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.h b/Source/CPack/IFW/cmCPackIFWInstaller.h index 0ace099558..205835b0f2 100644 --- a/Source/CPack/IFW/cmCPackIFWInstaller.h +++ b/Source/CPack/IFW/cmCPackIFWInstaller.h @@ -135,6 +135,11 @@ public: /// installation std::string RunProgramDescription; +#ifdef __APPLE__ + /// Code signing identity for signing the generated app bundle + std::string SigningIdentity; +#endif + public: // Internal implementation |