Skip to content

Commit

Permalink
Allow recursive folder addition of executables (closes probonopd#379) (
Browse files Browse the repository at this point in the history
…probonopd#596)

* Allow recursive folder addition of executables (closes probonopd#379)

* Remove mention of Bintray

---------

Co-authored-by: probonopd <probonopd@users.noreply.github.com>
  • Loading branch information
2 people authored and omergoktas committed Oct 12, 2024
1 parent da6195b commit 3062d7f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ Options:
searching for libraries.
-executable=<path> : Let the given executable use the deployed libraries
too
-executable-dir=<path> : Let all the executables in the folder (recursive) use
the deployed libraries too
-extra-plugins=<list> : List of extra plugins which should be deployed,
separated by comma.
-no-copy-copyright-files : Skip deployment of copyright files.
Expand Down
33 changes: 32 additions & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ int main(int argc, char* argv[])
extern QStringList librarySearchPath;
extern bool alwaysOwerwriteEnabled;
QStringList additionalExecutables;
QStringList additionalExecutablesDir;
bool qmldirArgumentUsed = false;
bool skipTranslations = false;
QStringList qmlDirs;
Expand Down Expand Up @@ -85,7 +86,7 @@ int main(int argc, char* argv[])
runStripEnabled = false;
} else if (argument == QByteArray("-bundle-non-qt-libs")) {
LogDebug() << "Argument found:" << argument;
bundleAllButBlacklistedLibs = true;
bundleAllButCoreLibs = true;
} else if (argument.startsWith(QByteArray("-verbose"))) {
LogDebug() << "Argument found:" << argument;
int index = argument.indexOf("=");
Expand All @@ -95,6 +96,13 @@ int main(int argc, char* argv[])
LogError() << "Could not parse verbose level";
else
logLevel = number;
} else if (argument.startsWith(QByteArray("-executable-dir"))) {
LogDebug() << "Argument found:" << argument;
int index = argument.indexOf('=');
if (index == -1)
LogError() << "Missing executable folder path";
else
additionalExecutablesDir << argument.mid(index+1);
} else if (argument.startsWith(QByteArray("-executable"))) {
LogDebug() << "Argument found:" << argument;
int index = argument.indexOf('=');
Expand Down Expand Up @@ -182,6 +190,8 @@ int main(int argc, char* argv[])
qInfo() << " searching for libraries.";
qInfo() << " -executable=<path> : Let the given executable use the deployed libraries";
qInfo() << " too";
qInfo() << " -executable-dir=<path> : Let all the executables in the folder (recursive) use";
qInfo() << " the deployed libraries too";
qInfo() << " -extra-plugins=<list> : List of extra plugins which should be deployed,";
qInfo() << " separated by comma.";
qInfo() << " -no-copy-copyright-files : Skip deployment of copyright files.";
Expand All @@ -207,6 +217,14 @@ int main(int argc, char* argv[])
qInfo() << "to be used instead.";
qInfo() << "";
qInfo() << "Plugins related to a Qt library are copied in with the library.";
/* TODO: To be implemented
qDebug() << "The accessibility, image formats, and text codec";
qDebug() << "plugins are always copied, unless \"-no-plugins\" is specified.";
*/
qInfo() << "";
qInfo() << "See the \"Deploying Applications on Linux\" topic in the";
qInfo() << "documentation for more information about deployment on Linux.";

return EXIT_FAILURE;
}

Expand Down Expand Up @@ -430,6 +448,19 @@ int main(int argc, char* argv[])
}
}

// recurse folders for additional executables
for(const auto& folder : additionalExecutablesDir) {
QString directoryToBeSearched = QDir::cleanPath(QFileInfo(folder).absolutePath());
QDirIterator it(directoryToBeSearched, QDirIterator::Subdirectories);
while (it.hasNext()) {
it.next();
if((it.fileInfo().isFile()) && (it.fileInfo().isExecutable())){
qDebug() << "Found additional executable:" << it.fileInfo().canonicalFilePath();
additionalExecutables << it.fileInfo().absoluteFilePath();
}
}
}

DeploymentInfo deploymentInfo = deployQtLibraries(appDirPath, additionalExecutables,
qmakeExecutable);

Expand Down

0 comments on commit 3062d7f

Please sign in to comment.