forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -65,19 +65,14 @@ static std::vector<std::unique_ptr<CMakeTool>> autoDetectCMakeTools()
|
|||||||
path.append("/opt/local/bin");
|
path.append("/opt/local/bin");
|
||||||
}
|
}
|
||||||
|
|
||||||
const QStringList execs = env.appendExeExtensions(QLatin1String("cmake"));
|
|
||||||
|
|
||||||
FilePaths suspects;
|
FilePaths suspects;
|
||||||
for (const FilePath &base : std::as_const(path)) {
|
for (const FilePath &base : std::as_const(path)) {
|
||||||
if (base.isEmpty())
|
if (base.isEmpty())
|
||||||
continue;
|
continue;
|
||||||
|
const FilePath suspect = base / "cmake";
|
||||||
for (const QString &exec : execs) {
|
if (suspect.refersToExecutableFile(FilePath::WithAnySuffix))
|
||||||
const FilePath suspect = base.resolvePath(exec);
|
|
||||||
if (suspect.isExecutableFile())
|
|
||||||
suspects << suspect;
|
suspects << suspect;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<std::unique_ptr<CMakeTool>> found;
|
std::vector<std::unique_ptr<CMakeTool>> found;
|
||||||
for (const FilePath &command : std::as_const(suspects)) {
|
for (const FilePath &command : std::as_const(suspects)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user