2013-01-09 09:23:37 -05:00
|
|
|
/**************************************************************************
|
|
|
|
|
**
|
2013-10-11 17:44:13 +02:00
|
|
|
** Copyright (C) 2013 BlackBerry Limited. All rights reserved.
|
2013-01-09 09:23:37 -05:00
|
|
|
**
|
2013-10-11 17:44:13 +02:00
|
|
|
** Contact: BlackBerry (qt@blackberry.com)
|
2013-01-09 09:23:37 -05:00
|
|
|
** Contact: KDAB (info@kdab.com)
|
|
|
|
|
**
|
|
|
|
|
** 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 Digia. For licensing terms and
|
|
|
|
|
** conditions see http://qt.digia.com/licensing. For further information
|
|
|
|
|
** use the contact form at http://qt.digia.com/contact-us.
|
|
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
|
|
|
** General Public License version 2.1 as published by the Free Software
|
|
|
|
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
|
|
|
** packaging of this file. Please review the following information to
|
|
|
|
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
|
|
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
|
|
|
**
|
|
|
|
|
** In addition, as a special exception, Digia gives you certain additional
|
|
|
|
|
** rights. These rights are described in the Digia Qt LGPL Exception
|
|
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#include "blackberryconfiguration.h"
|
|
|
|
|
#include "blackberryqtversion.h"
|
|
|
|
|
|
2013-07-04 16:21:33 +02:00
|
|
|
#include "qnxutils.h"
|
2013-01-09 09:23:37 -05:00
|
|
|
|
|
|
|
|
#include <projectexplorer/projectexplorerconstants.h>
|
|
|
|
|
#include <projectexplorer/kitmanager.h>
|
|
|
|
|
#include <projectexplorer/kitinformation.h>
|
|
|
|
|
#include <projectexplorer/toolchainmanager.h>
|
|
|
|
|
|
2013-07-04 16:21:33 +02:00
|
|
|
#include <qtsupport/baseqtversion.h>
|
|
|
|
|
#include <qtsupport/qtversionmanager.h>
|
|
|
|
|
#include <qtsupport/qtkitinformation.h>
|
|
|
|
|
|
2013-01-09 09:23:37 -05:00
|
|
|
#include <qt4projectmanager/qmakekitinformation.h>
|
|
|
|
|
|
|
|
|
|
#include <debugger/debuggerkitinformation.h>
|
|
|
|
|
|
|
|
|
|
#include <QFileInfo>
|
|
|
|
|
#include <QDir>
|
|
|
|
|
#include <QMessageBox>
|
|
|
|
|
|
2013-08-29 13:14:19 +02:00
|
|
|
using namespace ProjectExplorer;
|
|
|
|
|
using namespace QtSupport;
|
|
|
|
|
using namespace Utils;
|
2013-10-09 12:42:00 +02:00
|
|
|
using namespace Debugger;
|
2013-08-29 13:14:19 +02:00
|
|
|
|
2013-01-09 09:23:37 -05:00
|
|
|
namespace Qnx {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2013-08-29 13:14:19 +02:00
|
|
|
BlackBerryConfiguration::BlackBerryConfiguration(const FileName &ndkEnvFile, bool isAutoDetected,
|
2013-08-22 17:00:58 +02:00
|
|
|
const QString &displayName)
|
2013-07-01 15:09:10 +02:00
|
|
|
{
|
2013-08-22 17:00:58 +02:00
|
|
|
Q_ASSERT(!QFileInfo(ndkEnvFile.toString()).isDir());
|
|
|
|
|
m_ndkEnvFile = ndkEnvFile;
|
2013-07-04 16:21:33 +02:00
|
|
|
m_isAutoDetected = isAutoDetected;
|
2013-08-22 17:00:58 +02:00
|
|
|
QString ndkPath = ndkEnvFile.parentDir().toString();
|
|
|
|
|
m_displayName = displayName.isEmpty() ? ndkPath.split(QDir::separator()).last() : displayName;
|
2013-10-12 19:20:37 +02:00
|
|
|
m_qnxEnv = QnxUtils::qnxEnvironmentFromNdkFile(m_ndkEnvFile.toString());
|
|
|
|
|
|
|
|
|
|
QString ndkTarget;
|
|
|
|
|
QString qnxHost;
|
|
|
|
|
foreach (const Utils::EnvironmentItem &item, m_qnxEnv) {
|
|
|
|
|
if (item.name == QLatin1String("QNX_TARGET"))
|
|
|
|
|
ndkTarget = item.value;
|
|
|
|
|
|
|
|
|
|
else if (item.name == QLatin1String("QNX_HOST"))
|
|
|
|
|
qnxHost = item.value;
|
|
|
|
|
|
|
|
|
|
}
|
2013-07-01 15:09:10 +02:00
|
|
|
|
2013-01-09 09:23:37 -05:00
|
|
|
QString sep = QString::fromLatin1("%1qnx6").arg(QDir::separator());
|
2013-07-04 16:21:33 +02:00
|
|
|
m_targetName = ndkTarget.split(sep).first().split(QDir::separator()).last();
|
2013-01-09 09:23:37 -05:00
|
|
|
|
2013-01-18 09:50:47 -05:00
|
|
|
if (QDir(ndkTarget).exists())
|
2013-08-29 13:14:19 +02:00
|
|
|
m_sysRoot = FileName::fromString(ndkTarget);
|
2013-01-09 09:23:37 -05:00
|
|
|
|
2013-08-29 13:14:19 +02:00
|
|
|
FileName qmake4Path = QnxUtils::executableWithExtension(FileName::fromString(qnxHost + QLatin1String("/usr/bin/qmake")));
|
|
|
|
|
FileName qmake5Path = QnxUtils::executableWithExtension(FileName::fromString(qnxHost + QLatin1String("/usr/bin/qt5/qmake")));
|
|
|
|
|
FileName gccPath = QnxUtils::executableWithExtension(FileName::fromString(qnxHost + QLatin1String("/usr/bin/qcc")));
|
|
|
|
|
FileName deviceGdbPath = QnxUtils::executableWithExtension(FileName::fromString(qnxHost + QLatin1String("/usr/bin/ntoarm-gdb")));
|
|
|
|
|
FileName simulatorGdbPath = QnxUtils::executableWithExtension(FileName::fromString(qnxHost + QLatin1String("/usr/bin/ntox86-gdb")));
|
2013-01-09 09:23:37 -05:00
|
|
|
|
2013-07-01 15:09:10 +02:00
|
|
|
if (qmake4Path.toFileInfo().exists())
|
2013-07-04 16:21:33 +02:00
|
|
|
m_qmake4BinaryFile = qmake4Path;
|
2013-07-01 15:09:10 +02:00
|
|
|
|
|
|
|
|
if (qmake5Path.toFileInfo().exists())
|
2013-07-04 16:21:33 +02:00
|
|
|
m_qmake5BinaryFile = qmake5Path;
|
2013-01-17 16:06:13 -02:00
|
|
|
|
2013-07-04 16:21:33 +02:00
|
|
|
if (gccPath.toFileInfo().exists())
|
|
|
|
|
m_gccCompiler = gccPath;
|
2013-01-17 16:06:13 -02:00
|
|
|
|
2013-07-04 16:21:33 +02:00
|
|
|
if (deviceGdbPath.toFileInfo().exists())
|
2013-10-15 16:17:37 +02:00
|
|
|
m_deviceDebugger = deviceGdbPath;
|
2013-01-17 16:06:13 -02:00
|
|
|
|
2013-07-04 16:21:33 +02:00
|
|
|
if (simulatorGdbPath.toFileInfo().exists())
|
2013-10-15 16:17:37 +02:00
|
|
|
m_simulatorDebugger = simulatorGdbPath;
|
2013-01-17 16:06:13 -02:00
|
|
|
}
|
|
|
|
|
|
2013-07-04 16:21:33 +02:00
|
|
|
QString BlackBerryConfiguration::ndkPath() const
|
2013-01-17 16:06:13 -02:00
|
|
|
{
|
2013-08-22 17:00:58 +02:00
|
|
|
return m_ndkEnvFile.parentDir().toString();
|
2013-01-17 16:06:13 -02:00
|
|
|
}
|
|
|
|
|
|
2013-07-04 16:21:33 +02:00
|
|
|
QString BlackBerryConfiguration::displayName() const
|
2013-01-17 16:06:13 -02:00
|
|
|
{
|
2013-07-04 16:21:33 +02:00
|
|
|
return m_displayName;
|
2013-01-17 16:06:13 -02:00
|
|
|
}
|
|
|
|
|
|
2013-07-04 16:21:33 +02:00
|
|
|
QString BlackBerryConfiguration::targetName() const
|
2013-01-17 16:06:13 -02:00
|
|
|
{
|
2013-07-04 16:21:33 +02:00
|
|
|
return m_targetName;
|
2013-01-17 16:06:13 -02:00
|
|
|
}
|
|
|
|
|
|
2013-07-04 16:21:33 +02:00
|
|
|
bool BlackBerryConfiguration::isAutoDetected() const
|
2013-01-09 09:23:37 -05:00
|
|
|
{
|
2013-07-04 16:21:33 +02:00
|
|
|
return m_isAutoDetected;
|
2013-01-09 09:23:37 -05:00
|
|
|
}
|
|
|
|
|
|
2013-07-04 16:21:33 +02:00
|
|
|
bool BlackBerryConfiguration::isActive() const
|
2013-01-09 09:23:37 -05:00
|
|
|
{
|
2013-10-15 16:17:37 +02:00
|
|
|
return !findRegisteredQtVersions().isEmpty();
|
2013-01-17 16:06:13 -02:00
|
|
|
}
|
|
|
|
|
|
2013-07-04 16:21:33 +02:00
|
|
|
bool BlackBerryConfiguration::isValid() const
|
2013-01-17 16:06:13 -02:00
|
|
|
{
|
2013-07-04 16:21:33 +02:00
|
|
|
return !((m_qmake4BinaryFile.isEmpty() && m_qmake5BinaryFile.isEmpty()) || m_gccCompiler.isEmpty()
|
2013-10-15 16:17:37 +02:00
|
|
|
|| m_deviceDebugger.isEmpty() || m_simulatorDebugger.isEmpty());
|
2013-04-12 17:09:11 -03:00
|
|
|
}
|
|
|
|
|
|
2013-08-29 13:14:19 +02:00
|
|
|
FileName BlackBerryConfiguration::ndkEnvFile() const
|
2013-08-22 17:00:58 +02:00
|
|
|
{
|
|
|
|
|
return m_ndkEnvFile;
|
|
|
|
|
}
|
|
|
|
|
|
2013-08-29 13:14:19 +02:00
|
|
|
FileName BlackBerryConfiguration::qmake4BinaryFile() const
|
2013-04-12 17:09:11 -03:00
|
|
|
{
|
2013-07-04 16:21:33 +02:00
|
|
|
return m_qmake4BinaryFile;
|
|
|
|
|
}
|
2013-04-12 17:09:11 -03:00
|
|
|
|
2013-08-29 13:14:19 +02:00
|
|
|
FileName BlackBerryConfiguration::qmake5BinaryFile() const
|
2013-07-04 16:21:33 +02:00
|
|
|
{
|
|
|
|
|
return m_qmake5BinaryFile;
|
|
|
|
|
}
|
2013-04-12 17:09:11 -03:00
|
|
|
|
2013-08-29 13:14:19 +02:00
|
|
|
FileName BlackBerryConfiguration::gccCompiler() const
|
2013-07-04 16:21:33 +02:00
|
|
|
{
|
|
|
|
|
return m_gccCompiler;
|
2013-04-12 17:09:11 -03:00
|
|
|
}
|
|
|
|
|
|
2013-08-29 13:14:19 +02:00
|
|
|
FileName BlackBerryConfiguration::deviceDebuger() const
|
2013-04-12 17:09:11 -03:00
|
|
|
{
|
2013-10-15 16:17:37 +02:00
|
|
|
return m_deviceDebugger;
|
2013-07-04 16:21:33 +02:00
|
|
|
}
|
2013-04-12 17:09:11 -03:00
|
|
|
|
2013-08-29 13:14:19 +02:00
|
|
|
FileName BlackBerryConfiguration::simulatorDebuger() const
|
2013-07-04 16:21:33 +02:00
|
|
|
{
|
2013-10-15 16:17:37 +02:00
|
|
|
return m_simulatorDebugger;
|
2013-07-04 16:21:33 +02:00
|
|
|
}
|
2013-04-12 17:09:11 -03:00
|
|
|
|
2013-08-29 13:14:19 +02:00
|
|
|
FileName BlackBerryConfiguration::sysRoot() const
|
2013-07-04 16:21:33 +02:00
|
|
|
{
|
|
|
|
|
return m_sysRoot;
|
2013-01-17 16:06:13 -02:00
|
|
|
}
|
|
|
|
|
|
2013-10-12 19:20:37 +02:00
|
|
|
QList<Utils::EnvironmentItem> BlackBerryConfiguration::qnxEnv() const
|
2013-01-17 16:06:13 -02:00
|
|
|
{
|
2013-07-04 16:21:33 +02:00
|
|
|
return m_qnxEnv;
|
2013-01-17 16:06:13 -02:00
|
|
|
}
|
|
|
|
|
|
2013-10-15 16:17:37 +02:00
|
|
|
void BlackBerryConfiguration::createConfigurationPerQtVersion(
|
|
|
|
|
const FileName &qmakePath, Qnx::QnxArchitecture arch)
|
2013-01-17 16:06:13 -02:00
|
|
|
{
|
2013-10-15 16:17:37 +02:00
|
|
|
QnxAbstractQtVersion *version = createQtVersion(qmakePath, arch);
|
|
|
|
|
ToolChain *toolChain = createGccToolChain(version);
|
|
|
|
|
Kit *kit = createKit(version, toolChain);
|
|
|
|
|
|
|
|
|
|
if (version && toolChain && kit) {
|
2013-07-04 16:21:33 +02:00
|
|
|
// register
|
2013-10-15 16:17:37 +02:00
|
|
|
QtVersionManager::addVersion(version);
|
|
|
|
|
ToolChainManager::registerToolChain(toolChain);
|
|
|
|
|
KitManager::registerKit(kit);
|
2013-07-04 16:21:33 +02:00
|
|
|
}
|
2013-01-09 09:23:37 -05:00
|
|
|
}
|
|
|
|
|
|
2013-10-15 16:17:37 +02:00
|
|
|
QnxAbstractQtVersion *BlackBerryConfiguration::createQtVersion(
|
|
|
|
|
const FileName &qmakePath, Qnx::QnxArchitecture arch)
|
2013-01-09 09:23:37 -05:00
|
|
|
{
|
2013-10-15 16:17:37 +02:00
|
|
|
QnxAbstractQtVersion *version = new BlackBerryQtVersion(
|
|
|
|
|
arch, qmakePath, true, QString(), m_ndkEnvFile.toString());
|
|
|
|
|
version->setDisplayName(tr("Qt %1 for %2 %3 - %4").arg(
|
|
|
|
|
version->qtVersionString(), version->platformDisplayName(),
|
|
|
|
|
version->archString(), m_targetName));
|
2013-01-09 09:23:37 -05:00
|
|
|
return version;
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-15 16:17:37 +02:00
|
|
|
GccToolChain *BlackBerryConfiguration::createGccToolChain(QnxAbstractQtVersion *version)
|
2013-01-09 09:23:37 -05:00
|
|
|
{
|
2013-10-15 16:17:37 +02:00
|
|
|
GccToolChain* toolChain = new GccToolChain(
|
|
|
|
|
QLatin1String(ProjectExplorer::Constants::GCC_TOOLCHAIN_ID), ToolChain::AutoDetection);
|
2013-10-15 17:04:28 +02:00
|
|
|
//: QCC is the compiler for QNX.
|
2013-10-15 16:17:37 +02:00
|
|
|
toolChain->setDisplayName(tr("QCC for Qt %1 for %2 %3 - %4").arg(
|
|
|
|
|
version->qtVersionString(), version->platformDisplayName(),
|
|
|
|
|
version->archString(), m_targetName));
|
|
|
|
|
toolChain->setCompilerCommand(m_gccCompiler);
|
|
|
|
|
QList<Abi> abis = version->qtAbis();
|
|
|
|
|
if (!abis.isEmpty())
|
|
|
|
|
toolChain->setTargetAbi(abis.first());
|
|
|
|
|
return toolChain;
|
2013-01-09 09:23:37 -05:00
|
|
|
}
|
|
|
|
|
|
2013-10-15 16:17:37 +02:00
|
|
|
Kit *BlackBerryConfiguration::createKit(QnxAbstractQtVersion *version, ToolChain *toolChain)
|
2013-01-09 09:23:37 -05:00
|
|
|
{
|
2013-08-29 13:14:19 +02:00
|
|
|
Kit *kit = new Kit;
|
2013-10-15 16:17:37 +02:00
|
|
|
bool isSimulator = version->architecture() == X86;
|
2013-09-25 11:38:26 +02:00
|
|
|
|
2013-10-15 16:17:37 +02:00
|
|
|
QtKitInformation::setQtVersion(kit, version);
|
|
|
|
|
ToolChainKitInformation::setToolChain(kit, toolChain);
|
2013-09-25 11:38:26 +02:00
|
|
|
|
2013-10-09 12:42:00 +02:00
|
|
|
DebuggerItem debugger;
|
2013-10-15 16:17:37 +02:00
|
|
|
debugger.setCommand(isSimulator ? m_simulatorDebugger : m_deviceDebugger);
|
2013-10-09 12:42:00 +02:00
|
|
|
debugger.setEngineType(GdbEngineType);
|
2013-09-25 11:38:26 +02:00
|
|
|
debugger.setAutoDetected(true);
|
2013-10-15 16:17:37 +02:00
|
|
|
debugger.setAbi(toolChain->targetAbi());
|
|
|
|
|
debugger.setDisplayName(tr("Debugger for Qt %1 for %2 %3 - %4").arg(
|
|
|
|
|
version->qtVersionString(), version->platformDisplayName(),
|
|
|
|
|
version->archString(), m_targetName));
|
2013-10-09 12:42:00 +02:00
|
|
|
|
2013-10-18 19:27:31 +02:00
|
|
|
QVariant id = DebuggerItemManager::registerDebugger(debugger);
|
|
|
|
|
DebuggerKitInformation::setDebugger(kit, id);
|
2013-09-25 11:38:26 +02:00
|
|
|
|
2013-10-15 16:17:37 +02:00
|
|
|
if (isSimulator)
|
2013-10-16 11:02:37 +02:00
|
|
|
QmakeProjectManager::QmakeKitInformation::setMkspec(
|
2013-10-15 16:17:37 +02:00
|
|
|
kit, FileName::fromString(QLatin1String("blackberry-x86-qcc")));
|
2013-01-09 09:23:37 -05:00
|
|
|
|
2013-08-29 13:14:19 +02:00
|
|
|
DeviceTypeKitInformation::setDeviceTypeId(kit, Constants::QNX_BB_OS_TYPE);
|
|
|
|
|
SysRootKitInformation::setSysRoot(kit, m_sysRoot);
|
2013-01-09 09:23:37 -05:00
|
|
|
|
2013-10-15 16:17:37 +02:00
|
|
|
kit->setDisplayName(tr("%1 %2 - Qt %3 - %4").arg(
|
|
|
|
|
version->platformDisplayName(), isSimulator ? tr("Simulator") : tr("Device"),
|
|
|
|
|
version->qtVersionString(), m_targetName));
|
|
|
|
|
kit->setIconPath(FileName::fromString(QLatin1String(Constants::QNX_BB_CATEGORY_ICON)));
|
|
|
|
|
|
|
|
|
|
kit->setAutoDetected(true);
|
|
|
|
|
kit->setMutable(DeviceKitInformation::id(), true);
|
2013-01-09 09:23:37 -05:00
|
|
|
|
2013-09-09 17:10:41 +02:00
|
|
|
kit->setSticky(QtKitInformation::id(), true);
|
|
|
|
|
kit->setSticky(ToolChainKitInformation::id(), true);
|
|
|
|
|
kit->setSticky(DeviceTypeKitInformation::id(), true);
|
|
|
|
|
kit->setSticky(SysRootKitInformation::id(), true);
|
2013-10-09 12:42:00 +02:00
|
|
|
kit->setSticky(DebuggerKitInformation::id(), true);
|
2013-10-16 11:02:37 +02:00
|
|
|
kit->setSticky(QmakeProjectManager::QmakeKitInformation::id(), true);
|
2013-10-15 16:17:37 +02:00
|
|
|
|
|
|
|
|
return kit;
|
2013-01-09 09:23:37 -05:00
|
|
|
}
|
|
|
|
|
|
2013-07-04 16:21:33 +02:00
|
|
|
bool BlackBerryConfiguration::activate()
|
2013-01-09 09:23:37 -05:00
|
|
|
{
|
2013-07-04 16:21:33 +02:00
|
|
|
if (!isValid()) {
|
|
|
|
|
if (m_isAutoDetected)
|
|
|
|
|
return false;
|
2013-01-09 09:23:37 -05:00
|
|
|
|
2013-10-09 17:19:10 +02:00
|
|
|
QString errorMessage = tr("The following errors occurred while activating target: %1").arg(m_targetName);
|
2013-09-06 16:51:48 +02:00
|
|
|
if (m_qmake4BinaryFile.isEmpty() && m_qmake5BinaryFile.isEmpty())
|
2013-09-04 16:20:40 +02:00
|
|
|
errorMessage += QLatin1Char('\n') + tr("- No Qt version found.");
|
2013-01-09 09:23:37 -05:00
|
|
|
|
2013-07-04 16:21:33 +02:00
|
|
|
if (m_gccCompiler.isEmpty())
|
2013-09-04 16:20:40 +02:00
|
|
|
errorMessage += QLatin1Char('\n') + tr("- No GCC compiler found.");
|
2013-01-09 09:23:37 -05:00
|
|
|
|
2013-10-15 16:17:37 +02:00
|
|
|
if (m_deviceDebugger.isEmpty())
|
2013-09-04 16:20:40 +02:00
|
|
|
errorMessage += QLatin1Char('\n') + tr("- No GDB debugger found for BB10 Device.");
|
2013-01-09 09:23:37 -05:00
|
|
|
|
2013-10-15 16:17:37 +02:00
|
|
|
if (!m_simulatorDebugger.isEmpty())
|
2013-09-04 16:20:40 +02:00
|
|
|
errorMessage += QLatin1Char('\n') + tr("- No GDB debugger found for BB10 Simulator.");
|
2013-01-09 09:23:37 -05:00
|
|
|
|
2013-09-04 16:20:40 +02:00
|
|
|
QMessageBox::warning(0, tr("Cannot Set up BB10 Configuration"),
|
2013-07-04 16:21:33 +02:00
|
|
|
errorMessage, QMessageBox::Ok);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2013-07-01 15:09:10 +02:00
|
|
|
|
2013-10-15 16:17:37 +02:00
|
|
|
if (isActive())
|
2013-07-04 16:21:33 +02:00
|
|
|
return true;
|
2013-01-09 09:23:37 -05:00
|
|
|
|
2013-10-15 16:17:37 +02:00
|
|
|
deactivate(); // cleaning-up artifacts autodetected by old QtCreator versions
|
2013-01-09 09:23:37 -05:00
|
|
|
|
2013-10-15 16:17:37 +02:00
|
|
|
if (!m_qmake4BinaryFile.isEmpty()) {
|
|
|
|
|
createConfigurationPerQtVersion(m_qmake4BinaryFile, Qnx::ArmLeV7);
|
|
|
|
|
createConfigurationPerQtVersion(m_qmake4BinaryFile, Qnx::X86);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!m_qmake5BinaryFile.isEmpty()) {
|
|
|
|
|
createConfigurationPerQtVersion(m_qmake5BinaryFile, Qnx::ArmLeV7);
|
|
|
|
|
createConfigurationPerQtVersion(m_qmake5BinaryFile, Qnx::X86);
|
|
|
|
|
}
|
2013-01-09 09:23:37 -05:00
|
|
|
|
2013-07-04 16:21:33 +02:00
|
|
|
return true;
|
2013-01-09 09:23:37 -05:00
|
|
|
}
|
|
|
|
|
|
2013-10-15 16:17:37 +02:00
|
|
|
QList<BaseQtVersion *> BlackBerryConfiguration::findRegisteredQtVersions() const
|
2013-01-09 09:23:37 -05:00
|
|
|
{
|
2013-10-15 16:17:37 +02:00
|
|
|
QList<BaseQtVersion *> versions;
|
|
|
|
|
foreach (BaseQtVersion *version, QtVersionManager::versions()) {
|
|
|
|
|
if (version->type() == QLatin1String(Constants::QNX_BB_QT)) {
|
|
|
|
|
QnxAbstractQtVersion *qnxVersion = dynamic_cast<QnxAbstractQtVersion *>(version);
|
|
|
|
|
if (qnxVersion && qnxVersion->isAutodetected()
|
|
|
|
|
&& (qnxVersion->qmakeCommand() == qmake4BinaryFile()
|
|
|
|
|
|| qnxVersion->qmakeCommand() == qmake5BinaryFile()))
|
|
|
|
|
versions << qnxVersion;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return versions;
|
|
|
|
|
}
|
2013-01-09 09:23:37 -05:00
|
|
|
|
2013-10-15 16:17:37 +02:00
|
|
|
void BlackBerryConfiguration::deactivate()
|
|
|
|
|
{
|
|
|
|
|
QList<BaseQtVersion *> versions = findRegisteredQtVersions();
|
|
|
|
|
QList<ToolChain *> toolChains;
|
|
|
|
|
foreach (Kit *kit, KitManager::kits()) {
|
|
|
|
|
if (kit->isAutoDetected()) {
|
|
|
|
|
BaseQtVersion *version = QtKitInformation::qtVersion(kit);
|
|
|
|
|
if (versions.contains(version)) {
|
|
|
|
|
ToolChain *toolChain = ToolChainKitInformation::toolChain(kit);
|
|
|
|
|
if (toolChain)
|
|
|
|
|
toolChains << toolChain;
|
2013-08-29 13:14:19 +02:00
|
|
|
KitManager::deregisterKit(kit);
|
2013-10-15 16:17:37 +02:00
|
|
|
}
|
2013-07-04 16:21:33 +02:00
|
|
|
}
|
2013-10-15 16:17:37 +02:00
|
|
|
}
|
2013-01-17 16:06:13 -02:00
|
|
|
|
2013-10-09 12:42:00 +02:00
|
|
|
foreach (const DebuggerItem &item, DebuggerItemManager::debuggers())
|
|
|
|
|
if (item.isAutoDetected() &&
|
|
|
|
|
(item.command() == m_simulatorDebugger || item.command() == m_deviceDebugger))
|
|
|
|
|
DebuggerItemManager::deregisterDebugger(item);
|
2013-01-17 16:06:13 -02:00
|
|
|
|
2013-10-15 16:17:37 +02:00
|
|
|
foreach (ToolChain *toolChain, ToolChainManager::toolChains())
|
|
|
|
|
if (toolChain->isAutoDetected()
|
|
|
|
|
&& (toolChains.contains(toolChain) || toolChain->compilerCommand() == m_gccCompiler))
|
|
|
|
|
ToolChainManager::deregisterToolChain(toolChain);
|
2013-04-12 17:09:11 -03:00
|
|
|
|
2013-10-15 16:17:37 +02:00
|
|
|
foreach (BaseQtVersion *version, versions)
|
|
|
|
|
QtVersionManager::removeVersion(version);
|
2013-10-09 12:42:00 +02:00
|
|
|
|
2013-01-09 09:23:37 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Qnx
|