git-svn-id: svn://db.shs.com.ru/libs@784 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -32,7 +32,7 @@ void usage() {
|
||||
piCout << "If <file> depend on QtCore library, then copy all basic Qt plugins, ";
|
||||
piCout << "<styles> and <platform>";
|
||||
piCout << "";
|
||||
piCout << Green << Bold << "Usage:" << Default << "\"deploy_tool [-hvfC] -o <out_path> [-s <search_path>] [-S <styles>] [-l <ldd>] [-L <readelf> | -W <objdump> | -M <otool>] [-d <depth>] [-q <qtdir>] [-a <add_libs>] [-S <styles>] [-P <platforms>] <file>\"" << NewLine;
|
||||
piCout << Green << Bold << "Usage:" << Default << "\"deploy_tool [-hvfC] -o <out_path> [-p <qt_plugins>] [-s <search_path>] [-S <styles>] [-l <ldd>] [-L <readelf> | -W <objdump> | -M <otool>] [-d <depth>] [-q <qtdir>] [-a <add_libs>] [-S <styles>] [-P <platforms>] <file>\"" << 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 <out_path> " << Green << "- path for libraries copy to";
|
||||
piCout << "-p <qt_plugins> " << Green << "- path for Qt plugins, default \"<out_path>/plugins\"";
|
||||
piCout << "";
|
||||
piCout << Bold << "Input control";
|
||||
piCout << "<file> " << 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<PIString> all_libs, miss_libs, frameworks;
|
||||
PISet<PIString> 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<PIString> fwdirs = frameworks.toVector();
|
||||
piForeachC (PIString & f, fwdirs) {
|
||||
PIString fd = findLib(f);
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user