From abc4850ca431369b070d2d0ce332c9b1bfb45f1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B5=D0=BB=D0=B8=D0=BF=D0=B5=D0=BD=D0=BA=D0=BE=20?= =?UTF-8?q?=D0=98=D0=B2=D0=B0=D0=BD?= Date: Sat, 14 Mar 2020 19:54:17 +0000 Subject: [PATCH] git-svn-id: svn://db.shs.com.ru/libs@784 a8b55f48-bf90-11e4-a774-851b48703e85 --- deploy_tool/main.cpp | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/deploy_tool/main.cpp b/deploy_tool/main.cpp index 5af606a..afda9cb 100644 --- a/deploy_tool/main.cpp +++ b/deploy_tool/main.cpp @@ -32,7 +32,7 @@ void usage() { piCout << "If depend on QtCore library, then copy all basic Qt plugins, "; piCout << " and "; piCout << ""; - piCout << Green << Bold << "Usage:" << Default << "\"deploy_tool [-hvfC] -o [-s ] [-S ] [-l ] [-L | -W | -M ] [-d ] [-q ] [-a ] [-S ] [-P ] \"" << NewLine; + piCout << Green << Bold << "Usage:" << Default << "\"deploy_tool [-hvfC] -o [-p ] [-s ] [-S ] [-l ] [-L | -W | -M ] [-d ] [-q ] [-a ] [-S ] [-P ] \"" << NewLine; piCout << Green << Bold << "Details:"; piCout << Bold << "Debug control"; piCout << "-h " << Green << "- display this message and exit"; @@ -52,6 +52,7 @@ void usage() { piCout << ""; piCout << Bold << "Output control"; piCout << "-o " << Green << "- path for libraries copy to"; + piCout << "-p " << Green << "- path for Qt plugins, default \"/plugins\""; piCout << ""; piCout << Bold << "Input control"; piCout << " " << Green << "- executable to process"; @@ -63,9 +64,9 @@ void usage() { int depth = 1; bool need_qt = false, fake = false, is_ldd = true; -PIString ldd, readelf, objdump, otool, out_dir, qt_dir; +PIString ldd, readelf, objdump, otool, out_dir, qt_dir, out_plugins_dir; PIStringList styles, lib_dirs, add_libs, platforms; -PISet all_libs, miss_libs, frameworks; +PISet all_libs, miss_libs, frameworks, miss_frameworks; PIString findLib(const PIString & l) { @@ -232,8 +233,9 @@ void procQt() { vs = "QMake version ?.?\nUsing Qt version ?.?.? in " + qt_dir; PIStringList vsl = vs.split("\n"); PIStringList pdirs; - PIString out_plugins_dir = out_dir + "plugins/"; pdirs << "imageformats" << "sqldrivers"; + if (!fake) + PIDir(out_plugins_dir).make(true); piForeach (PIString l, vsl) { if (l.trim().contains("Qt version")) { l.cutLeft(l.find("Qt version") + 10).trim(); @@ -284,6 +286,7 @@ int main(int argc, char * argv[]) { cli.addArgument("Conf"); cli.addArgument("fake"); cli.addArgument("output", true); + cli.addArgument("qt_out_plugins", true); cli.addArgument("search_path", true); cli.addArgument("Styles", true); cli.addArgument("Platforms", true); @@ -311,6 +314,9 @@ int main(int argc, char * argv[]) { readelf = cli.argumentValue("Lreadelf"); objdump = cli.argumentValue("Wobjdump"); otool = cli.argumentValue("Motool"); + out_plugins_dir = out_dir + "plugins/"; + if (!cli.argumentValue("qt_out_plugins").isEmpty()) + out_plugins_dir = cli.argumentValue("qt_out_plugins"); int etcnt = 0; if (!readelf.isEmpty()) ++etcnt; if (!objdump.isEmpty()) ++etcnt; @@ -353,15 +359,19 @@ int main(int argc, char * argv[]) { PIVector fwdirs = frameworks.toVector(); piForeachC (PIString & f, fwdirs) { PIString fd = findLib(f); - piCout << "copy framework" << f; - if (!fake) - system(cmd_copydir + "\"" + fd + "\" \"" + out_dir + "\""); + if (!fd.isEmpty()) { + piCout << "copy framework" << f; + if (!fake) + system(cmd_copydir + "\"" + fd + "\" \"" + out_dir + "\""); + } else + miss_frameworks << f; } piCout << "copied" << clibs.size_s() << "files"; - if (!miss_libs.isEmpty()) { + if (!miss_libs.isEmpty()) piCout << "Missing libraries:\n - " << PIStringList(miss_libs.toVector()).join("\n - "); - } + if (!miss_frameworks.isEmpty()) + piCout << "Missing frameworks:\n - " << PIStringList(miss_frameworks.toVector()).join("\n - "); return 0; }