Docker: Make CMake autodetection a bit more flexible

Search in build device path instead of two hardcoded locations.

Change-Id: I91e047aa48eb6566353e3ba090070c2a00b3dd06
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2021-06-21 08:15:38 +02:00
parent 50853bba61
commit 645c7f8379

View File

@@ -472,9 +472,9 @@ void DockerDevicePrivate::autoDetectCMake(QTextBrowser *log)
log->append('\n' + tr("Searching CMake binary..."));
QString error;
const QStringList candidates = {"/usr/local/bin/cmake", "/usr/bin/cmake"};
const QStringList candidates = {"cmake"};
for (const QString &candidate : candidates) {
const FilePath cmake = q->mapToGlobalPath(FilePath::fromString(candidate));
const FilePath cmake = q->searchInPath(FilePath::fromString(candidate));
QTC_CHECK(q->hasLocalFileAccess());
if (cmake.isExecutableFile()) {
log->append(tr("Found CMake binary: %1").arg(cmake.toUserOutput()));