cmakeproject.cpp 18.6 KB
Newer Older
hjk's avatar
hjk committed
1
/****************************************************************************
con's avatar
con committed
2
**
3
4
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
con's avatar
con committed
5
**
hjk's avatar
hjk committed
6
** This file is part of Qt Creator.
con's avatar
con committed
7
**
hjk's avatar
hjk committed
8
9
10
11
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
12
13
14
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
15
**
16
17
18
19
20
21
22
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
con's avatar
con committed
23
**
hjk's avatar
hjk committed
24
****************************************************************************/
hjk's avatar
hjk committed
25

con's avatar
con committed
26
#include "cmakeproject.h"
Tobias Hunger's avatar
Tobias Hunger committed
27
28

#include "cmakebuildconfiguration.h"
29
#include "cmakekitinformation.h"
con's avatar
con committed
30
31
#include "cmakeprojectconstants.h"
#include "cmakeprojectnodes.h"
hjk's avatar
hjk committed
32
#include "cmakerunconfiguration.h"
33
#include "cmakeprojectmanager.h"
hjk's avatar
hjk committed
34

35
#include <coreplugin/progressmanager/progressmanager.h>
36
37
#include <cpptools/cpprawprojectpart.h>
#include <cpptools/cppprojectupdater.h>
Tobias Hunger's avatar
Tobias Hunger committed
38
#include <cpptools/generatedcodemodelsupport.h>
39
#include <cpptools/projectinfo.h>
40
#include <cpptools/cpptoolsconstants.h>
41
#include <projectexplorer/buildtargetinfo.h>
42
43
#include <projectexplorer/deploymentdata.h>
#include <projectexplorer/headerpath.h>
Tobias Hunger's avatar
Tobias Hunger committed
44
#include <projectexplorer/kitinformation.h>
45
46
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/target.h>
47
#include <projectexplorer/toolchain.h>
48
49
#include <qtsupport/baseqtversion.h>
#include <qtsupport/qtkitinformation.h>
50
#include <texteditor/textdocument.h>
51
#include <qmljs/qmljsmodelmanagerinterface.h>
Tobias Hunger's avatar
Tobias Hunger committed
52

53
#include <utils/algorithm.h>
hjk's avatar
hjk committed
54
#include <utils/qtcassert.h>
55
#include <utils/stringutils.h>
56
#include <utils/hostosinfo.h>
hjk's avatar
hjk committed
57

58
#include <QDir>
59
#include <QSet>
con's avatar
con committed
60

61
using namespace ProjectExplorer;
62
using namespace Utils;
63

64
65
66
67
namespace CMakeProjectManager {

using namespace Internal;

68
69
70
71
72
// QtCreator CMake Generator wishlist:
// Which make targets we need to build to get all executables
// What is the actual compiler executable
// DEFINES

73
74
75
/*!
  \class CMakeProject
*/
76
77
CMakeProject::CMakeProject(const FileName &fileName) : Project(Constants::CMAKEMIMETYPE, fileName),
    m_cppCodeModelUpdater(new CppTools::CppProjectUpdater(this))
con's avatar
con committed
78
{
Tobias Hunger's avatar
Tobias Hunger committed
79
    setId(CMakeProjectManager::Constants::CMAKEPROJECT_ID);
80
    setProjectContext(Core::Context(CMakeProjectManager::Constants::PROJECTCONTEXT));
81
    setProjectLanguages(Core::Context(ProjectExplorer::Constants::CXX_LANGUAGE_ID));
82
    setDisplayName(projectDirectory().fileName());
83

Tobias Hunger's avatar
Tobias Hunger committed
84
    connect(this, &CMakeProject::activeTargetChanged, this, &CMakeProject::handleActiveTargetChanged);
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
    connect(&m_treeScanner, &TreeScanner::finished, this, &CMakeProject::handleTreeScanningFinished);

    m_treeScanner.setFilter([this](const Utils::MimeType &mimeType, const Utils::FileName &fn) {
        // Mime checks requires more resources, so keep it last in check list
        auto isIgnored =
                fn.toString().startsWith(projectFilePath().toString() + ".user") ||
                TreeScanner::isWellKnownBinary(mimeType, fn);

        // Cache mime check result for speed up
        if (!isIgnored) {
            auto it = m_mimeBinaryCache.find(mimeType.name());
            if (it != m_mimeBinaryCache.end()) {
                isIgnored = *it;
            } else {
                isIgnored = TreeScanner::isMimeBinary(mimeType, fn);
                m_mimeBinaryCache[mimeType.name()] = isIgnored;
            }
        }

        return isIgnored;
    });

    m_treeScanner.setTypeFactory([](const Utils::MimeType &mimeType, const Utils::FileName &fn) {
        auto type = TreeScanner::genericFileType(mimeType, fn);
        if (type == FileType::Unknown) {
            if (mimeType.isValid()) {
                const QString mt = mimeType.name();
                if (mt == CMakeProjectManager::Constants::CMAKEPROJECTMIMETYPE
                    || mt == CMakeProjectManager::Constants::CMAKEMIMETYPE)
                    type = FileType::Project;
            }
        }
        return type;
    });

    scanProjectTree();
121
122
123
124
}

CMakeProject::~CMakeProject()
{
125
126
127
128
129
    if (!m_treeScanner.isFinished()) {
        auto future = m_treeScanner.future();
        future.cancel();
        future.waitForFinished();
    }
130
    delete m_cppCodeModelUpdater;
131
    qDeleteAll(m_extraCompilers);
132
    qDeleteAll(m_allFiles);
133
134
}

135
void CMakeProject::updateProjectData(CMakeBuildConfiguration *bc)
136
{
137
    QTC_ASSERT(bc, return);
138
139

    Target *t = activeTarget();
140
    if (!t || t->activeBuildConfiguration() != bc)
141
        return;
142
143
144
145

    if (!m_treeScanner.isFinished() || bc->isParsing())
        return;

146
    Kit *k = t->kit();
Tobias Hunger's avatar
Tobias Hunger committed
147

148
    auto newRoot = bc->generateProjectTree(m_allFiles);
149
150
    if (newRoot) {
        setDisplayName(newRoot->displayName());
151
        setRootProjectNode(newRoot);
152
    }
dt's avatar
dt committed
153

154
    updateApplicationAndDeploymentTargets();
155
    t->updateDefaultRunConfigurations();
dt's avatar
dt committed
156

157
    createGeneratedCodeModelSupport();
158

159
    ToolChain *tc = ToolChainKitInformation::toolChain(k, ProjectExplorer::Constants::CXX_LANGUAGE_ID);
Tobias Hunger's avatar
Tobias Hunger committed
160
    if (!tc) {
161
        emit fileListChanged();
162
        return;
Tobias Hunger's avatar
Tobias Hunger committed
163
    }
164

165
    CppTools::ProjectPart::QtVersion activeQtVersion = CppTools::ProjectPart::NoQt;
166
    if (QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(k)) {
167
168
169
170
171
172
        if (qtVersion->qtVersion() < QtSupport::QtVersionNumber(5,0,0))
            activeQtVersion = CppTools::ProjectPart::Qt4;
        else
            activeQtVersion = CppTools::ProjectPart::Qt5;
    }

173
174
    CppTools::RawProjectParts rpps;
    bc->updateCodeModel(rpps);
175

176
177
178
179
180
181
    for (CppTools::RawProjectPart &rpp : rpps) {
        // TODO: Set the Qt version only if target actually depends on Qt.
        rpp.setQtVersion(activeQtVersion);
        // TODO: Support also C
        rpp.setFlagsForCxx({tc, rpp.flagsForCxx.commandLineFlags});
    }
182

183
    m_cppCodeModelUpdater->update({this, nullptr, tc, k, rpps});
184

185
186
    updateQmlJSCodeModel();

187
    emit fileListChanged();
Tobias Hunger's avatar
Tobias Hunger committed
188

189
    emit bc->emitBuildTypeChanged();
190

191
192
193
194
195
196
197
198
199
200
201
202
    emitParsingFinished(true);
}

void CMakeProject::handleParsingError(CMakeBuildConfiguration *bc)
{
    QTC_ASSERT(bc, return);

    Target *t = activeTarget();
    if (!t || t->activeBuildConfiguration() != bc)
        return;

    emitParsingFinished(false);
con's avatar
con committed
203
204
}

205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
void CMakeProject::updateQmlJSCodeModel()
{
    QmlJS::ModelManagerInterface *modelManager = QmlJS::ModelManagerInterface::instance();
    QTC_ASSERT(modelManager, return);

    if (!activeTarget() || !activeTarget()->activeBuildConfiguration())
        return;

    QmlJS::ModelManagerInterface::ProjectInfo projectInfo =
            modelManager->defaultProjectInfoForProject(this);

    projectInfo.importPaths.clear();

    QString cmakeImports;
    CMakeBuildConfiguration *bc = qobject_cast<CMakeBuildConfiguration *>(activeTarget()->activeBuildConfiguration());
    if (!bc)
        return;

    const QList<ConfigModel::DataItem> &cm = bc->completeCMakeConfiguration();
    foreach (const ConfigModel::DataItem &di, cm) {
        if (di.key.contains(QStringLiteral("QML_IMPORT_PATH"))) {
            cmakeImports = di.value;
            break;
        }
    }

231
    foreach (const QString &cmakeImport, CMakeConfigItem::cmakeSplitValue(cmakeImports))
Tobias Hunger's avatar
Tobias Hunger committed
232
        projectInfo.importPaths.maybeInsert(FileName::fromString(cmakeImport), QmlJS::Dialect::Qml);
233
234
235
236

    modelManager->updateProjectInfo(projectInfo, this);
}

237
238
239
240
241
242
243
bool CMakeProject::needsConfiguration() const
{
    return targets().isEmpty();
}

bool CMakeProject::requiresTargetPanel() const
{
244
    return !targets().isEmpty();
245
246
}

247
248
249
250
251
bool CMakeProject::knowsAllBuildExecutables() const
{
    return false;
}

252
253
254
255
256
257
258
259
260
261
bool CMakeProject::supportsKit(Kit *k, QString *errorMessage) const
{
    if (!CMakeKitInformation::cmakeTool(k)) {
        if (errorMessage)
            *errorMessage = tr("No cmake tool set.");
        return false;
    }
    return true;
}

262
263
void CMakeProject::runCMake()
{
264
265
266
    CMakeBuildConfiguration *bc = nullptr;
    if (activeTarget())
        bc = qobject_cast<CMakeBuildConfiguration *>(activeTarget()->activeBuildConfiguration());
267

268
269
    if (bc)
        bc->runCMake();
270
271
}

272
273
274
275
276
277
278
279
280
void CMakeProject::buildCMakeTarget(const QString &buildTarget)
{
    QTC_ASSERT(!buildTarget.isEmpty(), return);
    Target *t = activeTarget();
    auto bc = qobject_cast<CMakeBuildConfiguration *>(t ? t->activeBuildConfiguration() : nullptr);
    if (bc)
        bc->buildTarget(buildTarget);
}

281
282
283
284
285
286
287
ProjectImporter *CMakeProject::projectImporter() const
{
    if (!m_projectImporter)
        m_projectImporter = std::make_unique<CMakeProjectImporter>(projectFilePath());
    return m_projectImporter.get();
}

Tobias Hunger's avatar
Tobias Hunger committed
288
289
QList<CMakeBuildTarget> CMakeProject::buildTargets() const
{
290
291
292
293
294
    CMakeBuildConfiguration *bc = nullptr;
    if (activeTarget())
        bc = qobject_cast<CMakeBuildConfiguration *>(activeTarget()->activeBuildConfiguration());

    return bc ? bc->buildTargets() : QList<CMakeBuildTarget>();
Tobias Hunger's avatar
Tobias Hunger committed
295
296
}

297
QStringList CMakeProject::buildTargetTitles(bool runnable) const
con's avatar
con committed
298
{
Tobias Hunger's avatar
Tobias Hunger committed
299
    const QList<CMakeBuildTarget> targets
Tobias Hunger's avatar
Tobias Hunger committed
300
301
302
303
            = runnable ? filtered(buildTargets(),
                                  [](const CMakeBuildTarget &ct) {
                                      return !ct.executable.isEmpty() && ct.targetType == ExecutableType;
                                  })
304
                       : buildTargets();
Tobias Hunger's avatar
Tobias Hunger committed
305
    return transform(targets, [](const CMakeBuildTarget &ct) { return ct.title; });
con's avatar
con committed
306
307
}

308
bool CMakeProject::hasBuildTarget(const QString &title) const
309
{
Tobias Hunger's avatar
Tobias Hunger committed
310
    return anyOf(buildTargets(), [title](const CMakeBuildTarget &ct) { return ct.title == title; });
311
312
}

313
Project::RestoreResult CMakeProject::fromMap(const QVariantMap &map, QString *errorMessage)
con's avatar
con committed
314
{
315
316
317
318
    RestoreResult result = Project::fromMap(map, errorMessage);
    if (result != RestoreResult::Ok)
        return result;
    return RestoreResult::Ok;
con's avatar
con committed
319
320
}

321
322
bool CMakeProject::setupTarget(Target *t)
{
323
    t->updateDefaultBuildConfigurations();
324
325
    if (t->buildConfigurations().isEmpty())
        return false;
326
    t->updateDefaultDeployConfigurations();
327
328
329
330

    return true;
}

331
332
333
334
335
336
337
338
339
340
void CMakeProject::scanProjectTree()
{
    if (!m_treeScanner.isFinished())
        return;
    m_treeScanner.asyncScanForFiles(projectDirectory());
    Core::ProgressManager::addTask(m_treeScanner.future(),
                                   tr("Scan \"%1\" project tree").arg(displayName()),
                                   "CMake.Scan.Tree");
}

341
342
343
344
345
void CMakeProject::handleActiveTargetChanged()
{
    if (m_connectedTarget) {
        disconnect(m_connectedTarget, &Target::activeBuildConfigurationChanged,
                   this, &CMakeProject::handleActiveBuildConfigurationChanged);
Tobias Hunger's avatar
Tobias Hunger committed
346
347
        disconnect(m_connectedTarget, &Target::kitChanged,
                   this, &CMakeProject::handleActiveBuildConfigurationChanged);
348
349
350
351
352
353
354
    }

    m_connectedTarget = activeTarget();

    if (m_connectedTarget) {
        connect(m_connectedTarget, &Target::activeBuildConfigurationChanged,
                this, &CMakeProject::handleActiveBuildConfigurationChanged);
Tobias Hunger's avatar
Tobias Hunger committed
355
356
        connect(m_connectedTarget, &Target::kitChanged,
                this, &CMakeProject::handleActiveBuildConfigurationChanged);
357
    }
Tobias Hunger's avatar
Tobias Hunger committed
358
359

    handleActiveBuildConfigurationChanged();
360
361
362
363
364
365
366
367
368
369
370
371
372
}

void CMakeProject::handleActiveBuildConfigurationChanged()
{
    if (!activeTarget() || !activeTarget()->activeBuildConfiguration())
        return;
    auto activeBc = qobject_cast<CMakeBuildConfiguration *>(activeTarget()->activeBuildConfiguration());

    foreach (Target *t, targets()) {
        foreach (BuildConfiguration *bc, t->buildConfigurations()) {
            auto i = qobject_cast<CMakeBuildConfiguration *>(bc);
            QTC_ASSERT(i, continue);
            if (i == activeBc)
Tobias Hunger's avatar
Tobias Hunger committed
373
                i->maybeForceReparse();
374
375
376
377
378
379
            else
                i->resetData();
        }
    }
}

Tobias Hunger's avatar
Tobias Hunger committed
380
void CMakeProject::handleParsingStarted(const CMakeBuildConfiguration *bc)
381
{
Tobias Hunger's avatar
Tobias Hunger committed
382
    if (activeTarget() && activeTarget()->activeBuildConfiguration() == bc)
383
        emitParsingStarted();
384
385
}

386
387
388
void CMakeProject::handleTreeScanningFinished()
{
    qDeleteAll(m_allFiles);
389
    m_allFiles = Utils::transform(m_treeScanner.release(), [](const FileNode *fn) { return fn; });
390
391
392
393
394
395
396
397
398
399
400
401

    auto t = activeTarget();
    if (!t)
        return;

    auto bc = qobject_cast<CMakeBuildConfiguration*>(t->activeBuildConfiguration());
    if (!bc)
        return;

    updateProjectData(bc);
}

402
CMakeBuildTarget CMakeProject::buildTargetForTitle(const QString &title)
403
{
404
    foreach (const CMakeBuildTarget &ct, buildTargets())
405
406
        if (ct.title == title)
            return ct;
407
    return CMakeBuildTarget();
408
409
}

410
QStringList CMakeProject::filesGeneratedFrom(const QString &sourceFile) const
dt's avatar
dt committed
411
{
412
    if (!activeTarget())
413
414
        return QStringList();
    QFileInfo fi(sourceFile);
415
416
    FileName project = projectDirectory();
    FileName baseDirectory = FileName::fromString(fi.absolutePath());
417
418

    while (baseDirectory.isChildOf(project)) {
419
        FileName cmakeListsTxt = baseDirectory;
Tobias Hunger's avatar
Tobias Hunger committed
420
        cmakeListsTxt.appendPath("CMakeLists.txt");
hjk's avatar
hjk committed
421
        if (cmakeListsTxt.exists())
422
423
424
            break;
        QDir dir(baseDirectory.toString());
        dir.cdUp();
425
        baseDirectory = FileName::fromString(dir.absolutePath());
426
427
428
429
    }

    QDir srcDirRoot = QDir(project.toString());
    QString relativePath = srcDirRoot.relativeFilePath(baseDirectory.toString());
430
    QDir buildDir = QDir(activeTarget()->activeBuildConfiguration()->buildDirectory().toString());
431
    QString generatedFilePath = buildDir.absoluteFilePath(relativePath);
432

Tobias Hunger's avatar
Tobias Hunger committed
433
434
    if (fi.suffix() == "ui") {
        generatedFilePath += "/ui_";
435
        generatedFilePath += fi.completeBaseName();
Tobias Hunger's avatar
Tobias Hunger committed
436
        generatedFilePath += ".h";
437
        return QStringList(QDir::cleanPath(generatedFilePath));
Tobias Hunger's avatar
Tobias Hunger committed
438
439
    } else if (fi.suffix() == "scxml") {
        generatedFilePath += "/";
440
        generatedFilePath += QDir::cleanPath(fi.completeBaseName());
441
442
        return QStringList({generatedFilePath + ".h",
                            generatedFilePath + ".cpp"});
443
444
445
446
    } else {
        // TODO: Other types will be added when adapters for their compilers become available.
        return QStringList();
    }
dt's avatar
dt committed
447
448
}

449
450
451
void CMakeProject::updateApplicationAndDeploymentTargets()
{
    Target *t = activeTarget();
452
453
    if (!t)
        return;
454
455
456
457
458

    QFile deploymentFile;
    QTextStream deploymentStream;
    QString deploymentPrefix;

459
460
461
    QDir sourceDir(t->project()->projectDirectory().toString());
    QDir buildDir(t->activeBuildConfiguration()->buildDirectory().toString());

Tobias Hunger's avatar
Tobias Hunger committed
462
    deploymentFile.setFileName(sourceDir.filePath("QtCreatorDeployment.txt"));
463
464
    // If we don't have a global QtCreatorDeployment.txt check for one created by the active build configuration
    if (!deploymentFile.exists())
Tobias Hunger's avatar
Tobias Hunger committed
465
        deploymentFile.setFileName(buildDir.filePath("QtCreatorDeployment.txt"));
466
467
468
    if (deploymentFile.open(QFile::ReadOnly | QFile::Text)) {
        deploymentStream.setDevice(&deploymentFile);
        deploymentPrefix = deploymentStream.readLine();
Tobias Hunger's avatar
Tobias Hunger committed
469
470
        if (!deploymentPrefix.endsWith('/'))
            deploymentPrefix.append('/');
471
472
473
474
    }

    BuildTargetInfoList appTargetList;
    DeploymentData deploymentData;
475

476
    foreach (const CMakeBuildTarget &ct, buildTargets()) {
477
        if (ct.targetType == UtilityType)
478
479
            continue;

480
481
482
483
484
485
486
        if (ct.targetType == ExecutableType || ct.targetType == DynamicLibraryType) {
            if (!ct.executable.isEmpty()) {
                deploymentData.addFile(ct.executable.toString(),
                                       deploymentPrefix + buildDir.relativeFilePath(ct.executable.toFileInfo().dir().path()),
                                       DeployableFile::TypeExecutable);
            }
        }
487
        if (ct.targetType == ExecutableType) {
488
489
            FileName srcWithTrailingSlash = FileName::fromString(ct.sourceDirectory.toString());
            srcWithTrailingSlash.appendString('/');
490
            // TODO: Put a path to corresponding .cbp file into projectFilePath?
491
            appTargetList.list << BuildTargetInfo(ct.title, ct.executable, srcWithTrailingSlash);
492
493
494
495
        }
    }

    QString absoluteSourcePath = sourceDir.absolutePath();
Tobias Hunger's avatar
Tobias Hunger committed
496
497
    if (!absoluteSourcePath.endsWith('/'))
        absoluteSourcePath.append('/');
Nikita Baryshnikov's avatar
Nikita Baryshnikov committed
498
499
    if (deploymentStream.device()) {
        while (!deploymentStream.atEnd()) {
Nikita Baryshnikov's avatar
Nikita Baryshnikov committed
500
            QString line = deploymentStream.readLine();
Tobias Hunger's avatar
Tobias Hunger committed
501
            if (!line.contains(':'))
Nikita Baryshnikov's avatar
Nikita Baryshnikov committed
502
                continue;
Tobias Hunger's avatar
Tobias Hunger committed
503
            QStringList file = line.split(':');
Nikita Baryshnikov's avatar
Nikita Baryshnikov committed
504
505
            deploymentData.addFile(absoluteSourcePath + file.at(0), deploymentPrefix + file.at(1));
        }
506
507
508
509
510
511
    }

    t->setApplicationTargets(appTargetList);
    t->setDeploymentData(deploymentData);
}

512
513
514
515
void CMakeProject::createGeneratedCodeModelSupport()
{
    qDeleteAll(m_extraCompilers);
    m_extraCompilers.clear();
516
    const QList<ExtraCompilerFactory *> factories =
Tobias Hunger's avatar
Tobias Hunger committed
517
            ExtraCompilerFactory::extraCompilerFactories();
518

519
520
521
    const QSet<QString> fileExtensions
            = Utils::transform<QSet>(factories, [](const ExtraCompilerFactory *f) { return f->sourceTag(); });

522
    // Find all files generated by any of the extra compilers, in a rather crude way.
523
524
    const QStringList fileList = files(SourceFiles, [&fileExtensions](const Node *n) {
        const QString fp = n->filePath().toString();
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
        const int pos = fp.lastIndexOf('.');
        return pos >= 0 && fileExtensions.contains(fp.mid(pos + 1));
    });

    // Generate the necessary information:
    for (const QString &file : fileList) {
        ExtraCompilerFactory *factory = Utils::findOrDefault(factories, [&file](const ExtraCompilerFactory *f) {
            return file.endsWith('.' + f->sourceTag());
        });
        QTC_ASSERT(factory, continue);

        QStringList generated = filesGeneratedFrom(file);
        if (generated.isEmpty())
            continue;

        const FileNameList fileNames
                = transform(generated,
                            [](const QString &s) { return FileName::fromString(s); });
        m_extraCompilers.append(factory->create(this, FileName::fromString(file),
                                                fileNames));
dt's avatar
dt committed
545
546
    }

547
    CppTools::GeneratedCodeModelSupport::update(m_extraCompilers);
dt's avatar
dt committed
548
549
}

550
void CMakeBuildTarget::clear()
dt's avatar
dt committed
551
{
552
553
554
    executable.clear();
    makeCommand.clear();
    workingDirectory.clear();
555
    sourceDirectory.clear();
556
    title.clear();
557
    targetType = UtilityType;
558
559
560
    includeFiles.clear();
    compilerOptions.clear();
    defines.clear();
561
    files.clear();
dt's avatar
dt committed
562
}
563
564

} // namespace CMakeProjectManager