| 56 | } |
| 57 | |
| 58 | Path CustomBuildSystem::buildDirectory( ProjectBaseItem* item ) const |
| 59 | { |
| 60 | Path p; |
| 61 | if( item->folder() ) { |
| 62 | p = item->path(); |
| 63 | } else { |
| 64 | ProjectBaseItem* parent = item; |
| 65 | while( !parent->folder() ) { |
| 66 | parent = parent->parent(); |
| 67 | } |
| 68 | p = parent->path(); |
| 69 | } |
| 70 | const QString relative = item->project()->path().relativePath(p); |
| 71 | KConfigGroup grp = configuration( item->project() ); |
| 72 | if(!grp.isValid()) { |
| 73 | return Path(); |
| 74 | } |
| 75 | |
| 76 | Path builddir(grp.readEntry(ConfigConstants::buildDirKey(), QUrl())); |
| 77 | if(!builddir.isValid() ) // set builddir to default if project contains a buildDirKey that does not have a value |
| 78 | { |
| 79 | builddir = item->project()->path(); |
| 80 | } |
| 81 | builddir.addPath( relative ); |
| 82 | return builddir; |
| 83 | } |
| 84 | |
| 85 | IProjectBuilder* CustomBuildSystem::builder() const |
| 86 | { |