2016-10-17 13:55:54 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
|
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator.
|
|
|
|
|
**
|
|
|
|
|
** 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
|
|
|
|
|
** 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.
|
|
|
|
|
**
|
|
|
|
|
** 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.
|
|
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#include "builddirreader.h"
|
|
|
|
|
|
2019-06-13 14:24:04 +02:00
|
|
|
#include "fileapireader.h"
|
2016-10-17 14:38:38 +02:00
|
|
|
#include "servermodereader.h"
|
2016-10-17 13:55:54 +02:00
|
|
|
|
2017-09-28 11:32:39 +02:00
|
|
|
#include <utils/qtcassert.h>
|
2016-10-17 13:55:54 +02:00
|
|
|
|
|
|
|
|
using namespace ProjectExplorer;
|
|
|
|
|
|
|
|
|
|
namespace CMakeProjectManager {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------
|
|
|
|
|
// BuildDirReader:
|
|
|
|
|
// --------------------------------------------------------------------
|
|
|
|
|
|
2019-06-05 15:42:46 +02:00
|
|
|
std::unique_ptr<BuildDirReader> BuildDirReader::createReader(const BuildDirParameters &p)
|
2016-10-17 13:55:54 +02:00
|
|
|
{
|
2018-05-24 16:57:31 +02:00
|
|
|
CMakeTool *cmake = p.cmakeTool();
|
2019-06-05 15:42:46 +02:00
|
|
|
QTC_ASSERT(p.isValid() && cmake, return {});
|
2019-06-18 11:31:46 +02:00
|
|
|
|
|
|
|
|
switch (cmake->readerType()) {
|
|
|
|
|
case CMakeTool::FileApi:
|
2019-06-13 14:24:04 +02:00
|
|
|
return std::make_unique<FileApiReader>();
|
2019-06-18 11:31:46 +02:00
|
|
|
case CMakeTool::ServerMode:
|
2019-06-05 15:42:46 +02:00
|
|
|
return std::make_unique<ServerModeReader>();
|
2019-06-18 11:31:46 +02:00
|
|
|
default:
|
2020-02-17 11:48:19 +01:00
|
|
|
return {};
|
2019-06-18 11:31:46 +02:00
|
|
|
}
|
2016-10-17 13:55:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace CMakeProjectManager
|