forked from qt-creator/qt-creator
CMakePM: Only parse CMake files with the CMake parser
Change-Id: Ifc962a54ec9bf6ba0db4ec7813cb81d7c81a7d2c Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "fileapidataextractor.h"
|
||||
|
||||
#include "cmakeprojectconstants.h"
|
||||
#include "cmakeprojectmanagertr.h"
|
||||
#include "cmakeprojectplugin.h"
|
||||
#include "cmakespecificsettings.h"
|
||||
@@ -56,6 +57,9 @@ CMakeFileResult extractCMakeFilesData(const std::vector<CMakeFileInfo> &cmakefil
|
||||
CMakeFileInfo absolute(info);
|
||||
absolute.path = sfn;
|
||||
|
||||
const auto mimeType = Utils::mimeTypeForFile(info.path);
|
||||
if (mimeType.matchesName(Constants::CMAKE_MIMETYPE)
|
||||
|| mimeType.matchesName(Constants::CMAKE_PROJECT_MIMETYPE)) {
|
||||
expected_str<QByteArray> fileContent = sfn.fileContents();
|
||||
std::string errorString;
|
||||
if (fileContent) {
|
||||
@@ -66,6 +70,7 @@ CMakeFileResult extractCMakeFilesData(const std::vector<CMakeFileInfo> &cmakefil
|
||||
qCWarning(cmakeLogger)
|
||||
<< "Failed to parse:" << sfn.path() << QString::fromLatin1(errorString);
|
||||
}
|
||||
}
|
||||
|
||||
result.cmakeFiles.insert(absolute);
|
||||
|
||||
|
Reference in New Issue
Block a user