3#include <QCoreApplication>
9int main(
int argc,
char **argv)
17 if (argc < 2 || appBundlePath.startsWith(
"-")) {
18 qDebug() <<
"Usage: macdeployqt app-bundle [options]";
21 qDebug() <<
" -verbose=<0-3> : 0 = no output, 1 = error/warning (default), 2 = normal, 3 = debug";
22 qDebug() <<
" -no-plugins : Skip plugin deployment";
23 qDebug() <<
" -dmg : Create a .dmg disk image";
24 qDebug() <<
" -no-strip : Don't run 'strip' on the binaries";
25 qDebug() <<
" -use-debug-libs : Deploy with debug versions of frameworks and plugins (implies -no-strip)";
26 qDebug() <<
" -executable=<path> : Let the given executable use the deployed frameworks too";
27 qDebug() <<
" -qmldir=<path> : Scan for QML imports in the given path";
28 qDebug() <<
" -qmlimport=<path> : Add the given path to the QML module search locations";
29 qDebug() <<
" -always-overwrite : Copy files even if the target file exists";
30 qDebug() <<
" -codesign=<ident> : Run codesign with the given identity on all executables";
31 qDebug() <<
" -hardened-runtime : Enable Hardened Runtime when code signing";
32 qDebug() <<
" -timestamp : Include a secure timestamp when code signing (requires internet connection)";
33 qDebug() <<
" -sign-for-notarization=<ident>: Activate the necessary options for notarization (requires internet connection)";
34 qDebug() <<
" -appstore-compliant : Skip deployment of components that use private API";
35 qDebug() <<
" -libpath=<path> : Add the given path to the library search path";
36 qDebug() <<
" -fs=<filesystem> : Set the filesystem used for the .dmg disk image (defaults to HFS+)";
38 qDebug() <<
"macdeployqt takes an application bundle as input and makes it";
39 qDebug() <<
"self-contained by copying in the Qt frameworks and plugins that";
40 qDebug() <<
"the application uses.";
42 qDebug() <<
"Plugins related to a framework are copied in with the";
43 qDebug() <<
"framework. The accessibility, image formats, and text codec";
44 qDebug() <<
"plugins are always copied, unless \"-no-plugins\" is specified.";
46 qDebug() <<
"Qt plugins may use private API and will cause the app to be";
47 qDebug() <<
"rejected from the Mac App store. MacDeployQt will print a warning";
48 qDebug() <<
"when known incompatible plugins are deployed. Use -appstore-compliant ";
49 qDebug() <<
"to skip these plugins. Currently two SQL plugins are known to";
50 qDebug() <<
"be incompatible: qsqlodbc and qsqlpsql.";
52 qDebug() <<
"See the \"Deploying Applications on OS X\" topic in the";
53 qDebug() <<
"documentation for more information about deployment on OS X.";
60 if (!
QDir(appBundlePath).exists()) {
61 qDebug() <<
"Error: Could not find app bundle" << appBundlePath;
68 bool useDebugLibs =
false;
73 bool qmldirArgumentUsed =
false;
83 for (
int i = 2;
i < argc; ++
i) {
104 LogError() <<
"Could not parse verbose level";
111 LogError() <<
"Missing executable path";
116 qmldirArgumentUsed =
true;
119 LogError() <<
"Missing qml directory path";
126 LogError() <<
"Missing qml import path";
133 LogError() <<
"Missing library search path";
142 if (index < 0 || index >=
argument.size()) {
143 LogError() <<
"Missing code signing identity";
151 if (index < 0 || index >=
argument.size()) {
152 LogError() <<
"Missing code signing identity";
178 LogError() <<
"Missing filesystem type";
181 }
else if (
argument.startsWith(
"-")) {
189 if (deploymentInfo.isDebug)
196 if (qmlDirs.isEmpty()) {
203 if (!qmlDirs.isEmpty()) {
205 if (!
ok && qmldirArgumentUsed)
211 deploymentInfo.deployedFrameworks =
212 QSet<QString>(deploymentInfo.deployedFrameworks.begin(),
213 deploymentInfo.deployedFrameworks.end()).values();
222 if (deploymentInfo.pluginPath.isEmpty()) {
223 LogError() <<
"Missing Qt plugins path\n";
227 if (!
QDir(deploymentInfo.pluginPath).
exists()) {
228 LogError() <<
"Plugins path does not exist" << deploymentInfo.pluginPath <<
"\n";
233 Q_ASSERT(!deploymentInfo.pluginPath.isEmpty());
234 if (!deploymentInfo.pluginPath.isEmpty()) {
bool exists() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
static QString cleanPath(const QString &path)
Returns path with directory separators normalized (that is, platform-native separators converted to "...
static QString path(LibraryPath p)
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromLocal8Bit(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
typedef QByteArray(EGLAPIENTRYP PFNQGSGETDISPLAYSPROC)()
#define QStringLiteral(str)
bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInfo, QStringList &qmlDirs, QStringList &qmlImportPaths)
QStringList librarySearchPath
void createQtConf(const QString &appBundlePath)
void fixupFramework(const QString &frameworkName)
void createDiskImage(const QString &appBundlePath, const QString &filesystemType)
void stripAppBinary(const QString &bundlePath)
bool alwaysOwerwriteEnabled
void deployPlugins(const ApplicationBundleInfo &appBundleInfo, const QString &pluginSourcePath, const QString pluginDestinationPath, DeploymentInfo deploymentInfo, bool useDebugLibs)
DeploymentInfo deployQtFrameworks(QList< FrameworkInfo > frameworks, const QString &bundlePath, const QStringList &binaryPaths, bool useDebugLibs, bool useLoaderPath)
QStringList findAppFrameworkNames(const QString &appBundlePath)
void codesign(const QString &identity, const QString &appBundlePath)
QApplication app(argc, argv)
[0]