From 12039bcff4a0fcf34d190669d207cbc015a78868 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Keller?= Date: Mon, 11 Mar 2024 13:53:53 +0100 Subject: [PATCH] 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 Reviewed-by: Oliver Wolff (cherry picked from commit a88b6bca21498f367908feedf660243eaf1d613d) Reviewed-by: Qt Cherry-pick Bot --- src/tools/windeployqt/main.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/tools/windeployqt/main.cpp b/src/tools/windeployqt/main.cpp index d96f4cd82d4..bb2350ba586 100644 --- a/src/tools/windeployqt/main.cpp +++ b/src/tools/windeployqt/main.cpp @@ -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;