diff --git a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp index 89993f24056..fd492289555 100644 --- a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp +++ b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp @@ -411,7 +411,8 @@ static RawProjectParts generateRawProjectParts(const QFuture &cancelFuture RawProjectPart rpp; rpp.setProjectFileLocation(t.sourceDir.pathAppended("CMakeLists.txt").toString()); rpp.setBuildSystemTarget(t.name); - const QString postfix = needPostfix ? "_cg" + QString::number(count) : QString(); + const QString postfix = needPostfix ? QString("_%1_%2").arg(ci.language).arg(count) + : QString(); rpp.setDisplayName(t.id + postfix); rpp.setMacros(transform(ci.defines, &DefineInfo::define)); rpp.setHeaderPaths(transform(ci.includes, &IncludeInfo::path)); @@ -436,6 +437,10 @@ static RawProjectParts generateRawProjectParts(const QFuture &cancelFuture addToSources(si.path); } + // Skip groups with only generated source files e.g. /.rcc/qrc_.cpp + if (allOf(ci.sources, [t](const auto &idx) { return t.sources.at(idx).isGenerated; })) + continue; + // If we are not in a pch compiler group, add all the headers that are not generated const bool hasPchSource = anyOf(sources, [buildDirectory](const QString &path) { return isPchFile(buildDirectory, FilePath::fromString(path));