2013-01-09 09:23:37 -05:00
|
|
|
/**************************************************************************
|
|
|
|
|
**
|
2013-01-31 17:02:30 +01:00
|
|
|
** Copyright (C) 2011 - 2013 Research In Motion
|
2013-01-09 09:23:37 -05:00
|
|
|
**
|
|
|
|
|
** Contact: Research In Motion (blackberry-qt@qnx.com)
|
|
|
|
|
** 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-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;
|
|
|
|
|
m_qnxEnv = QnxUtils::parseEnvironmentFile(m_ndkEnvFile.toString());
|
2013-07-01 15:09:10 +02:00
|
|
|
|
2013-07-04 16:21:33 +02:00
|
|
|
QString ndkTarget = m_qnxEnv.value(QLatin1String("QNX_TARGET"));
|
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-07-04 16:21:33 +02:00
|
|
|
QString qnxHost = m_qnxEnv.value(QLatin1String("QNX_HOST"));
|
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())
|
|
|
|
|
m_deviceDebuger = deviceGdbPath;
|
2013-01-17 16:06:13 -02:00
|
|
|
|
2013-07-04 16:21:33 +02:00
|
|
|
if (simulatorGdbPath.toFileInfo().exists())
|
|
|
|
|
m_simulatorDebuger = 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-08-29 14:11:29 +02:00
|
|
|
BaseQtVersion *qt4Version = QtVersionManager::qtVersionForQMakeBinary(m_qmake4BinaryFile);
|
|
|
|
|
BaseQtVersion *qt5Version = QtVersionManager::qtVersionForQMakeBinary(m_qmake5BinaryFile);
|
2013-07-04 16:21:33 +02:00
|
|
|
return (qt4Version || qt5Version);
|
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()
|
|
|
|
|
|| m_deviceDebuger.isEmpty() || m_simulatorDebuger.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-07-04 16:21:33 +02:00
|
|
|
return m_deviceDebuger;
|
|
|
|
|
}
|
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
|
|
|
{
|
|
|
|
|
return m_simulatorDebuger;
|
|
|
|
|
}
|
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-07-04 16:21:33 +02:00
|
|
|
QMultiMap<QString, QString> 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-08-29 13:14:19 +02:00
|
|
|
void BlackBerryConfiguration::setupConfigurationPerQtVersion(const FileName &qmakePath, GccToolChain *tc)
|
2013-01-17 16:06:13 -02:00
|
|
|
{
|
2013-07-04 16:21:33 +02:00
|
|
|
if (qmakePath.isEmpty() || !tc)
|
|
|
|
|
return;
|
|
|
|
|
|
2013-08-29 13:14:19 +02:00
|
|
|
BaseQtVersion *qtVersion = createQtVersion(qmakePath);
|
|
|
|
|
Kit *deviceKit = createKit(ArmLeV7, qtVersion, tc);
|
|
|
|
|
Kit *simulatorKit = createKit(X86, qtVersion, tc);
|
2013-07-04 16:21:33 +02:00
|
|
|
if (qtVersion && tc && deviceKit && simulatorKit) {
|
|
|
|
|
if (!qtVersion->qtAbis().isEmpty())
|
|
|
|
|
tc->setTargetAbi(qtVersion->qtAbis().first());
|
|
|
|
|
// register
|
2013-08-29 14:11:29 +02:00
|
|
|
QtVersionManager::addVersion(qtVersion);
|
2013-08-29 13:14:19 +02:00
|
|
|
ToolChainManager::registerToolChain(tc);
|
|
|
|
|
KitManager::registerKit(deviceKit);
|
|
|
|
|
KitManager::registerKit(simulatorKit);
|
2013-07-04 16:21:33 +02:00
|
|
|
}
|
2013-01-09 09:23:37 -05:00
|
|
|
}
|
|
|
|
|
|
2013-08-29 13:14:19 +02:00
|
|
|
BaseQtVersion *BlackBerryConfiguration::createQtVersion(const FileName &qmakePath)
|
2013-01-09 09:23:37 -05:00
|
|
|
{
|
2013-07-01 15:09:10 +02:00
|
|
|
if (qmakePath.isEmpty())
|
2013-01-09 09:23:37 -05:00
|
|
|
return 0;
|
|
|
|
|
|
2013-07-04 16:21:33 +02:00
|
|
|
QString cpuDir = m_qnxEnv.value(QLatin1String("CPUVARDIR"));
|
2013-08-29 14:11:29 +02:00
|
|
|
BaseQtVersion *version = QtVersionManager::qtVersionForQMakeBinary(qmakePath);
|
2013-01-09 09:23:37 -05:00
|
|
|
if (version) {
|
2013-07-04 16:21:33 +02:00
|
|
|
if (!m_isAutoDetected)
|
2013-09-04 16:20:40 +02:00
|
|
|
QMessageBox::warning(0, tr("Qt Version Already Known"),
|
|
|
|
|
tr("This Qt version was already registered."), QMessageBox::Ok);
|
2013-01-09 09:23:37 -05:00
|
|
|
return version;
|
|
|
|
|
}
|
|
|
|
|
|
2013-08-22 17:00:58 +02:00
|
|
|
version = new BlackBerryQtVersion(QnxUtils::cpudirToArch(cpuDir), qmakePath, m_isAutoDetected, QString(), m_ndkEnvFile.toString());
|
2013-01-09 09:23:37 -05:00
|
|
|
if (!version) {
|
2013-07-04 16:21:33 +02:00
|
|
|
if (!m_isAutoDetected)
|
2013-09-04 16:20:40 +02:00
|
|
|
QMessageBox::warning(0, tr("Invalid Qt Version"),
|
|
|
|
|
tr("Unable to add BlackBerry Qt version."), QMessageBox::Ok);
|
2013-01-09 09:23:37 -05:00
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2013-07-04 16:21:33 +02:00
|
|
|
version->setDisplayName(QString::fromLatin1("Qt %1 BlackBerry 10 (%2)").arg(version->qtVersionString(), m_targetName));
|
2013-01-09 09:23:37 -05:00
|
|
|
return version;
|
|
|
|
|
}
|
|
|
|
|
|
2013-08-29 13:14:19 +02:00
|
|
|
GccToolChain *BlackBerryConfiguration::createGccToolChain()
|
2013-01-09 09:23:37 -05:00
|
|
|
{
|
2013-07-04 16:21:33 +02:00
|
|
|
if ((m_qmake4BinaryFile.isEmpty() && m_qmake5BinaryFile.isEmpty()) || m_gccCompiler.isEmpty())
|
2013-01-09 09:23:37 -05:00
|
|
|
return 0;
|
|
|
|
|
|
2013-08-29 13:14:19 +02:00
|
|
|
foreach (ToolChain *tc, ToolChainManager::toolChains()) {
|
2013-07-04 16:21:33 +02:00
|
|
|
if (tc->compilerCommand() == m_gccCompiler) {
|
|
|
|
|
if (!m_isAutoDetected)
|
2013-09-04 16:20:40 +02:00
|
|
|
QMessageBox::warning(0, tr("Compiler Already Known"),
|
|
|
|
|
tr("This compiler was already registered."), QMessageBox::Ok);
|
2013-08-29 13:14:19 +02:00
|
|
|
return dynamic_cast<GccToolChain *>(tc);
|
2013-01-09 09:23:37 -05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-03 10:58:59 +02:00
|
|
|
GccToolChain* tc = new GccToolChain(QLatin1String(ProjectExplorer::Constants::GCC_TOOLCHAIN_ID), m_isAutoDetected ? ToolChain::AutoDetection : ToolChain::ManualDetection);
|
2013-07-04 16:21:33 +02:00
|
|
|
tc->setDisplayName(QString::fromLatin1("GCC BlackBerry 10 (%1)").arg(m_targetName));
|
|
|
|
|
tc->setCompilerCommand(m_gccCompiler);
|
2013-01-09 09:23:37 -05:00
|
|
|
|
|
|
|
|
return tc;
|
|
|
|
|
}
|
|
|
|
|
|
2013-08-29 13:14:19 +02:00
|
|
|
Kit *BlackBerryConfiguration::createKit(QnxArchitecture arch, BaseQtVersion *qtVersion, GccToolChain *tc)
|
2013-01-09 09:23:37 -05:00
|
|
|
{
|
2013-07-04 16:21:33 +02:00
|
|
|
if (!qtVersion || !tc || m_targetName.isEmpty())
|
2013-01-09 09:23:37 -05:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
// Check if an identical kit already exists
|
2013-08-29 13:14:19 +02:00
|
|
|
foreach (Kit *kit, KitManager::kits()) {
|
|
|
|
|
if (QtKitInformation::qtVersion(kit) == qtVersion && ToolChainKitInformation::toolChain(kit) == tc
|
|
|
|
|
&& DeviceTypeKitInformation::deviceTypeId(kit) == Constants::QNX_BB_OS_TYPE
|
|
|
|
|
&& SysRootKitInformation::sysRoot(kit) == m_sysRoot) {
|
2013-01-09 09:23:37 -05:00
|
|
|
if ((arch == X86 && Qt4ProjectManager::QmakeKitInformation::mkspec(kit).toString() == QString::fromLatin1("blackberry-x86-qcc")
|
2013-07-04 16:21:33 +02:00
|
|
|
&& Debugger::DebuggerKitInformation::debuggerCommand(kit) == m_simulatorDebuger)
|
|
|
|
|
|| (arch == ArmLeV7 && Debugger::DebuggerKitInformation::debuggerCommand(kit) == m_deviceDebuger)) {
|
|
|
|
|
if (!m_isAutoDetected)
|
2013-09-04 16:20:40 +02:00
|
|
|
QMessageBox::warning(0, tr("Kit Already Known"),
|
|
|
|
|
tr("This kit was already registered."), QMessageBox::Ok);
|
2013-07-04 16:21:33 +02:00
|
|
|
setSticky(kit);
|
2013-01-09 09:23:37 -05:00
|
|
|
return kit;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2013-08-29 13:14:19 +02:00
|
|
|
Kit *kit = new Kit;
|
|
|
|
|
QtKitInformation::setQtVersion(kit, qtVersion);
|
|
|
|
|
ToolChainKitInformation::setToolChain(kit, tc);
|
2013-01-09 09:23:37 -05:00
|
|
|
if (arch == X86) {
|
2013-09-03 12:31:28 +02:00
|
|
|
Debugger::DebuggerKitInformation::setDebugger(kit, Debugger::GdbEngineType, m_simulatorDebuger);
|
2013-08-29 13:14:19 +02:00
|
|
|
Qt4ProjectManager::QmakeKitInformation::setMkspec(kit, FileName::fromString(QString::fromLatin1("blackberry-x86-qcc")));
|
2013-01-09 09:23:37 -05:00
|
|
|
// TODO: Check if the name already exists(?)
|
2013-09-04 16:20:40 +02:00
|
|
|
kit->setDisplayName(tr("BlackBerry 10 (%1 - %2) - Simulator").arg(qtVersion->qtVersionString(), m_targetName));
|
2013-01-09 09:23:37 -05:00
|
|
|
} else {
|
2013-09-03 12:31:28 +02:00
|
|
|
Debugger::DebuggerKitInformation::setDebugger(kit, Debugger::GdbEngineType, m_deviceDebuger);
|
2013-09-04 16:20:40 +02:00
|
|
|
kit->setDisplayName(tr("BlackBerry 10 (%1 - %2)").arg(qtVersion->qtVersionString(), m_targetName));
|
2013-01-09 09:23:37 -05:00
|
|
|
}
|
|
|
|
|
|
2013-07-04 16:21:33 +02:00
|
|
|
|
|
|
|
|
kit->setAutoDetected(m_isAutoDetected);
|
2013-08-29 13:14:19 +02:00
|
|
|
kit->setIconPath(FileName::fromString(QLatin1String(Constants::QNX_BB_CATEGORY_ICON)));
|
2013-07-04 16:21:33 +02:00
|
|
|
setSticky(kit);
|
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
|
|
|
|
|
|
|
|
return kit;
|
|
|
|
|
}
|
|
|
|
|
|
2013-08-29 13:14:19 +02:00
|
|
|
void BlackBerryConfiguration::setSticky(Kit *kit)
|
2013-01-09 09:23:37 -05:00
|
|
|
{
|
2013-09-02 15:38:31 +02:00
|
|
|
QtKitInformation::setSticky(kit, true);
|
|
|
|
|
ToolChainKitInformation::setSticky(kit, true);
|
|
|
|
|
DeviceTypeKitInformation::setSticky(kit, true);
|
|
|
|
|
SysRootKitInformation::setSticky(kit, true);
|
|
|
|
|
Debugger::DebuggerKitInformation::setSticky(kit, true);
|
|
|
|
|
Qt4ProjectManager::QmakeKitInformation::setSticky(kit, true);
|
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-09-04 16:20:40 +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-07-04 16:21:33 +02:00
|
|
|
if (m_deviceDebuger.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-07-04 16:21:33 +02:00
|
|
|
if (!m_simulatorDebuger.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-07-04 16:21:33 +02:00
|
|
|
if (isActive() && !m_isAutoDetected)
|
|
|
|
|
return true;
|
2013-01-09 09:23:37 -05:00
|
|
|
|
2013-08-29 13:14:19 +02:00
|
|
|
GccToolChain *tc = createGccToolChain();
|
2013-07-04 16:21:33 +02:00
|
|
|
if (!m_qmake4BinaryFile.isEmpty())
|
|
|
|
|
setupConfigurationPerQtVersion(m_qmake4BinaryFile, tc);
|
2013-01-09 09:23:37 -05:00
|
|
|
|
2013-09-06 16:51:48 +02:00
|
|
|
if (!m_qmake5BinaryFile.isEmpty())
|
2013-07-04 16:21:33 +02:00
|
|
|
setupConfigurationPerQtVersion(m_qmake5BinaryFile, tc);
|
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-07-04 16:21:33 +02:00
|
|
|
void BlackBerryConfiguration::deactivate()
|
2013-01-09 09:23:37 -05:00
|
|
|
{
|
2013-08-29 14:11:29 +02:00
|
|
|
BaseQtVersion *qt4Version = QtVersionManager::qtVersionForQMakeBinary(m_qmake4BinaryFile);
|
|
|
|
|
BaseQtVersion *qt5Version = QtVersionManager::qtVersionForQMakeBinary(m_qmake5BinaryFile);
|
2013-07-04 16:21:33 +02:00
|
|
|
if (qt4Version || qt5Version) {
|
2013-08-29 13:14:19 +02:00
|
|
|
foreach (Kit *kit, KitManager::kits()) {
|
|
|
|
|
if (qt4Version && qt4Version == QtKitInformation::qtVersion(kit))
|
|
|
|
|
KitManager::deregisterKit(kit);
|
2013-01-09 09:23:37 -05:00
|
|
|
|
2013-08-29 13:14:19 +02:00
|
|
|
else if (qt5Version && qt5Version == QtKitInformation::qtVersion(kit))
|
|
|
|
|
KitManager::deregisterKit(kit);
|
2013-07-04 16:21:33 +02:00
|
|
|
}
|
2013-01-17 16:06:13 -02:00
|
|
|
|
2013-07-04 16:21:33 +02:00
|
|
|
if (qt4Version)
|
2013-08-29 14:11:29 +02:00
|
|
|
QtVersionManager::removeVersion(qt4Version);
|
2013-01-17 16:06:13 -02:00
|
|
|
|
2013-07-04 16:21:33 +02:00
|
|
|
if (qt5Version)
|
2013-08-29 14:11:29 +02:00
|
|
|
QtVersionManager::removeVersion(qt5Version);
|
2013-01-17 16:06:13 -02:00
|
|
|
|
2013-07-04 16:21:33 +02:00
|
|
|
}
|
2013-04-12 17:09:11 -03:00
|
|
|
|
2013-08-29 13:14:19 +02:00
|
|
|
foreach (ToolChain *tc, ToolChainManager::toolChains())
|
2013-07-04 16:21:33 +02:00
|
|
|
if (tc->compilerCommand() == m_gccCompiler)
|
2013-08-29 13:14:19 +02:00
|
|
|
ToolChainManager::deregisterToolChain(tc);
|
2013-01-09 09:23:37 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Qnx
|