ProductData ProjectPrivate::findProductData(const ProductData &product) const { foreach (const ProductData &p, m_projectData.allProducts()) { if (p.name() == product.name() && p.profile() == product.profile()) return p; } return ProductData(); }
int CommandLineFrontend::runTarget() { const ProductData productToRun = getTheOneRunnableProduct(); const QString executableFilePath = productToRun.targetExecutable(); if (executableFilePath.isEmpty()) { throw ErrorInfo(Tr::tr("Cannot run: Product '%1' is not an application.") .arg(productToRun.name())); } RunEnvironment runEnvironment = m_projects.front().getRunEnvironment(productToRun, m_parser.installOptions(m_projects.front().profile()), QProcessEnvironment::systemEnvironment(), m_parser.runEnvConfig(), m_settings); return runEnvironment.doRunTarget(executableFilePath, m_parser.runArgs(), m_parser.dryRun()); }
static ResolvedProductPtr internalProductForProject(const ResolvedProjectConstPtr &project, const ProductData &product) { foreach (const ResolvedProductPtr &resolvedProduct, project->products) { if (product.name() == resolvedProduct->name && product.profile() == resolvedProduct->profile) { return resolvedProduct; } } foreach (const ResolvedProjectConstPtr &subProject, project->subProjects) { const ResolvedProductPtr &p = internalProductForProject(subProject, product); if (p) return p; } return ResolvedProductPtr(); }