MCPcopy Create free account
hub / github.com/KDE/kdevelop / import

Function import

plugins/cmake/cmakeimportjsonjob.cpp:94–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92}
93
94ImportData 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

Callers 4

startMethod · 0.85
importMethod · 0.85
importMethod · 0.85
importMethod · 0.85

Calls 7

enumerateTargetsFunction · 0.85
importCommandsFunction · 0.85
importTestSuitesFunction · 0.85
constBeginMethod · 0.80
constEndMethod · 0.80
QStringClass · 0.70
keyMethod · 0.45

Tested by 1

startMethod · 0.68