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

Method buildDirectory

plugins/qmakemanager/qmakemanager.cpp:96–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94}
95
96Path QMakeProjectManager::buildDirectory(ProjectBaseItem* item) const
97{
98 /// TODO: support includes by some other parent or sibling in a different file-tree-branch
99 QMakeFolderItem* qmakeItem = findQMakeFolderParent(item);
100 Path dir;
101 if (qmakeItem) {
102 if (!qmakeItem->parent()) {
103 // build root item
104 dir = QMakeConfig::buildDirFromSrc(qmakeItem->project(), qmakeItem->path());
105 } else {
106 // build sub-item
107 const auto proFiles = qmakeItem->projectFiles();
108 for (QMakeProjectFile* pro : proFiles) {
109 if (QDir(pro->absoluteDir()) == QFileInfo(qmakeItem->path().toUrl().toLocalFile() + QLatin1Char('/')).absoluteDir()
110 || pro->hasSubProject(qmakeItem->path().toUrl().toLocalFile())) {
111 // get path from project root and it to buildDir
112 dir = QMakeConfig::buildDirFromSrc(qmakeItem->project(), Path(pro->absoluteDir()));
113 break;
114 }
115 }
116 }
117 }
118
119 qCDebug(KDEV_QMAKE) << "build dir for" << item->text() << item->path() << "is:" << dir;
120 return dir;
121}
122
123ProjectFolderItem* QMakeProjectManager::createFolderItem(IProject* project, const Path& path, ProjectBaseItem* parent)
124{

Callers 1

testBuildDirectoryMethod · 0.45

Calls 13

findQMakeFolderParentFunction · 0.85
projectFilesMethod · 0.80
absoluteDirMethod · 0.80
toLocalFileMethod · 0.80
hasSubProjectMethod · 0.80
PathClass · 0.70
QDirClass · 0.50
QFileInfoClass · 0.50
parentMethod · 0.45
projectMethod · 0.45
pathMethod · 0.45
toUrlMethod · 0.45

Tested by 1

testBuildDirectoryMethod · 0.36