Windeployqt: improve multiple directory warning

The multipleDirs warning was added to avoid surprises related to where
windeployqt would deploy files when using binaries from different paths.
To do this properly, make the warning message more meaningful, and
suppress the warning when the --dir option is specified, i.e. when the
user is already explicitly choosing where to deploy.

Pick-to: 6.7 6.6
Change-Id: Ie2984f4af740776c568610370d49ad4ff85ffff0
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
bb10
Timothée Keller 2024-03-11 13:53:53 +01:00
parent a30824a984
commit a88b6bca21
1 changed files with 5 additions and 3 deletions

View File

@ -706,13 +706,15 @@ static inline int parseArguments(const QStringList &arguments, QCommandLineParse
for (const QString &library : libraries)
options->binaries.append(path + u'/' + library);
} else {
if (fi.absolutePath() != options->directory)
if (!parser->isSet(dirOption) && fi.absolutePath() != options->directory)
multipleDirs = true;
options->binaries.append(path);
}
}
if (multipleDirs)
std::wcerr << "Warning: using binaries from different directories\n";
if (multipleDirs) {
std::wcerr << "Warning: using binaries from different directories, deploying to following path: "
<< options->directory << '\n' << "To disable this warning, use the --dir option\n";
}
if (options->translationsDirectory.isEmpty())
options->translationsDirectory = options->directory + "/translations"_L1;
return 0;