2009-02-25 09:15:00 +01:00
|
|
|
/**************************************************************************
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2009-06-17 00:01:27 +10:00
|
|
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** Commercial Usage
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** Licensees holding valid Qt Commercial licenses may use this file in
|
|
|
|
|
** accordance with the Qt Commercial License Agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
|
** a written agreement between you and Nokia.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** GNU Lesser General Public License Usage
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
|
|
|
** General Public License version 2.1 as published by the Free Software
|
|
|
|
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
|
|
|
** packaging of this file. Please review the following information to
|
|
|
|
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
|
|
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** If you are unsure which license is appropriate for your use, please
|
2009-08-14 09:30:56 +02:00
|
|
|
** contact the sales department at http://qt.nokia.com/contact.
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
**************************************************************************/
|
2008-12-02 16:19:05 +01:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
#include "qmakestep.h"
|
2008-12-02 16:19:05 +01:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
#include "qt4project.h"
|
|
|
|
|
#include "qt4projectmanagerconstants.h"
|
|
|
|
|
#include "qt4projectmanager.h"
|
|
|
|
|
#include "makestep.h"
|
2009-04-28 12:43:04 +02:00
|
|
|
#include "qtversionmanager.h"
|
2009-11-25 18:50:20 +01:00
|
|
|
#include "qt4buildconfiguration.h"
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
#include <coreplugin/icore.h>
|
2008-12-09 15:25:01 +01:00
|
|
|
#include <utils/qtcassert.h>
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2009-11-11 17:06:58 +01:00
|
|
|
#include <projectexplorer/projectexplorerconstants.h>
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
#include <QFileDialog>
|
|
|
|
|
#include <QDir>
|
|
|
|
|
#include <QFile>
|
|
|
|
|
#include <QCoreApplication>
|
|
|
|
|
|
|
|
|
|
using namespace Qt4ProjectManager;
|
|
|
|
|
using namespace Qt4ProjectManager::Internal;
|
|
|
|
|
using namespace ProjectExplorer;
|
|
|
|
|
|
2009-11-23 15:47:26 +01:00
|
|
|
QMakeStep::QMakeStep(ProjectExplorer::BuildConfiguration *bc)
|
|
|
|
|
: AbstractMakeStep(bc), m_forced(false)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2009-10-27 14:16:28 +01:00
|
|
|
QMakeStep::QMakeStep(QMakeStep *bs, ProjectExplorer::BuildConfiguration *bc)
|
|
|
|
|
: AbstractMakeStep(bs, bc),
|
|
|
|
|
m_forced(false),
|
2009-11-26 18:51:07 +01:00
|
|
|
m_userArgs(bs->m_userArgs)
|
2009-10-27 14:16:28 +01:00
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
QMakeStep::~QMakeStep()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2009-11-26 14:43:27 +01:00
|
|
|
Qt4BuildConfiguration *QMakeStep::qt4BuildConfiguration() const
|
|
|
|
|
{
|
|
|
|
|
return static_cast<Qt4BuildConfiguration *>(buildConfiguration());
|
|
|
|
|
}
|
|
|
|
|
|
2009-11-26 18:51:07 +01:00
|
|
|
QStringList QMakeStep::allArguments()
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-11-26 18:51:07 +01:00
|
|
|
QStringList additonalArguments = m_userArgs;
|
2009-11-26 14:43:27 +01:00
|
|
|
Qt4BuildConfiguration *bc = qt4BuildConfiguration();
|
2008-12-02 12:01:29 +01:00
|
|
|
QStringList arguments;
|
2009-11-23 15:47:26 +01:00
|
|
|
arguments << buildConfiguration()->project()->file()->fileName();
|
2008-12-02 12:01:29 +01:00
|
|
|
arguments << "-r";
|
|
|
|
|
|
2009-10-30 18:40:33 +01:00
|
|
|
if (!additonalArguments.contains("-spec"))
|
2009-11-25 18:50:20 +01:00
|
|
|
arguments << "-spec" << bc->qtVersion()->mkspec();
|
2009-10-26 15:57:30 +01:00
|
|
|
|
2009-10-16 17:33:12 +02:00
|
|
|
#ifdef Q_OS_WIN
|
2009-11-23 15:47:26 +01:00
|
|
|
ToolChain::ToolChainType type = pro->toolChainType(bc);
|
2009-10-16 17:33:12 +02:00
|
|
|
if (type == ToolChain::GCC_MAEMO)
|
|
|
|
|
arguments << QLatin1String("-unix");
|
|
|
|
|
#endif
|
|
|
|
|
|
2009-09-24 16:02:02 +02:00
|
|
|
if (bc->value("buildConfiguration").isValid()) {
|
2008-12-02 12:01:29 +01:00
|
|
|
QStringList configarguments;
|
2009-11-25 18:50:20 +01:00
|
|
|
QtVersion::QmakeBuildConfigs defaultBuildConfiguration = bc->qtVersion()->defaultBuildConfig();
|
2009-10-13 13:44:13 +02:00
|
|
|
QtVersion::QmakeBuildConfigs projectBuildConfiguration = QtVersion::QmakeBuildConfig(bc->value("buildConfiguration").toInt());
|
2008-12-02 12:01:29 +01:00
|
|
|
if ((defaultBuildConfiguration & QtVersion::BuildAll) && !(projectBuildConfiguration & QtVersion::BuildAll))
|
|
|
|
|
configarguments << "CONFIG-=debug_and_release";
|
|
|
|
|
if (!(defaultBuildConfiguration & QtVersion::BuildAll) && (projectBuildConfiguration & QtVersion::BuildAll))
|
|
|
|
|
configarguments << "CONFIG+=debug_and_release";
|
|
|
|
|
if ((defaultBuildConfiguration & QtVersion::DebugBuild) && !(projectBuildConfiguration & QtVersion::DebugBuild))
|
|
|
|
|
configarguments << "CONFIG+=release";
|
|
|
|
|
if (!(defaultBuildConfiguration & QtVersion::DebugBuild) && (projectBuildConfiguration & QtVersion::DebugBuild))
|
|
|
|
|
configarguments << "CONFIG+=debug";
|
2009-03-31 18:10:30 +02:00
|
|
|
if (!configarguments.isEmpty())
|
2009-04-01 16:06:13 +02:00
|
|
|
arguments << configarguments;
|
2008-12-02 12:01:29 +01:00
|
|
|
} else {
|
2009-07-21 14:50:54 +02:00
|
|
|
qWarning()<< "The project should always have a qmake build configuration set";
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!additonalArguments.isEmpty())
|
|
|
|
|
arguments << additonalArguments;
|
|
|
|
|
|
|
|
|
|
return arguments;
|
|
|
|
|
}
|
|
|
|
|
|
2009-10-27 14:16:28 +01:00
|
|
|
bool QMakeStep::init()
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-11-26 14:43:27 +01:00
|
|
|
Qt4BuildConfiguration *qt4bc = qt4BuildConfiguration();
|
2009-11-25 18:50:20 +01:00
|
|
|
const QtVersion *qtVersion = qt4bc->qtVersion();
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
if (!qtVersion->isValid()) {
|
2009-06-03 20:45:49 +02:00
|
|
|
#if defined(Q_WS_MAC)
|
2008-12-02 12:01:29 +01:00
|
|
|
emit addToOutputWindow(tr("\n<font color=\"#ff0000\"><b>No valid Qt version set. Set one in Preferences </b></font>\n"));
|
|
|
|
|
#else
|
|
|
|
|
emit addToOutputWindow(tr("\n<font color=\"#ff0000\"><b>No valid Qt version set. Set one in Tools/Options </b></font>\n"));
|
|
|
|
|
#endif
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2009-11-26 18:51:07 +01:00
|
|
|
QStringList args = allArguments();
|
2009-11-25 18:50:20 +01:00
|
|
|
QString workingDirectory = qt4bc->buildDirectory();
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
QString program = qtVersion->qmakeCommand();
|
|
|
|
|
|
|
|
|
|
// Check wheter we need to run qmake
|
2009-10-15 19:06:51 +02:00
|
|
|
m_needToRunQMake = true;
|
2009-07-22 19:17:58 +02:00
|
|
|
if (QDir(workingDirectory).exists(QLatin1String("Makefile"))) {
|
2009-09-03 19:16:22 +02:00
|
|
|
QString qmakePath = QtVersionManager::findQMakeBinaryFromMakefile(workingDirectory);
|
|
|
|
|
if (qtVersion->qmakeCommand() == qmakePath) {
|
2009-11-25 18:50:20 +01:00
|
|
|
m_needToRunQMake = !qt4bc->compareBuildConfigurationToImportFrom(workingDirectory);
|
2009-07-22 19:17:58 +02:00
|
|
|
}
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (m_forced) {
|
|
|
|
|
m_forced = false;
|
2009-10-15 19:06:51 +02:00
|
|
|
m_needToRunQMake = true;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2009-10-15 19:06:51 +02:00
|
|
|
setEnabled(m_needToRunQMake);
|
|
|
|
|
setWorkingDirectory(workingDirectory);
|
|
|
|
|
setCommand(program);
|
|
|
|
|
setArguments(args);
|
2009-11-25 18:50:20 +01:00
|
|
|
setEnvironment(qt4bc->environment());
|
2009-11-11 17:06:58 +01:00
|
|
|
|
|
|
|
|
setBuildParser(ProjectExplorer::Constants::BUILD_PARSER_QMAKE);
|
2009-10-27 14:16:28 +01:00
|
|
|
return AbstractMakeStep::init();
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QMakeStep::run(QFutureInterface<bool> &fi)
|
|
|
|
|
{
|
2009-11-26 14:43:27 +01:00
|
|
|
Qt4Project *pro = qt4BuildConfiguration()->qt4Project();
|
2009-11-23 15:47:26 +01:00
|
|
|
if (pro->rootProjectNode()->projectType() == ScriptTemplate) {
|
2008-12-02 12:01:29 +01:00
|
|
|
fi.reportResult(true);
|
|
|
|
|
return;
|
|
|
|
|
}
|
2009-09-24 16:02:02 +02:00
|
|
|
|
2009-10-15 19:06:51 +02:00
|
|
|
if (!m_needToRunQMake) {
|
2008-12-02 12:01:29 +01:00
|
|
|
emit addToOutputWindow(tr("<font color=\"#0000ff\">Configuration unchanged, skipping QMake step.</font>"));
|
|
|
|
|
fi.reportResult(true);
|
|
|
|
|
return;
|
|
|
|
|
}
|
2009-11-16 13:01:08 +01:00
|
|
|
AbstractMakeStep::run(fi);
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString QMakeStep::name()
|
|
|
|
|
{
|
|
|
|
|
return Constants::QMAKESTEP;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString QMakeStep::displayName()
|
|
|
|
|
{
|
|
|
|
|
return "QMake";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QMakeStep::setForced(bool b)
|
|
|
|
|
{
|
|
|
|
|
m_forced = b;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool QMakeStep::forced()
|
|
|
|
|
{
|
|
|
|
|
return m_forced;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ProjectExplorer::BuildStepConfigWidget *QMakeStep::createConfigWidget()
|
|
|
|
|
{
|
|
|
|
|
return new QMakeStepConfigWidget(this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool QMakeStep::immutable() const
|
|
|
|
|
{
|
2009-07-27 16:36:27 +02:00
|
|
|
return false;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QMakeStep::processStartupFailed()
|
|
|
|
|
{
|
|
|
|
|
m_forced = true;
|
|
|
|
|
AbstractProcessStep::processStartupFailed();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool QMakeStep::processFinished(int exitCode, QProcess::ExitStatus status)
|
|
|
|
|
{
|
|
|
|
|
bool result = AbstractProcessStep::processFinished(exitCode, status);
|
|
|
|
|
if (!result)
|
|
|
|
|
m_forced = true;
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2009-10-27 14:16:28 +01:00
|
|
|
void QMakeStep::setQMakeArguments(const QStringList &arguments)
|
2009-07-24 18:53:54 +02:00
|
|
|
{
|
2009-11-26 18:51:07 +01:00
|
|
|
m_userArgs = arguments;
|
2009-07-24 18:53:54 +02:00
|
|
|
emit changed();
|
|
|
|
|
}
|
|
|
|
|
|
2009-11-26 18:51:07 +01:00
|
|
|
QStringList QMakeStep::userArguments()
|
2009-10-15 19:06:51 +02:00
|
|
|
{
|
2009-11-26 18:51:07 +01:00
|
|
|
return m_userArgs;
|
2009-10-15 19:06:51 +02:00
|
|
|
}
|
|
|
|
|
|
2009-10-27 14:16:28 +01:00
|
|
|
void QMakeStep::restoreFromLocalMap(const QMap<QString, QVariant> &map)
|
2009-10-15 19:06:51 +02:00
|
|
|
{
|
2009-11-26 18:51:07 +01:00
|
|
|
m_userArgs = map.value("qmakeArgs").toStringList();
|
2009-10-27 14:16:28 +01:00
|
|
|
AbstractProcessStep::restoreFromLocalMap(map);
|
2009-10-15 19:06:51 +02:00
|
|
|
}
|
|
|
|
|
|
2009-10-27 14:16:28 +01:00
|
|
|
void QMakeStep::storeIntoLocalMap(QMap<QString, QVariant> &map)
|
2009-10-15 19:06:51 +02:00
|
|
|
{
|
2009-11-26 18:51:07 +01:00
|
|
|
map["qmakeArgs"] = m_userArgs;
|
2009-10-27 14:16:28 +01:00
|
|
|
AbstractProcessStep::storeIntoLocalMap(map);
|
2009-10-15 19:06:51 +02:00
|
|
|
}
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
QMakeStepConfigWidget::QMakeStepConfigWidget(QMakeStep *step)
|
|
|
|
|
: BuildStepConfigWidget(), m_step(step)
|
|
|
|
|
{
|
|
|
|
|
m_ui.setupUi(this);
|
|
|
|
|
connect(m_ui.qmakeAdditonalArgumentsLineEdit, SIGNAL(textEdited(const QString&)),
|
|
|
|
|
this, SLOT(qmakeArgumentsLineEditTextEdited()));
|
|
|
|
|
connect(m_ui.buildConfigurationComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(buildConfigurationChanged()));
|
2009-07-24 18:53:54 +02:00
|
|
|
connect(step, SIGNAL(changed()),
|
|
|
|
|
this, SLOT(update()));
|
2009-11-30 13:57:41 +01:00
|
|
|
connect(step->buildConfiguration(), SIGNAL(qtVersionChanged()),
|
|
|
|
|
this, SLOT(qtVersionChanged()));
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2009-08-06 15:31:32 +02:00
|
|
|
QString QMakeStepConfigWidget::summaryText() const
|
|
|
|
|
{
|
|
|
|
|
return m_summaryText;
|
|
|
|
|
}
|
|
|
|
|
|
2009-11-30 13:57:41 +01:00
|
|
|
void QMakeStepConfigWidget::qtVersionChanged()
|
2009-10-29 19:42:56 +01:00
|
|
|
{
|
2009-11-26 16:46:36 +01:00
|
|
|
Q_UNUSED(bc)
|
2009-11-25 20:08:39 +01:00
|
|
|
updateTitleLabel();
|
|
|
|
|
updateEffectiveQMakeCall();
|
2009-10-29 19:42:56 +01:00
|
|
|
}
|
|
|
|
|
|
2009-08-06 15:31:32 +02:00
|
|
|
void QMakeStepConfigWidget::updateTitleLabel()
|
|
|
|
|
{
|
2009-11-26 14:43:27 +01:00
|
|
|
Qt4BuildConfiguration *qt4bc = m_step->qt4BuildConfiguration();
|
2009-11-25 18:50:20 +01:00
|
|
|
const QtVersion *qtVersion = qt4bc->qtVersion();
|
2009-08-06 15:31:32 +02:00
|
|
|
if (!qtVersion) {
|
2009-08-19 12:32:23 +02:00
|
|
|
m_summaryText = tr("<b>QMake:</b> No Qt version set. QMake can not be run.");
|
2009-08-06 15:31:32 +02:00
|
|
|
emit updateSummary();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2009-11-26 18:51:07 +01:00
|
|
|
QStringList args = m_step->allArguments();
|
2009-08-06 15:31:32 +02:00
|
|
|
// We don't want the full path to the .pro file
|
2009-11-23 15:47:26 +01:00
|
|
|
const QString projectFileName = m_step->buildConfiguration()->project()->file()->fileName();
|
|
|
|
|
int index = args.indexOf(projectFileName);
|
2009-08-06 15:31:32 +02:00
|
|
|
if (index != -1)
|
2009-11-23 15:47:26 +01:00
|
|
|
args[index] = QFileInfo(projectFileName).fileName();
|
2009-08-06 15:31:32 +02:00
|
|
|
|
|
|
|
|
// And we only use the .pro filename not the full path
|
|
|
|
|
QString program = QFileInfo(qtVersion->qmakeCommand()).fileName();
|
2009-08-19 12:32:23 +02:00
|
|
|
m_summaryText = tr("<b>QMake:</b> %1 %2").arg(program, args.join(QString(QLatin1Char(' '))));
|
2009-08-06 15:31:32 +02:00
|
|
|
emit updateSummary();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
void QMakeStepConfigWidget::qmakeArgumentsLineEditTextEdited()
|
|
|
|
|
{
|
2009-10-27 14:16:28 +01:00
|
|
|
m_step->setQMakeArguments(
|
2009-10-15 19:06:51 +02:00
|
|
|
ProjectExplorer::Environment::parseCombinedArgString(m_ui.qmakeAdditonalArgumentsLineEdit->text()));
|
2009-08-12 13:21:41 +02:00
|
|
|
|
2009-11-26 14:43:27 +01:00
|
|
|
m_step->qt4BuildConfiguration()->qt4Project()->invalidateCachedTargetInformation();
|
2009-08-06 15:31:32 +02:00
|
|
|
updateTitleLabel();
|
2009-08-12 13:21:41 +02:00
|
|
|
updateEffectiveQMakeCall();
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QMakeStepConfigWidget::buildConfigurationChanged()
|
|
|
|
|
{
|
2009-10-27 14:16:28 +01:00
|
|
|
ProjectExplorer::BuildConfiguration *bc = m_step->buildConfiguration();
|
2009-10-13 13:44:13 +02:00
|
|
|
QtVersion::QmakeBuildConfigs buildConfiguration = QtVersion::QmakeBuildConfig(bc->value("buildConfiguration").toInt());
|
2008-12-02 12:01:29 +01:00
|
|
|
if (m_ui.buildConfigurationComboBox->currentIndex() == 0) {
|
|
|
|
|
// debug
|
2009-10-13 13:44:13 +02:00
|
|
|
buildConfiguration = buildConfiguration | QtVersion::DebugBuild;
|
2008-12-02 12:01:29 +01:00
|
|
|
} else {
|
2009-10-13 13:44:13 +02:00
|
|
|
buildConfiguration = buildConfiguration & ~QtVersion::DebugBuild;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
2009-09-25 14:29:23 +02:00
|
|
|
bc->setValue("buildConfiguration", int(buildConfiguration));
|
2009-11-26 14:43:27 +01:00
|
|
|
m_step->qt4BuildConfiguration()->qt4Project()->invalidateCachedTargetInformation();
|
2009-08-06 15:31:32 +02:00
|
|
|
updateTitleLabel();
|
2009-08-12 13:21:41 +02:00
|
|
|
updateEffectiveQMakeCall();
|
2009-10-09 18:25:23 +02:00
|
|
|
// TODO if exact parsing is the default, we need to update the code model
|
|
|
|
|
// and all the Qt4ProFileNodes
|
2009-11-26 14:43:27 +01:00
|
|
|
// m_step->qt4Project()->update();
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString QMakeStepConfigWidget::displayName() const
|
|
|
|
|
{
|
|
|
|
|
return m_step->displayName();
|
|
|
|
|
}
|
|
|
|
|
|
2009-07-24 18:53:54 +02:00
|
|
|
void QMakeStepConfigWidget::update()
|
|
|
|
|
{
|
2009-10-27 14:16:28 +01:00
|
|
|
init();
|
2009-07-24 18:53:54 +02:00
|
|
|
}
|
|
|
|
|
|
2009-10-27 14:16:28 +01:00
|
|
|
void QMakeStepConfigWidget::init()
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-11-26 18:51:07 +01:00
|
|
|
QString qmakeArgs = ProjectExplorer::Environment::joinArgumentList(m_step->userArguments());
|
2009-07-16 15:33:19 +02:00
|
|
|
m_ui.qmakeAdditonalArgumentsLineEdit->setText(qmakeArgs);
|
2009-10-27 14:16:28 +01:00
|
|
|
ProjectExplorer::BuildConfiguration *bc = m_step->buildConfiguration();
|
2009-09-25 14:29:23 +02:00
|
|
|
bool debug = QtVersion::QmakeBuildConfig(bc->value("buildConfiguration").toInt()) & QtVersion::DebugBuild;
|
2009-07-16 15:33:19 +02:00
|
|
|
m_ui.buildConfigurationComboBox->setCurrentIndex(debug? 0 : 1);
|
2009-08-06 15:31:32 +02:00
|
|
|
updateTitleLabel();
|
2009-08-12 13:21:41 +02:00
|
|
|
updateEffectiveQMakeCall();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QMakeStepConfigWidget::updateEffectiveQMakeCall()
|
|
|
|
|
{
|
2009-11-26 14:43:27 +01:00
|
|
|
Qt4BuildConfiguration *qt4bc = m_step->qt4BuildConfiguration();
|
2009-11-25 18:50:20 +01:00
|
|
|
const QtVersion *qtVersion = qt4bc->qtVersion();
|
2009-08-12 13:21:41 +02:00
|
|
|
if (qtVersion) {
|
|
|
|
|
QString program = QFileInfo(qtVersion->qmakeCommand()).fileName();
|
2009-11-26 18:51:07 +01:00
|
|
|
m_ui.qmakeArgumentsEdit->setPlainText(program + QLatin1Char(' ') + ProjectExplorer::Environment::joinArgumentList(m_step->allArguments()));
|
2009-08-12 13:21:41 +02:00
|
|
|
} else {
|
2009-08-19 12:32:23 +02:00
|
|
|
m_ui.qmakeArgumentsEdit->setPlainText(tr("No valid Qt version set."));
|
2009-08-12 13:21:41 +02:00
|
|
|
}
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2009-04-20 16:25:48 +02:00
|
|
|
////
|
|
|
|
|
// QMakeStepFactory
|
|
|
|
|
////
|
|
|
|
|
|
|
|
|
|
QMakeStepFactory::QMakeStepFactory()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QMakeStepFactory::~QMakeStepFactory()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool QMakeStepFactory::canCreate(const QString & name) const
|
|
|
|
|
{
|
|
|
|
|
return (name == Constants::QMAKESTEP);
|
|
|
|
|
}
|
|
|
|
|
|
2009-11-23 15:47:26 +01:00
|
|
|
ProjectExplorer::BuildStep *QMakeStepFactory::create(BuildConfiguration *bc, const QString & name) const
|
2009-04-20 16:25:48 +02:00
|
|
|
{
|
2009-07-13 17:35:17 +02:00
|
|
|
Q_UNUSED(name)
|
2009-11-23 15:47:26 +01:00
|
|
|
return new QMakeStep(bc);
|
2009-10-27 14:16:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ProjectExplorer::BuildStep *QMakeStepFactory::clone(ProjectExplorer::BuildStep *bs, ProjectExplorer::BuildConfiguration *bc) const
|
|
|
|
|
{
|
|
|
|
|
return new QMakeStep(static_cast<QMakeStep *>(bs), bc);
|
2009-04-20 16:25:48 +02:00
|
|
|
}
|
|
|
|
|
|
2009-11-25 20:00:28 +01:00
|
|
|
QStringList QMakeStepFactory::canCreateForBuildConfiguration(ProjectExplorer::BuildConfiguration *bc) const
|
2009-04-20 16:25:48 +02:00
|
|
|
{
|
2009-11-25 19:39:52 +01:00
|
|
|
if (qobject_cast<Qt4BuildConfiguration *>(bc))
|
|
|
|
|
return QStringList() << Constants::QMAKESTEP;
|
|
|
|
|
return QStringList();
|
2009-04-20 16:25:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString QMakeStepFactory::displayNameForName(const QString &name) const
|
|
|
|
|
{
|
2009-07-28 16:01:22 +02:00
|
|
|
Q_UNUSED(name);
|
|
|
|
|
return tr("QMake");
|
2009-04-20 16:25:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|