diff options
author | Morten Johan Sørvig <morten.sorvig@digia.com> | 2014-09-24 15:08:00 +0200 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@digia.com> | 2014-10-01 10:50:30 +0200 |
commit | 5e6e9458a4feb3411fce3a51abdaa9d62271c6ec (patch) | |
tree | 5ea3bfb2fdc7c6d2c1c4d4547bd9a162636bb830 /src/macdeployqt/macdeployqt/main.cpp | |
parent | a58505987ca43850cec8c8f33665feb33c1187fb (diff) |
Add -codesign option.
Use the "codesign" tool with the provided signing identity to
sign all code binaries in the bundle. Application code binaries
include the app executable(s), plugin and framework/dylib
dependencies.
Finally, run "codesign --verify" to verify that the app
bundle is correctly signed.
Change-Id: Idfff030a2b218e1dc1ad1bc279a32a330665b347
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Diffstat (limited to 'src/macdeployqt/macdeployqt/main.cpp')
-rw-r--r-- | src/macdeployqt/macdeployqt/main.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/macdeployqt/macdeployqt/main.cpp b/src/macdeployqt/macdeployqt/main.cpp index b4881789e..313a57488 100644 --- a/src/macdeployqt/macdeployqt/main.cpp +++ b/src/macdeployqt/macdeployqt/main.cpp @@ -59,6 +59,7 @@ int main(int argc, char **argv) qDebug() << " -executable=<path> : Let the given executable use the deployed frameworks too"; qDebug() << " -qmldir=<path> : Deploy imports used by .qml files in the given path"; qDebug() << " -always-overwrite : Copy files enven if the target file exists"; + qDebug() << " -codesign=<ident> : Run codesing with the given identity on all executables"; qDebug() << ""; qDebug() << "macdeployqt takes an application bundle as input and makes it"; qDebug() << "self-contained by copying in the Qt frameworks and plugins that"; @@ -89,6 +90,8 @@ int main(int argc, char **argv) extern bool alwaysOwerwriteEnabled; QStringList additionalExecutables; QStringList qmlDirs; + extern bool runCodesign; + extern QString codesignIdentiy; for (int i = 2; i < argc; ++i) { QByteArray argument = QByteArray(argv[i]); @@ -131,6 +134,15 @@ int main(int argc, char **argv) } else if (argument == QByteArray("-always-overwrite")) { LogDebug() << "Argument found:" << argument; alwaysOwerwriteEnabled = true; + } else if (argument.startsWith(QByteArray("-codesign"))) { + LogDebug() << "Argument found:" << argument; + int index = argument.indexOf("="); + if (index < 0 || index >= argument.size()) { + LogError() << "Missing code signing identity"; + } else { + runCodesign = true; + codesignIdentiy = argument.mid(index+1); + } } else if (argument.startsWith("-")) { LogError() << "Unknown argument" << argument << "\n"; return 0; @@ -157,6 +169,9 @@ int main(int argc, char **argv) if (!qmlDirs.isEmpty()) deployQmlImports(appBundlePath, qmlDirs); + if (runCodesign) + codesign(codesignIdentiy, appBundlePath); + if (dmg) { LogNormal(); createDiskImage(appBundlePath); |