summaryrefslogtreecommitdiff
path: root/src/plugins/cmakeprojectmanager
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2022-11-21 11:02:49 +0100
committerhjk <hjk@qt.io>2022-11-22 06:29:07 +0000
commit9635b1545b8f0946b0206f96c24ce52ab4e881c0 (patch)
tree8d3cff6da07746de8a28db3911f0f4f8606b872a /src/plugins/cmakeprojectmanager
parent3a7fee0cc659393694cce125dcbb2b64c179b1bb (diff)
downloadqt-creator-9635b1545b8f0946b0206f96c24ce52ab4e881c0.tar.gz
CMakeManager: Avoid one use of Environment::appendExeExtensions()
Use FilePath::refersToExecutableFile() instead. This makes it better re-usable for remote setup. Change-Id: Ic69739b332f036ed791adbbc8092a139b4c83c2d Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Diffstat (limited to 'src/plugins/cmakeprojectmanager')
-rw-r--r--src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp b/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp
index 362c62c7b1..a92454e169 100644
--- a/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp
+++ b/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp
@@ -65,18 +65,13 @@ static std::vector<std::unique_ptr<CMakeTool>> autoDetectCMakeTools()
path.append("/opt/local/bin");
}
- const QStringList execs = env.appendExeExtensions(QLatin1String("cmake"));
-
FilePaths suspects;
for (const FilePath &base : std::as_const(path)) {
if (base.isEmpty())
continue;
-
- for (const QString &exec : execs) {
- const FilePath suspect = base.resolvePath(exec);
- if (suspect.isExecutableFile())
- suspects << suspect;
- }
+ const FilePath suspect = base / "cmake";
+ if (suspect.refersToExecutableFile(FilePath::WithAnySuffix))
+ suspects << suspect;
}
std::vector<std::unique_ptr<CMakeTool>> found;