forked from qt-creator/qt-creator
Qnx: Add BlackBerry kits for qt5
Qt5 is available in the internal 10.2 NDK builds. N.B: This is for testing purpose (internal developers). Change-Id: I0858e05f5902d602a0f921ed22f34b79d557a10a Reviewed-by: Fabian Bumberger <fbumberger@rim.com> Reviewed-by: Wolfgang Bremer <wbremer@blackberry.com> Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>
This commit is contained in:
committed by
Mehdi Fekari
parent
6773d47a63
commit
10f2e59aed
@@ -83,6 +83,24 @@ bool BlackBerryConfiguration::setNdkPath(const QString &ndkPath)
|
|||||||
return refresh();
|
return refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BlackBerryConfiguration::setupNdkConfigPerQtVersion(const Utils::FileName &qmakePath, ProjectExplorer::GccToolChain *tc)
|
||||||
|
{
|
||||||
|
QtSupport::BaseQtVersion *qtVersion = createQtVersion(qmakePath);
|
||||||
|
ProjectExplorer::Kit *deviceKit = createKit(ArmLeV7, qtVersion, tc);
|
||||||
|
ProjectExplorer::Kit *simulatorKit = createKit(X86, qtVersion, tc);
|
||||||
|
if (qtVersion && tc && deviceKit && simulatorKit) {
|
||||||
|
if (!qtVersion->qtAbis().isEmpty())
|
||||||
|
tc->setTargetAbi(qtVersion->qtAbis().first());
|
||||||
|
// register
|
||||||
|
QtSupport::QtVersionManager::instance()->addVersion(qtVersion);
|
||||||
|
ProjectExplorer::ToolChainManager::instance()->registerToolChain(tc);
|
||||||
|
ProjectExplorer::KitManager::instance()->registerKit(deviceKit);
|
||||||
|
ProjectExplorer::KitManager::instance()->registerKit(simulatorKit);
|
||||||
|
|
||||||
|
emit updated();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool BlackBerryConfiguration::refresh()
|
bool BlackBerryConfiguration::refresh()
|
||||||
{
|
{
|
||||||
m_config.qnxEnv = QnxUtils::parseEnvironmentFile(QnxUtils::envFilePath(m_config.ndkPath));
|
m_config.qnxEnv = QnxUtils::parseEnvironmentFile(QnxUtils::envFilePath(m_config.ndkPath));
|
||||||
@@ -95,15 +113,16 @@ bool BlackBerryConfiguration::refresh()
|
|||||||
m_config.sysRoot = Utils::FileName::fromString(ndkTarget);
|
m_config.sysRoot = Utils::FileName::fromString(ndkTarget);
|
||||||
|
|
||||||
QString qnxHost = m_config.qnxEnv.value(QLatin1String("QNX_HOST"));
|
QString qnxHost = m_config.qnxEnv.value(QLatin1String("QNX_HOST"));
|
||||||
Utils::FileName qmakePath = QnxUtils::executableWithExtension(Utils::FileName::fromString(qnxHost + QLatin1String("/usr/bin/qmake")));
|
Utils::FileName qmake4Path = QnxUtils::executableWithExtension(Utils::FileName::fromString(qnxHost + QLatin1String("/usr/bin/qmake")));
|
||||||
|
Utils::FileName qmake5Path = QnxUtils::executableWithExtension(Utils::FileName::fromString(qnxHost + QLatin1String("/usr/bin/qt5/qmake")));
|
||||||
Utils::FileName gccPath = QnxUtils::executableWithExtension(Utils::FileName::fromString(qnxHost + QLatin1String("/usr/bin/qcc")));
|
Utils::FileName gccPath = QnxUtils::executableWithExtension(Utils::FileName::fromString(qnxHost + QLatin1String("/usr/bin/qcc")));
|
||||||
Utils::FileName deviceGdbPath = QnxUtils::executableWithExtension(Utils::FileName::fromString(qnxHost + QLatin1String("/usr/bin/ntoarm-gdb")));
|
Utils::FileName deviceGdbPath = QnxUtils::executableWithExtension(Utils::FileName::fromString(qnxHost + QLatin1String("/usr/bin/ntoarm-gdb")));
|
||||||
Utils::FileName simulatorGdbPath = QnxUtils::executableWithExtension(Utils::FileName::fromString(qnxHost + QLatin1String("/usr/bin/ntox86-gdb")));
|
Utils::FileName simulatorGdbPath = QnxUtils::executableWithExtension(Utils::FileName::fromString(qnxHost + QLatin1String("/usr/bin/ntox86-gdb")));
|
||||||
|
|
||||||
if (!qmakePath.toFileInfo().exists() || !gccPath.toFileInfo().exists()
|
if ((!qmake4Path.toFileInfo().exists() && !qmake5Path.toFileInfo().exists()) || !gccPath.toFileInfo().exists()
|
||||||
|| !deviceGdbPath.toFileInfo().exists() || !simulatorGdbPath.toFileInfo().exists() ) {
|
|| !deviceGdbPath.toFileInfo().exists() || !simulatorGdbPath.toFileInfo().exists() ) {
|
||||||
QString errorMessage = tr("The following errors occurred while setting up BB10 Configuration:");
|
QString errorMessage = tr("The following errors occurred while setting up BB10 Configuration:");
|
||||||
if (!qmakePath.toFileInfo().exists())
|
if (!qmake4Path.toFileInfo().exists() && !qmake5Path.toFileInfo().exists())
|
||||||
errorMessage += QLatin1Char('\n') + tr("- No Qt version found.");
|
errorMessage += QLatin1Char('\n') + tr("- No Qt version found.");
|
||||||
|
|
||||||
if (!gccPath.toFileInfo().exists())
|
if (!gccPath.toFileInfo().exists())
|
||||||
@@ -120,7 +139,12 @@ bool BlackBerryConfiguration::refresh()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_config.qmakeBinaryFile = qmakePath;
|
if (qmake4Path.toFileInfo().exists())
|
||||||
|
m_config.qmake4BinaryFile = qmake4Path;
|
||||||
|
|
||||||
|
if (qmake5Path.toFileInfo().exists())
|
||||||
|
m_config.qmake5BinaryFile = qmake5Path;
|
||||||
|
|
||||||
m_config.gccCompiler = gccPath;
|
m_config.gccCompiler = gccPath;
|
||||||
m_config.deviceDebuger = deviceGdbPath;
|
m_config.deviceDebuger = deviceGdbPath;
|
||||||
m_config.simulatorDebuger = simulatorGdbPath;
|
m_config.simulatorDebuger = simulatorGdbPath;
|
||||||
@@ -205,34 +229,35 @@ void BlackBerryConfiguration::setupNdkConfiguration(const QString &ndkPath)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (setNdkPath(ndkPath)) {
|
if (setNdkPath(ndkPath)) {
|
||||||
QtSupport::BaseQtVersion *qtVersion = createQtVersion();
|
|
||||||
ProjectExplorer::GccToolChain *tc = createGccToolChain();
|
ProjectExplorer::GccToolChain *tc = createGccToolChain();
|
||||||
ProjectExplorer::Kit *deviceKit = createKit(ArmLeV7, qtVersion, tc);
|
|
||||||
ProjectExplorer::Kit *simulatorKit = createKit(X86, qtVersion, tc);
|
|
||||||
if (qtVersion && tc && deviceKit && simulatorKit) {
|
|
||||||
if (!qtVersion->qtAbis().isEmpty())
|
|
||||||
tc->setTargetAbi(qtVersion->qtAbis().first());
|
|
||||||
// register
|
|
||||||
QtSupport::QtVersionManager::instance()->addVersion(qtVersion);
|
|
||||||
ProjectExplorer::ToolChainManager::instance()->registerToolChain(tc);
|
|
||||||
ProjectExplorer::KitManager::instance()->registerKit(deviceKit);
|
|
||||||
ProjectExplorer::KitManager::instance()->registerKit(simulatorKit);
|
|
||||||
|
|
||||||
emit updated();
|
if (!m_config.qmake4BinaryFile.isEmpty())
|
||||||
}
|
setupNdkConfigPerQtVersion(m_config.qmake4BinaryFile, tc);
|
||||||
|
|
||||||
|
if (!m_config.qmake5BinaryFile.isEmpty())
|
||||||
|
setupNdkConfigPerQtVersion(m_config.qmake5BinaryFile, tc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BlackBerryConfiguration::cleanNdkConfiguration()
|
void BlackBerryConfiguration::cleanNdkConfiguration()
|
||||||
{
|
{
|
||||||
QtSupport::BaseQtVersion *version = QtSupport::QtVersionManager::instance()->qtVersionForQMakeBinary(m_config.qmakeBinaryFile);
|
QtSupport::BaseQtVersion *qt4Version = QtSupport::QtVersionManager::instance()->qtVersionForQMakeBinary(m_config.qmake4BinaryFile);
|
||||||
if (version) {
|
QtSupport::BaseQtVersion *qt5Version = QtSupport::QtVersionManager::instance()->qtVersionForQMakeBinary(m_config.qmake5BinaryFile);
|
||||||
|
if (qt4Version || qt5Version) {
|
||||||
foreach (ProjectExplorer::Kit *kit, ProjectExplorer::KitManager::instance()->kits()) {
|
foreach (ProjectExplorer::Kit *kit, ProjectExplorer::KitManager::instance()->kits()) {
|
||||||
if (version == QtSupport::QtKitInformation::qtVersion(kit))
|
if (qt4Version && qt4Version == QtSupport::QtKitInformation::qtVersion(kit)) {
|
||||||
ProjectExplorer::KitManager::instance()->deregisterKit(kit);
|
ProjectExplorer::KitManager::instance()->deregisterKit(kit);
|
||||||
|
} else if (qt5Version && qt5Version == QtSupport::QtKitInformation::qtVersion(kit)) {
|
||||||
|
ProjectExplorer::KitManager::instance()->deregisterKit(kit);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QtSupport::QtVersionManager::instance()->removeVersion(version);
|
if (qt4Version)
|
||||||
|
QtSupport::QtVersionManager::instance()->removeVersion(qt4Version);
|
||||||
|
|
||||||
|
if (qt5Version)
|
||||||
|
QtSupport::QtVersionManager::instance()->removeVersion(qt5Version);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (ProjectExplorer::ToolChain* tc, ProjectExplorer::ToolChainManager::instance()->toolChains()) {
|
foreach (ProjectExplorer::ToolChain* tc, ProjectExplorer::ToolChainManager::instance()->toolChains()) {
|
||||||
@@ -295,34 +320,34 @@ BlackBerryCertificate * BlackBerryConfiguration::activeCertificate()
|
|||||||
return m_config.activeCertificate;
|
return m_config.activeCertificate;
|
||||||
}
|
}
|
||||||
|
|
||||||
QtSupport::BaseQtVersion *BlackBerryConfiguration::createQtVersion()
|
QtSupport::BaseQtVersion *BlackBerryConfiguration::createQtVersion(const Utils::FileName &qmakePath)
|
||||||
{
|
{
|
||||||
if (m_config.qmakeBinaryFile.isEmpty())
|
if (qmakePath.isEmpty())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
QString cpuDir = m_config.qnxEnv.value(QLatin1String("CPUVARDIR"));
|
QString cpuDir = m_config.qnxEnv.value(QLatin1String("CPUVARDIR"));
|
||||||
QtSupport::BaseQtVersion *version = QtSupport::QtVersionManager::instance()->qtVersionForQMakeBinary(m_config.qmakeBinaryFile);
|
QtSupport::BaseQtVersion *version = QtSupport::QtVersionManager::instance()->qtVersionForQMakeBinary(qmakePath);
|
||||||
if (version) {
|
if (version) {
|
||||||
QMessageBox::warning(0, tr("Qt Version Already Known"),
|
QMessageBox::warning(0, tr("Qt Version Already Known"),
|
||||||
tr("This Qt version was already registered."), QMessageBox::Ok);
|
tr("This Qt version was already registered."), QMessageBox::Ok);
|
||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
|
|
||||||
version = new BlackBerryQtVersion(QnxUtils::cpudirToArch(cpuDir), m_config.qmakeBinaryFile, false, QString(), m_config.ndkPath);
|
version = new BlackBerryQtVersion(QnxUtils::cpudirToArch(cpuDir), qmakePath, false, QString(), m_config.ndkPath);
|
||||||
if (!version) {
|
if (!version) {
|
||||||
QMessageBox::warning(0, tr("Invalid Qt Version"),
|
QMessageBox::warning(0, tr("Invalid Qt Version"),
|
||||||
tr("Unable to add BlackBerry Qt version."), QMessageBox::Ok);
|
tr("Unable to add BlackBerry Qt version."), QMessageBox::Ok);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
version->setDisplayName(QString::fromLatin1("Qt BlackBerry 10 (%1)").arg(m_config.targetName));
|
version->setDisplayName(QString::fromLatin1("Qt %1 BlackBerry 10 (%2)").arg(version->qtVersionString(), m_config.targetName));
|
||||||
|
|
||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectExplorer::GccToolChain *BlackBerryConfiguration::createGccToolChain()
|
ProjectExplorer::GccToolChain *BlackBerryConfiguration::createGccToolChain()
|
||||||
{
|
{
|
||||||
if (m_config.qmakeBinaryFile.isEmpty() || m_config.gccCompiler.isEmpty())
|
if ((m_config.qmake4BinaryFile.isEmpty() && m_config.qmake5BinaryFile.isEmpty()) || m_config.gccCompiler.isEmpty())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
foreach (ProjectExplorer::ToolChain* tc, ProjectExplorer::ToolChainManager::instance()->toolChains()) {
|
foreach (ProjectExplorer::ToolChain* tc, ProjectExplorer::ToolChainManager::instance()->toolChains()) {
|
||||||
@@ -368,10 +393,10 @@ ProjectExplorer::Kit *BlackBerryConfiguration::createKit(QnxArchitecture arch, Q
|
|||||||
Debugger::DebuggerKitInformation::setDebuggerCommand(kit, m_config.simulatorDebuger);
|
Debugger::DebuggerKitInformation::setDebuggerCommand(kit, m_config.simulatorDebuger);
|
||||||
Qt4ProjectManager::QmakeKitInformation::setMkspec(kit, Utils::FileName::fromString(QString::fromLatin1("blackberry-x86-qcc")));
|
Qt4ProjectManager::QmakeKitInformation::setMkspec(kit, Utils::FileName::fromString(QString::fromLatin1("blackberry-x86-qcc")));
|
||||||
// TODO: Check if the name already exists(?)
|
// TODO: Check if the name already exists(?)
|
||||||
kit->setDisplayName(tr("BlackBerry 10 (%1) - Simulator").arg(m_config.targetName));
|
kit->setDisplayName(tr("BlackBerry 10 (%1 - %2) - Simulator").arg(qtVersion->qtVersionString(), m_config.targetName));
|
||||||
} else {
|
} else {
|
||||||
Debugger::DebuggerKitInformation::setDebuggerCommand(kit, m_config.deviceDebuger);
|
Debugger::DebuggerKitInformation::setDebuggerCommand(kit, m_config.deviceDebuger);
|
||||||
kit->setDisplayName(tr("BlackBerry 10 (%1)").arg(m_config.targetName));
|
kit->setDisplayName(tr("BlackBerry 10 (%1 - %2)").arg(qtVersion->qtVersionString(), m_config.targetName));
|
||||||
}
|
}
|
||||||
|
|
||||||
kit->setIconPath(QLatin1String(Constants::QNX_BB_CATEGORY_ICON));
|
kit->setIconPath(QLatin1String(Constants::QNX_BB_CATEGORY_ICON));
|
||||||
@@ -423,9 +448,14 @@ BlackBerryConfig BlackBerryConfiguration::config() const
|
|||||||
return m_config;
|
return m_config;
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FileName BlackBerryConfiguration::qmakePath() const
|
Utils::FileName BlackBerryConfiguration::qmake4Path() const
|
||||||
{
|
{
|
||||||
return m_config.qmakeBinaryFile;
|
return m_config.qmake4BinaryFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
Utils::FileName BlackBerryConfiguration::qmake5Path() const
|
||||||
|
{
|
||||||
|
return m_config.qmake5BinaryFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FileName BlackBerryConfiguration::gccPath() const
|
Utils::FileName BlackBerryConfiguration::gccPath() const
|
||||||
|
|||||||
@@ -54,7 +54,8 @@ class BlackBerryConfig
|
|||||||
{
|
{
|
||||||
QString ndkPath;
|
QString ndkPath;
|
||||||
QString targetName;
|
QString targetName;
|
||||||
Utils::FileName qmakeBinaryFile;
|
Utils::FileName qmake4BinaryFile;
|
||||||
|
Utils::FileName qmake5BinaryFile;
|
||||||
Utils::FileName gccCompiler;
|
Utils::FileName gccCompiler;
|
||||||
Utils::FileName deviceDebuger;
|
Utils::FileName deviceDebuger;
|
||||||
Utils::FileName simulatorDebuger;
|
Utils::FileName simulatorDebuger;
|
||||||
@@ -72,7 +73,8 @@ class BlackBerryConfiguration: public QObject
|
|||||||
public:
|
public:
|
||||||
static BlackBerryConfiguration &instance();
|
static BlackBerryConfiguration &instance();
|
||||||
BlackBerryConfig config() const;
|
BlackBerryConfig config() const;
|
||||||
Utils::FileName qmakePath() const;
|
Utils::FileName qmake4Path() const;
|
||||||
|
Utils::FileName qmake5Path() const;
|
||||||
Utils::FileName gccPath() const;
|
Utils::FileName gccPath() const;
|
||||||
Utils::FileName deviceGdbPath() const;
|
Utils::FileName deviceGdbPath() const;
|
||||||
Utils::FileName simulatorGdbPath() const;
|
Utils::FileName simulatorGdbPath() const;
|
||||||
@@ -110,7 +112,8 @@ private:
|
|||||||
void saveNdkSettings();
|
void saveNdkSettings();
|
||||||
bool refresh();
|
bool refresh();
|
||||||
bool setNdkPath(const QString &ndkPath);
|
bool setNdkPath(const QString &ndkPath);
|
||||||
QtSupport::BaseQtVersion* createQtVersion();
|
void setupNdkConfigPerQtVersion(const Utils::FileName &qmakePath, ProjectExplorer::GccToolChain* tc);
|
||||||
|
QtSupport::BaseQtVersion* createQtVersion(const Utils::FileName &qmakePath);
|
||||||
ProjectExplorer::GccToolChain* createGccToolChain();
|
ProjectExplorer::GccToolChain* createGccToolChain();
|
||||||
ProjectExplorer::Kit* createKit(QnxArchitecture arch, QtSupport::BaseQtVersion* qtVersion, ProjectExplorer::GccToolChain* tc);
|
ProjectExplorer::Kit* createKit(QnxArchitecture arch, QtSupport::BaseQtVersion* qtVersion, ProjectExplorer::GccToolChain* tc);
|
||||||
|
|
||||||
|
|||||||
@@ -137,7 +137,8 @@ void BlackBerryNDKSettingsWidget::updateInfoTable()
|
|||||||
m_infoModel->appendRow(row);
|
m_infoModel->appendRow(row);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_infoModel->appendRow( QList<QStandardItem*>() << new QStandardItem(QString(QLatin1String("QMAKE"))) << new QStandardItem(m_bbConfig->qmakePath().toString()));
|
m_infoModel->appendRow( QList<QStandardItem*>() << new QStandardItem(QString(QLatin1String("QMAKE 4"))) << new QStandardItem(m_bbConfig->qmake4Path().toString()));
|
||||||
|
m_infoModel->appendRow( QList<QStandardItem*>() << new QStandardItem(QString(QLatin1String("QMAKE 5"))) << new QStandardItem(m_bbConfig->qmake5Path().toString()));
|
||||||
m_infoModel->appendRow( QList<QStandardItem*>() << new QStandardItem(QString(QLatin1String("COMPILER"))) << new QStandardItem(m_bbConfig->gccPath().toString()));
|
m_infoModel->appendRow( QList<QStandardItem*>() << new QStandardItem(QString(QLatin1String("COMPILER"))) << new QStandardItem(m_bbConfig->gccPath().toString()));
|
||||||
|
|
||||||
m_ui->removeButton->setEnabled(true);
|
m_ui->removeButton->setEnabled(true);
|
||||||
|
|||||||
Reference in New Issue
Block a user