Kit *BlackBerryConfiguration::createKit(
        QnxAbstractQtVersion *version, QnxToolChain *toolChain, const QVariant &debuggerItemId)
{
    Kit *kit = new Kit;
    bool isSimulator = version->architecture() == X86;

    QtKitInformation::setQtVersion(kit, version);
    ToolChainKitInformation::setToolChain(kit, toolChain);

    if (debuggerItemId.isValid())
        DebuggerKitInformation::setDebugger(kit, debuggerItemId);

    if (isSimulator)
        QmakeProjectManager::QmakeKitInformation::setMkspec(
                 kit, FileName::fromString(QLatin1String("blackberry-x86-qcc")));

    DeviceTypeKitInformation::setDeviceTypeId(kit, Constants::QNX_BB_OS_TYPE);
    SysRootKitInformation::setSysRoot(kit, m_sysRoot);

    kit->setDisplayName(version->displayName());
    kit->setIconPath(FileName::fromString(QLatin1String(Constants::QNX_BB_CATEGORY_ICON)));

    kit->setAutoDetected(true);
    kit->setMutable(DeviceKitInformation::id(), true);

    kit->setSticky(QtKitInformation::id(), true);
    kit->setSticky(ToolChainKitInformation::id(), true);
    kit->setSticky(DeviceTypeKitInformation::id(), true);
    kit->setSticky(SysRootKitInformation::id(), true);
    kit->setSticky(DebuggerKitInformation::id(), true);
    kit->setSticky(QmakeProjectManager::QmakeKitInformation::id(), true);

    KitManager::registerKit(kit);
    return kit;
}
Ejemplo n.º 2
0
Kit* MerTarget::createKit() const
{
    if (!isValid())
        return 0;
    const QString sysroot(m_sdk->sharedTargetsPath() + QLatin1Char('/') + m_name);

    FileName path = FileName::fromString(sysroot);
    if (!path.toFileInfo().exists()) {
        qWarning() << "Sysroot does not exist" << sysroot;
        return 0;
    }

    Kit *k = new Kit();
    k->setAutoDetected(true);
    k->setUnexpandedDisplayName(QString::fromLatin1("%1-%2").arg(m_sdk->virtualMachineName(), m_name));
    k->setIconPath(FileName::fromString(QLatin1String(Constants::MER_OPTIONS_CATEGORY_ICON)));
    SysRootKitInformation::setSysRoot(k, FileName::fromUserInput(sysroot));

    DeviceTypeKitInformation::setDeviceTypeId(k, Constants::MER_DEVICE_TYPE);
    k->setMutable(DeviceKitInformation::id(), true);

    const QString gdb = HostOsInfo::withExecutableSuffix(m_defaultGdb);
    QString gdbDir = QCoreApplication::applicationDirPath();
    if (HostOsInfo::isMacHost()) {
        QDir dir = QDir(gdbDir);
        dir.cdUp();
        dir.cdUp();
        dir.cdUp();
        gdbDir = dir.path();
    }
    FileName gdbFileName = FileName::fromString(gdbDir + QLatin1Char('/') + gdb);

    DebuggerItem debugger;
    debugger.setCommand(gdbFileName);
    debugger.setEngineType(GdbEngineType);
    const QString vmName = m_sdk->virtualMachineName();
    debugger.setUnexpandedDisplayName(QObject::tr("GDB for %1 %2").arg(vmName, m_name));
    debugger.setAutoDetected(true);
    debugger.setAbi(Abi::abiFromTargetTriplet(m_gccMachineDump)); // TODO is this OK?
    QVariant id = DebuggerItemManager::registerDebugger(debugger);
    DebuggerKitInformation::setDebugger(k, id);

    MerSdkKitInformation::setSdk(k,m_sdk);
    MerTargetKitInformation::setTargetName(k,name());
    return k;
}