forked from qt-creator/qt-creator
QtSupport: Try harder to uniquify the list of auto-detected qmakes
Fixes: QTCREATORBUG-23459 Change-Id: I40d1baee48489a6fd439f7ece8b1c5ee664c75c6 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -39,6 +39,7 @@
|
|||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/buildablehelperlibrary.h>
|
#include <utils/buildablehelperlibrary.h>
|
||||||
|
#include <utils/environment.h>
|
||||||
#include <utils/filesystemwatcher.h>
|
#include <utils/filesystemwatcher.h>
|
||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
#include <utils/persistentsettings.h>
|
#include <utils/persistentsettings.h>
|
||||||
@@ -429,11 +430,16 @@ static void findSystemQt()
|
|||||||
{
|
{
|
||||||
FilePaths systemQMakes
|
FilePaths systemQMakes
|
||||||
= BuildableHelperLibrary::findQtsInEnvironment(Environment::systemEnvironment());
|
= BuildableHelperLibrary::findQtsInEnvironment(Environment::systemEnvironment());
|
||||||
|
|
||||||
systemQMakes.append(gatherQmakePathsFromQtChooser());
|
systemQMakes.append(gatherQmakePathsFromQtChooser());
|
||||||
|
for (const FilePath &qmakePath : qAsConst(systemQMakes)) {
|
||||||
const FilePaths uniqueSystemQmakes = Utils::filteredUnique(systemQMakes);
|
if (BuildableHelperLibrary::isQtChooser(qmakePath.toFileInfo()))
|
||||||
for (const FilePath &qmakePath : uniqueSystemQmakes) {
|
continue;
|
||||||
|
const auto isSameQmake = [qmakePath](const BaseQtVersion *version) {
|
||||||
|
return Environment::systemEnvironment().
|
||||||
|
isSameExecutable(qmakePath.toString(), version->qmakeCommand().toString());
|
||||||
|
};
|
||||||
|
if (contains(m_versions, isSameQmake))
|
||||||
|
continue;
|
||||||
BaseQtVersion *version = QtVersionFactory::createQtVersionFromQMakePath(qmakePath,
|
BaseQtVersion *version = QtVersionFactory::createQtVersionFromQMakePath(qmakePath,
|
||||||
false,
|
false,
|
||||||
"PATH");
|
"PATH");
|
||||||
|
|||||||
Reference in New Issue
Block a user