Пример #1
0
ProjectExplorer::Environment Qt4RunConfiguration::environment() const
{
    Qt4Project *pro = qobject_cast<Qt4Project *>(project());
    Q_ASSERT(pro);
    QString config = pro->activeBuildConfiguration();
    ProjectExplorer::Environment env = pro->environment(pro->activeBuildConfiguration());
    if (m_isUsingDyldImageSuffix) {
        env.set("DYLD_IMAGE_SUFFIX", "_debug");
    }
    return env;
}
Пример #2
0
void MakeStepConfigWidget::updateDetails()
{
    Qt4Project *pro = static_cast<Qt4Project *>(m_makeStep->project());
    ProjectExplorer::BuildConfiguration *bc = pro->buildConfiguration(m_buildConfiguration);
    QString workingDirectory = pro->buildDirectory(bc);

    QString makeCmd = pro->makeCommand(bc);
    if (!m_makeStep->value(m_buildConfiguration, "makeCmd").toString().isEmpty())
        makeCmd = m_makeStep->value(m_buildConfiguration, "makeCmd").toString();
    if (!QFileInfo(makeCmd).isAbsolute()) {
        Environment environment = pro->environment(bc);
        // Try to detect command in environment
        QString tmp = environment.searchInPath(makeCmd);
        if (tmp == QString::null) {
            m_summaryText = tr("<b>Make Step:</b> %1 not found in the environment.").arg(makeCmd);
            emit updateSummary();
            return;
        }
        makeCmd = tmp;
    }
    // -w option enables "Enter"/"Leaving directory" messages, which we need for detecting the
    // absolute file path
    // FIXME doing this without the user having a way to override this is rather bad
    // so we only do it for unix and if the user didn't override the make command
    // but for now this is the least invasive change
    QStringList args = m_makeStep->value(m_buildConfiguration, "makeargs").toStringList();
    ProjectExplorer::ToolChain::ToolChainType t = ProjectExplorer::ToolChain::UNKNOWN;
    ProjectExplorer::ToolChain *toolChain = pro->toolChain(bc);
    if (toolChain)
        t = toolChain->type();
    if (t != ProjectExplorer::ToolChain::MSVC && t != ProjectExplorer::ToolChain::WINCE) {
        if (m_makeStep->value(m_buildConfiguration, "makeCmd").toString().isEmpty())
            args << "-w";
    }
    m_summaryText = tr("<b>Make:</b> %1 %2 in %3").arg(QFileInfo(makeCmd).fileName(), args.join(" "),
                                                       QDir::toNativeSeparators(workingDirectory));
    emit updateSummary();
}