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.6
Change-Id: Ie2984f4af740776c568610370d49ad4ff85ffff0
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit a88b6bca21498f367908feedf660243eaf1d613d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Timothée Keller 2024-03-11 13:53:53 +01:00 committed by Qt Cherry-pick Bot
parent c24ab294ba
commit 12039bcff4

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;