Commit 8cd3b549 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Fix import of existing builds

 * Report what kind of build we have in the tooltip
 * Create only debug/release configuration for debug/release
   configured directories
 * Create debug and release configuraions for debug_and_release
   configured directories
 * Add debug_and_release to options in QMakeStep UI
 * Do not add CONFIG+=debug/release to CONFIG+=debug_and_release builds
parent ace96f3f
......@@ -345,8 +345,12 @@ void QMakeStepConfigWidget::qmakeBuildConfigChanged()
{
Qt4BuildConfiguration *bc = m_step->qt4BuildConfiguration();
bool debug = bc->qmakeBuildConfiguration() & QtVersion::DebugBuild;
int index = debug ? 0 : 1;
if (bc->qmakeBuildConfiguration() & QtVersion::BuildAll)
index = 2;
m_ignoreChange = true;
m_ui.buildConfigurationComboBox->setCurrentIndex(debug? 0 : 1);
m_ui.buildConfigurationComboBox->setCurrentIndex(index);
m_ignoreChange = false;
updateSummaryLabel();
updateEffectiveQMakeCall();
......@@ -379,11 +383,18 @@ void QMakeStepConfigWidget::buildConfigurationSelected()
return;
Qt4BuildConfiguration *bc = m_step->qt4BuildConfiguration();
QtVersion::QmakeBuildConfigs buildConfiguration = bc->qmakeBuildConfiguration();
if (m_ui.buildConfigurationComboBox->currentIndex() == 0) { // debug
buildConfiguration = buildConfiguration | QtVersion::DebugBuild;
} else {
buildConfiguration = buildConfiguration & ~QtVersion::DebugBuild;
switch (m_ui.buildConfigurationComboBox->currentIndex()) {
case 0:
buildConfiguration = QtVersion::DebugBuild;
break;
case 1:
buildConfiguration = 0;
break;
case 2:
buildConfiguration = QtVersion::BuildAll;
break;
}
m_ignoreChange = true;
bc->setQMakeBuildConfiguration(buildConfiguration);
m_ignoreChange = false;
......
......@@ -39,6 +39,11 @@
<string>Release</string>
</property>
</item>
<item>
<property name="text">
<string>Debug and release</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
......
......@@ -390,9 +390,13 @@ void Qt4BuildConfiguration::getConfigCommandLineArguments(QStringList *addedUser
if (addedUserConfigs) {
if (!(defaultBuildConfiguration & QtVersion::BuildAll) && (userBuildConfiguration & QtVersion::BuildAll))
(*addedUserConfigs) << "debug_and_release";
if ((defaultBuildConfiguration & QtVersion::DebugBuild) && !(userBuildConfiguration & QtVersion::DebugBuild))
if ((defaultBuildConfiguration & QtVersion::DebugBuild)
&& !(userBuildConfiguration & QtVersion::DebugBuild)
&& !(userBuildConfiguration & QtVersion::BuildAll))
(*addedUserConfigs) << "release";
if (!(defaultBuildConfiguration & QtVersion::DebugBuild) && (userBuildConfiguration & QtVersion::DebugBuild))
if (!(defaultBuildConfiguration & QtVersion::DebugBuild)
&& (userBuildConfiguration & QtVersion::DebugBuild)
&& !(userBuildConfiguration & QtVersion::BuildAll))
(*addedUserConfigs) << "debug";
}
}
......
......@@ -34,6 +34,7 @@
#include "qt4project.h"
#include "qt4projectmanagerconstants.h"
#include "qt4target.h"
#include "qtversionmanager.h"
#include <extensionsystem/pluginmanager.h>
#include <projectexplorer/task.h>
......@@ -231,8 +232,10 @@ bool TargetSetupPage::setupProject(Qt4ProjectManager::Qt4Project *project)
info.isTemporary = false;
}
if ((info.buildConfig | QtVersion::DebugBuild) != info.buildConfig)
targetInfos.append(BuildConfigurationInfo(info.version, QtVersion::QmakeBuildConfigs(info.buildConfig | QtVersion::DebugBuild),
// If we have buildAll, then we want to havbe two BCs set up, one to build debug,
// the other to build release.
if (info.buildConfig & QtVersion::BuildAll)
targetInfos.append(BuildConfigurationInfo(info.version, info.buildConfig & ~(info.buildConfig & QtVersion::DebugBuild),
info.additionalArguments, info.directory));
targetInfos.append(BuildConfigurationInfo(info.version, info.buildConfig,
info.additionalArguments, info.directory));
......@@ -506,10 +509,22 @@ void TargetSetupPage::updateVersionItem(QTreeWidgetItem *versionItem, int index)
ImportInfo &info = m_infos[index];
QPair<QIcon, QString> issues = reportIssues(info.version);
//: We are going to build debug and release
QString buildType = tr("debug and release");
if ((info.buildConfig & QtVersion::BuildAll) == 0) {
if (info.buildConfig & QtVersion::DebugBuild)
//: Debug build
buildType = tr("debug");
else
//: release build
buildType = tr("release");
}
QString toolTip = QLatin1String("<nobr>");
toolTip = toolTip.append(info.version->displayName());
toolTip.append(tr("<br>using %1", "%1: qmake used (incl. full path)").
arg(QDir::toNativeSeparators(info.version->qmakeCommand())));
//: %1: qmake used (incl. full path), %2: "debug", "release" or "debug and release"
toolTip.append(tr("<br>using %1 (%2)").
arg(QDir::toNativeSeparators(info.version->qmakeCommand())).
arg(buildType));
if (!issues.second.isEmpty())
toolTip.append(QString::fromLatin1("<br><br>%1").arg(issues.second));
......
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