| 92 | } |
| 93 | |
| 94 | ImportData import(const Path& commandsFile, const Path &targetsFilePath, const QString &sourceDir, const KDevelop::Path &buildPath) |
| 95 | { |
| 96 | QHash<KDevelop::Path, QVector<CMakeTarget>> cmakeTargets; |
| 97 | |
| 98 | //we don't have target type information in json, so we just announce all of them as exes |
| 99 | const auto targets = CMake::enumerateTargets(targetsFilePath, sourceDir, buildPath); |
| 100 | for(auto it = targets.constBegin(), itEnd = targets.constEnd(); it!=itEnd; ++it) { |
| 101 | cmakeTargets[it.key()] = kTransform<QVector<CMakeTarget>>(*it, [](const QString &targetName) { |
| 102 | return CMakeTarget{ |
| 103 | CMakeTarget::Executable, |
| 104 | targetName, |
| 105 | KDevelop::Path::List(), |
| 106 | KDevelop::Path::List(), |
| 107 | QString() |
| 108 | }; |
| 109 | }); |
| 110 | } |
| 111 | |
| 112 | return ImportData { |
| 113 | importCommands(commandsFile), |
| 114 | cmakeTargets, |
| 115 | CMake::importTestSuites(buildPath) |
| 116 | }; |
| 117 | } |
| 118 | |
| 119 | } |
| 120 | |