CMakePM: Only add external "bin" dirs to PATH

At QTCREATORBUG-29662 we have the issue when a program cannot be started
because the PATH environment variable had content longer than 2048
characters.

Qt Creator 12 had only one place that added paths to librarySeachPaths
namely the "bin" directories.

Qt Creator 13 tried to filter these "bin" directories to the ones that
have .dll files. This fixed QTCREATORBUG-29662 but had issues with dlls
having different names than the link libraries provided by CMake.

By only allowing "bin" directories from paths not from the build
directory we allow Qt, or OpenSSL dependencies, but not just existing
"bin" directories.

Amends 0d8a542b4f
Amends 8713919f31
Amends ac97ab1abf
Amends 2ce6255a7d

Task-number: QTCREATORBUG-29662
Change-Id: If0b162f25ae1e5bfc1e1ff313720c54c5ae936c5
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Cristian Adam
2024-06-03 13:04:01 +02:00
parent 2ce6255a7d
commit 5d159e6185

View File

@@ -336,7 +336,7 @@ static CMakeBuildTarget toBuildTarget(const TargetDetails &t,
// actual dll files in ../bin on windows. Qt is one example of that. // actual dll files in ../bin on windows. Qt is one example of that.
if (tmp.fileName() == "lib") { if (tmp.fileName() == "lib") {
const FilePath path = tmp.parentDir().pathAppended("bin"); const FilePath path = tmp.parentDir().pathAppended("bin");
if (path.isDir()) if (path.isDir() && !isChildOf(path, {buildDir}))
librarySeachPaths.append(path); librarySeachPaths.append(path);
} }
} }