CMakePM: Allow loading of projects that do not have any targets

Fixes: QTCREATORBUG-25509
Change-Id: I4e56576f0d9fdffa50c81f4901fb30d17952553e
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
(cherry picked from commit 86825283ed)
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Cristian Adam
2021-09-16 18:04:58 +02:00
parent 118883f66a
commit 845230166b

View File

@@ -341,13 +341,6 @@ static std::vector<Project> extractProjects(const QJsonArray &projects, QString
static std::vector<Target> extractTargets(const QJsonArray &targets, QString &errorMessage)
{
if (targets.isEmpty()) {
errorMessage
= QCoreApplication::translate("CMakeProjectManager::Internal",
"Invalid codemodel file generated by CMake: No targets.");
return {};
}
std::vector<Target> result;
for (const QJsonValue &v : targets) {
const QJsonObject obj = v.toObject();