mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-18 17:31:57 +08:00
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
This commit is contained in:
@@ -292,6 +292,13 @@ Package
|
||||
|
||||
This feature is available for QtIFW 4.0.0 and newer.
|
||||
|
||||
.. variable:: CPACK_IFW_PACKAGE_SIGNING_IDENTITY
|
||||
|
||||
.. versionadded: 3.23
|
||||
|
||||
Allows specifying a code signing identity to be used for signing the generated
|
||||
app bundle. Only available on macOS.
|
||||
|
||||
.. variable:: CPACK_IFW_ARCHIVE_FORMAT
|
||||
|
||||
.. versionadded:: 3.23
|
||||
|
7
Help/release/dev/cpackifw-signing-identity.rst
Normal file
7
Help/release/dev/cpackifw-signing-identity.rst
Normal file
@@ -0,0 +1,7 @@
|
||||
cpackifw-signing-identity
|
||||
-------------------------
|
||||
|
||||
* The :cpack_gen:`CPack IFW Generator` gained the new
|
||||
:variable:`CPACK_IFW_PACKAGE_SIGNING_IDENTITY` variable for specifying a code
|
||||
signing identity to be used for signing the generated app bundle.
|
||||
This feature is available on macOS only, and for QtIFW 3.0 and newer.
|
@@ -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");
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user