Docker: Move some cmake detection logic to cmake plugin

This make the code better re-usable from other places that
wish to put a cmake version into a new kit.

Change-Id: I1ef7770a7f8efa36e88b2f3862b011fecd38de98
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2021-07-12 14:23:06 +02:00
parent f922d22ad4
commit a4c05f585f
3 changed files with 37 additions and 13 deletions

View File

@@ -545,19 +545,15 @@ void KitDetectorPrivate::autoDetectCMake()
return;
emit q->logOutput('\n' + tr("Searching CMake binary..."));
const FilePath deviceRoot = m_device->mapToGlobalPath({});
QString error;
const QStringList candidates = {"cmake"};
for (const QString &candidate : candidates) {
const FilePath cmake = m_device->searchExecutableInPath(candidate);
if (!cmake.isEmpty()) {
emit q->logOutput(tr("Found CMake binary: %1").arg(cmake.toUserOutput()));
const bool res = QMetaObject::invokeMethod(cmakeManager,
"registerCMakeByPath",
Q_ARG(Utils::FilePath, cmake),
Q_ARG(QString, m_sharedId));
QTC_CHECK(res);
}
}
const bool res = QMetaObject::invokeMethod(cmakeManager,
"autoDetectCMakeForDevice",
Q_ARG(Utils::FilePath, deviceRoot),
Q_ARG(QString, m_sharedId),
Q_ARG(QString *, &error));
QTC_CHECK(res);
emit q->logOutput(error);
}
void KitDetectorPrivate::autoDetectDebugger()