~ubuntu-branches/debian/sid/kdevelop/sid

« back to all changes in this revision

Viewing changes to projectmanagers/cmake/cmakemodelitems.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy Lainé
  • Date: 2010-05-05 07:21:55 UTC
  • mfrom: (1.2.3 upstream) (5.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100505072155-h78lx19pu04sbhtn
Tags: 4:4.0.0-2
* Upload to unstable (Closes: #579947, #481832).
* Acknowledge obsolete NMU fixes (Closes: #562410, #546961).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* KDevelop CMake Support
 
2
 *
 
3
 * Copyright 2006 Matt Rogers <mattr@kde.org>
 
4
 * Copyright 2007 Aleix Pol <aleixpol@gmail.com>
 
5
 *
 
6
 * This program is free software; you can redistribute it and/or
 
7
 * modify it under the terms of the GNU General Public License
 
8
 * as published by the Free Software Foundation; either version 2
 
9
 * of the License, or (at your option) any later version.
 
10
 *
 
11
 * This program is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 * GNU General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU General Public License
 
17
 * along with this program; if not, write to the Free Software
 
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 
19
 * 02110-1301, USA.
 
20
 */
 
21
 
 
22
#include "cmakemodelitems.h"
 
23
#include <QString>
 
24
#include <kdebug.h>
 
25
 
 
26
#include <language/duchain/duchain.h>
 
27
#include <language/duchain/parsingenvironment.h>
 
28
#include <project/interfaces/ibuildsystemmanager.h>
 
29
 
 
30
CMakeFolderItem::CMakeFolderItem( KDevelop::IProject *project, const QString &name, const QString& build,
 
31
                                  CMakeFolderItem* item)
 
32
    : KDevelop::ProjectBuildFolderItem( project, name, item ), m_formerParent(item), m_buildDir(build)
 
33
{}
 
34
 
 
35
QStringList CMakeFolderItem::includeDirectories() const
 
36
{
 
37
    QStringList urls(m_includeList);
 
38
 
 
39
    CMakeFolderItem *folder = formerParent();
 
40
    while(folder)
 
41
    {
 
42
        urls += folder->includeDirectories();
 
43
        folder = folder->formerParent();
 
44
    }
 
45
    return urls;
 
46
}
 
47
 
 
48
KUrl CMakeExecutableTargetItem::builtUrl() const
 
49
{
 
50
    KUrl ret;
 
51
    if(path.isEmpty())
 
52
        ret=project()->buildSystemManager()->buildDirectory(const_cast<CMakeExecutableTargetItem*>(this));
 
53
    else
 
54
        ret=path;
 
55
    
 
56
    ret.addPath(outputName);
 
57
    return ret;
 
58
}