Docker: Provide a means to select search paths for auto-detection

A combobox in the device dialog to select between the (docker image's)
system path and a semicolon-separated set of user defined paths.

Use it for cmake and gdb detection; qmake and toolchains currently missing.

Change-Id: I3c478ca914a1bf02dcb69ebcb9ea6e358d24aaf9
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
hjk
2021-12-03 10:21:57 +01:00
parent 2000491108
commit 16c25d99c8
8 changed files with 83 additions and 35 deletions

View File

@@ -180,15 +180,14 @@ void CMakeToolManager::updateDocumentation()
Core::HelpManager::registerDocumentation(docs);
}
void CMakeToolManager::autoDetectCMakeForDevice(const FilePath &deviceRoot,
void CMakeToolManager::autoDetectCMakeForDevice(const FilePaths &searchPaths,
const QString &detectionSource,
QString *logMessage)
{
QStringList messages{tr("Searching CMake binaries...")};
const FilePaths candidates = {deviceRoot.withNewPath("cmake")};
for (const FilePath &candidate : candidates) {
const FilePath cmake = candidate.searchInPath();
if (!cmake.isEmpty()) {
for (const FilePath &path : searchPaths) {
const FilePath cmake = path.pathAppended("cmake").withExecutableSuffix();
if (cmake.isExecutableFile()) {
registerCMakeByPath(cmake, detectionSource);
messages.append(tr("Found \"%1\"").arg(cmake.toUserOutput()));
}