Commit bb331566 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

QbsPM: Support qtcRunnable property to filter out peripheral products

... by default.

Similar to qmake qtc_runnable.

Apply in app.qbs.

Change-Id: I8d43027f683ef18fc5a2745afe9775eb14075e69
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@theqtcompany.com>
parent 623d571b
......@@ -22,6 +22,7 @@ QtcProduct {
version: project.qtcreator_version
installDir: project.ide_bin_path
property bool qtcRunnable: true
cpp.rpaths: qbs.targetOS.contains("osx") ? ["@executable_path/../Frameworks"]
: ["$ORIGIN/../" + project.libDirName + "/qtcreator"]
......
......@@ -40,6 +40,7 @@
#include <projectexplorer/runconfigurationaspects.h>
#include <projectexplorer/target.h>
#include <projectexplorer/runconfigurationaspects.h>
#include <utils/algorithm.h>
#include <utils/qtcprocess.h>
#include <utils/pathchooser.h>
#include <utils/detailswidget.h>
......@@ -455,21 +456,32 @@ RunConfiguration *QbsRunConfigurationFactory::clone(Target *parent, RunConfigura
QList<Core::Id> QbsRunConfigurationFactory::availableCreationIds(Target *parent, CreationMode mode) const
{
Q_UNUSED(mode)
QList<Core::Id> result;
QList<qbs::ProductData> products;
if (!canHandle(parent))
return result;
return QList<Core::Id>();
QbsProject *project = static_cast<QbsProject *>(parent->project());
if (!project || !project->qbsProject().isValid())
return result;
return QList<Core::Id>();
foreach (const qbs::ProductData &product, project->qbsProjectData().allProducts()) {
if (product.isRunnable() && product.isEnabled())
result << idFromProduct(project, product);
products << product;
}
return result;
if (mode == AutoCreate) {
std::function<bool (const qbs::ProductData &)> hasQtcRunnable = [](const qbs::ProductData &product) {
return product.properties().value("qtcRunnable").toBool();
};
if (Utils::anyOf(products, hasQtcRunnable))
Utils::erase(products, std::not1(hasQtcRunnable));
}
return Utils::transform(products, [project](const qbs::ProductData &product) {
return idFromProduct(project, product);
});
}
QString QbsRunConfigurationFactory::displayNameForId(Core::Id id) const
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment