forked from qt-creator/qt-creator
CMakeProjectManager: Make search for CMake in "ProgramFiles" more robust
Also search in "ProgramW6432", so that a 32-bit Qt Creator on a 64-bit Windows can find a 64-bit CMake installation. Change-Id: Ia02a8a3e2308fa0dfb422df6969c8313868d3ce6 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -76,13 +76,12 @@ static std::vector<std::unique_ptr<CMakeTool>> autoDetectCMakeTools()
|
||||
path = Utils::filteredUnique(path);
|
||||
|
||||
if (HostOsInfo::isWindowsHost()) {
|
||||
const QString progFiles = QLatin1String(qgetenv("ProgramFiles"));
|
||||
path.append(Utils::FilePath::fromString(progFiles + "/CMake"));
|
||||
path.append(Utils::FilePath::fromString(progFiles + "/CMake/bin"));
|
||||
const QString progFilesX86 = QLatin1String(qgetenv("ProgramFiles(x86)"));
|
||||
if (!progFilesX86.isEmpty()) {
|
||||
path.append(Utils::FilePath::fromString(progFilesX86 + "/CMake"));
|
||||
path.append(Utils::FilePath::fromString(progFilesX86 + "/CMake/bin"));
|
||||
for (auto envVar : {"ProgramFiles", "ProgramFiles(x86)", "ProgramW6432"}) {
|
||||
if (qEnvironmentVariableIsSet(envVar)) {
|
||||
const QString progFiles = qEnvironmentVariable(envVar);
|
||||
path.append(Utils::FilePath::fromString(progFiles + "/CMake"));
|
||||
path.append(Utils::FilePath::fromString(progFiles + "/CMake/bin"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user