diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2017-09-14 09:46:07 +0300 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@qt.io> | 2017-09-14 10:01:15 +0000 |
commit | f10af21922334cf3c5439c5bb4c7e6535927506e (patch) | |
tree | 3b281279484bd66af1256e78873cd89db77dc393 | |
parent | ad560bf01902d50fc44e02037709e34aea9bc220 (diff) | |
download | qt-creator-f10af21922334cf3c5439c5bb4c7e6535927506e.tar.gz |
CMake: Fix auto-detection on Windows
Recent CMake installer (3.9) installs the executable in CMake/bin.
Change-Id: I3912badc0907c91044e76b3155e924dd985819f1
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
-rw-r--r-- | src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp b/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp index 3804670f83..235ddcb49d 100644 --- a/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp @@ -154,8 +154,14 @@ static QList<CMakeTool *> autoDetectCMakeTools() path.removeDuplicates(); if (HostOsInfo::isWindowsHost()) { - path.append("C:/Program Files/CMake"); - path.append("C:/Program Files (x86)/CMake"); + const QString progFiles = QLatin1String(qgetenv("ProgramFiles")); + path.append(progFiles + "/CMake"); + path.append(progFiles + "/CMake/bin"); + const QString progFilesX86 = QLatin1String(qgetenv("ProgramFiles(x86)")); + if (!progFilesX86.isEmpty()) { + path.append(progFilesX86 + "/CMake"); + path.append(progFilesX86 + "/CMake/bin"); + } } if (HostOsInfo::isMacHost()) { |