Hello, Did you have some time to take a look to the code I sent ?
Thanks in advance. Jeremy 2017-05-03 18:37 GMT+02:00 JeremY Larrieu <adrenalin...@gmail.com>: > Hello, > > As you can see in the new screenshot attached, the Anubis compiler is auto > detected. > > Here is the code to "auto-detect" kits based on the "auto detected Anubis > toolchains" (it's based on what i found in the android plugin): > > const QList<ProjectExplorer::Kit*> existingKits = Utils::filtered( > ProjectExplorer::KitManager::kits(), [](const ProjectExplorer::Kit *k) { > return k->isAutoDetected(); > }); > QList<ProjectExplorer::Kit*> newKits; > const QList<ProjectExplorer::ToolChain *> filteredToolchains = > ProjectExplorer::ToolChainManager::toolChains([](const > ProjectExplorer::ToolChain *tc) { > return tc->isAutoDetected() > && tc->isValid() > && tc->typeId() == Constants::AnubisToolchainId; > }); > const QList<AnubisToolChain*> toolchains = > Utils::transform(filteredToolchains, > [](ProjectExplorer::ToolChain *tc) { > return static_cast<AnubisToolChain *>(tc); > }); > > for (AnubisToolChain *tc : toolchains) { > ProjectExplorer::Kit *newKit = new ProjectExplorer::Kit; > newKit->setAutoDetected(true); > newKit->setAutoDetectionSource("PyramIDEConfiguration"); > > auto findExistingKit = [newKit](const ProjectExplorer::Kit *k) { > return matchKits(newKit, k); }; > ProjectExplorer::Kit *existingKit = > Utils::findOrDefault(existingKits, > findExistingKit); > if (existingKit) { > ProjectExplorer::KitManager::deleteKit(newKit); > newKit = existingKit; > } > > auto keys = newKit->allKeys(); > for (Core::Id key : keys) { > qDebug("key => " + key.toString().toLatin1() + " | value => " > + newKit->value(key).toString().toLatin1()); > } > > auto toto = newKit->toHtml(); > qDebug("html:\n" + toto.toLatin1() + "\n"); > > newKit->makeSticky(); > newKit->setUnexpandedDisplayName(QObject::tr("Anubis > %1").arg(tc->compilerVersion())); > > if (!existingKit) > { > ProjectExplorer::KitManager::registerKit(newKit); > } > } > > It's triggered in the plugin entry point (initialize method) on the > "kitsLoaded" signal of KitManager: > connect(KitManager::instance(), &KitManager::kitsLoaded, this, > &PyramIDEPlugin::kitsRestored); > > void PyramIDEPlugin::kitsRestored() > { > PyramIDEConfigurations::updateAutomaticKitList(); > disconnect(KitManager::instance(), &KitManager::kitsChanged, this, > &PyramIDEPlugin::kitsRestored); > } > > Thanks for your help. > > Jeremy > > 2017-05-03 15:14 GMT+02:00 Tobias Hunger <tobias.hun...@qt.io>: > >> Hi JeremY, >> >> Based on your screenshot: My guess is that Qt Creator does not have any >> compiler defined for your language. >> >> What does the Tool chains tab show? Is there an anubis compiler listed >> there? >> >> Best Regards, >> Tobias > > >
_______________________________________________ Qt-creator mailing list Qt-creator@qt-project.org http://lists.qt-project.org/mailman/listinfo/qt-creator