Commit b45a73ff authored by dt's avatar dt
Browse files

Use unique build directories per qt version and debug/release

Reviewed-By: hunger
parent 435b4608
......@@ -84,6 +84,13 @@ QString Qt4DesktopTargetFactory::displayNameForId(const QString &id) const
return QString();
}
QString Qt4DesktopTargetFactory::buildNameForId(const QString &id) const
{
if (id == QLatin1String(Constants::DESKTOP_TARGET_ID))
return QLatin1String("desktop");
return QString();
}
QIcon Qt4DesktopTargetFactory::iconForId(const QString &id) const
{
if (id == QLatin1String(Constants::DESKTOP_TARGET_ID))
......@@ -117,37 +124,7 @@ ProjectExplorer::Target *Qt4DesktopTargetFactory::restore(ProjectExplorer::Proj
return 0;
}
QString Qt4DesktopTargetFactory::defaultShadowBuildDirectory(const QString &projectLocation, const QString &id)
{
if (id != QLatin1String(Constants::DESKTOP_TARGET_ID))
return QString();
// currently we can't have the build directory to be deeper than the source directory
// since that is broken in qmake
// Once qmake is fixed we can change that to have a top directory and
// subdirectories per build. (Replacing "QChar('-')" with "QChar('/') )
return projectLocation + QLatin1String("-desktop");
}
QList<BuildConfigurationInfo> Qt4DesktopTargetFactory::availableBuildConfigurations(const QString &id, const QString &proFilePath, const QtVersionNumber &minimumQtVersion)
{
Q_ASSERT(id == Constants::DESKTOP_TARGET_ID);
QList<BuildConfigurationInfo> infoList;
QList<QtVersion *> knownVersions = QtVersionManager::instance()->versionsForTargetId(id, minimumQtVersion);
foreach (QtVersion *version, knownVersions) {
if (!version->isValid() || !version->toolChainAvailable())
continue;
QtVersion::QmakeBuildConfigs config = version->defaultBuildConfig();
QString dir = defaultShadowBuildDirectory(Qt4Project::defaultTopLevelBuildDirectory(proFilePath), id);
infoList.append(BuildConfigurationInfo(version, config, QString(), dir));
infoList.append(BuildConfigurationInfo(version, config ^ QtVersion::DebugBuild, QString(), dir));
}
return infoList;
}
Qt4TargetSetupWidget *Qt4DesktopTargetFactory::createTargetSetupWidget(const QString &id, const QString &proFilePath, const QtVersionNumber &number, bool importEnabled, QList<BuildConfigurationInfo> importInfos)
Qt4TargetSetupWidget *Qt4DesktopTargetFactory::createTargetSetupWidget(const QString &id, const QString &proFilePath, const QtVersionNumber &number, bool importEnabled, QList<BuildConfigurationInfo> importInfos)
{
Qt4DefaultTargetSetupWidget *widget
= static_cast<Qt4DefaultTargetSetupWidget *>(
......
......@@ -52,13 +52,12 @@ public:
bool canCreate(ProjectExplorer::Project *parent, const QString &id) const;
bool canRestore(ProjectExplorer::Project *parent, const QVariantMap &map) const;
ProjectExplorer::Target *restore(ProjectExplorer::Project *parent, const QVariantMap &map);
QString defaultShadowBuildDirectory(const QString &projectLocation, const QString &id);
virtual bool supportsTargetId(const QString &id) const;
Qt4TargetSetupWidget *createTargetSetupWidget(const QString &id, const QString &proFilePath, const QtVersionNumber &minimumQtVersion, bool importEnabled, QList<BuildConfigurationInfo> importInfos);
QString buildNameForId(const QString &id) const;
bool isMobileTarget(const QString &id);
QList<BuildConfigurationInfo> availableBuildConfigurations(const QString &id, const QString &proFilePath, const QtVersionNumber &minimumQtVersion);
ProjectExplorer::Target *create(ProjectExplorer::Project *parent, const QString &id);
ProjectExplorer::Target *create(ProjectExplorer::Project *parent, const QString &id, const QList<BuildConfigurationInfo> &infos);
......
......@@ -92,6 +92,13 @@ QIcon Qt4SimulatorTargetFactory::iconForId(const QString &id) const
return QIcon();
}
QString Qt4SimulatorTargetFactory::buildNameForId(const QString &id) const
{
if (id == QLatin1String(Constants::QT_SIMULATOR_TARGET_ID))
return QLatin1String("simulator");
return QString();
}
bool Qt4SimulatorTargetFactory::canCreate(ProjectExplorer::Project *parent, const QString &id) const
{
if (!qobject_cast<Qt4Project *>(parent))
......@@ -117,35 +124,6 @@ ProjectExplorer::Target *Qt4SimulatorTargetFactory::restore(ProjectExplorer::Pro
return 0;
}
QString Qt4SimulatorTargetFactory::defaultShadowBuildDirectory(const QString &projectLocation, const QString &id)
{
if (id != QLatin1String(Constants::QT_SIMULATOR_TARGET_ID))
return QString();
// currently we can't have the build directory to be deeper than the source directory
// since that is broken in qmake
// Once qmake is fixed we can change that to have a top directory and
// subdirectories per build. (Replacing "QChar('-')" with "QChar('/') )
return projectLocation + QLatin1String("-simulator");
}
QList<BuildConfigurationInfo> Qt4SimulatorTargetFactory::availableBuildConfigurations(const QString &id, const QString &proFilePath, const QtVersionNumber &minimumQtVersion)
{
Q_ASSERT(id == Constants::QT_SIMULATOR_TARGET_ID);
QList<BuildConfigurationInfo> infos;
QList<QtVersion *> knownVersions = QtVersionManager::instance()->versionsForTargetId(id, minimumQtVersion);
foreach (QtVersion *version, knownVersions) {
if (!version->isValid() || !version->toolChainAvailable())
continue;
QtVersion::QmakeBuildConfigs config = version->defaultBuildConfig();
QString dir = defaultShadowBuildDirectory(Qt4Project::defaultTopLevelBuildDirectory(proFilePath), id);
infos.append(BuildConfigurationInfo(version, config, QString(), dir));
infos.append(BuildConfigurationInfo(version, config ^ QtVersion::DebugBuild, QString(), dir));
}
return infos;
}
bool Qt4SimulatorTargetFactory::isMobileTarget(const QString &id)
{
Q_UNUSED(id)
......
......@@ -55,12 +55,11 @@ public:
bool canCreate(ProjectExplorer::Project *parent, const QString &id) const;
bool canRestore(ProjectExplorer::Project *parent, const QVariantMap &map) const;
ProjectExplorer::Target *restore(ProjectExplorer::Project *parent, const QVariantMap &map);
QString defaultShadowBuildDirectory(const QString &projectLocation, const QString &id);
bool supportsTargetId(const QString &id) const;
QList<BuildConfigurationInfo> availableBuildConfigurations(const QString &id, const QString &proFilePath, const QtVersionNumber &minimumQtVersion);
bool isMobileTarget(const QString &id);
QString buildNameForId(const QString &id) const;
ProjectExplorer::Target *create(ProjectExplorer::Project *parent, const QString &id);
ProjectExplorer::Target *create(ProjectExplorer::Project *parent, const QString &id, const QList<BuildConfigurationInfo> &infos);
};
......
......@@ -163,15 +163,6 @@ Qt4BuildConfigurationFactory *AbstractQt4MaemoTarget::buildConfigurationFactory(
return m_buildConfigurationFactory;
}
QString AbstractQt4MaemoTarget::defaultBuildDirectory() const
{
//TODO why?
#if defined(Q_OS_WIN)
return project()->projectDirectory();
#endif
return Qt4BaseTarget::defaultBuildDirectory();
}
void AbstractQt4MaemoTarget::createApplicationProFiles()
{
removeUnconfiguredCustomExectutableRunConfigurations();
......
......@@ -57,7 +57,6 @@ public:
virtual ~AbstractQt4MaemoTarget();
Internal::Qt4BuildConfigurationFactory *buildConfigurationFactory() const;
QString defaultBuildDirectory() const;
void createApplicationProFiles();
QList<ProjectExplorer::RunConfiguration *> runConfigurationsForNode(ProjectExplorer::Node *n);
......
......@@ -131,39 +131,25 @@ ProjectExplorer::Target *Qt4MaemoTargetFactory::restore(ProjectExplorer::Project
return 0;
}
QString Qt4MaemoTargetFactory::defaultShadowBuildDirectory(const QString &projectLocation, const QString &id)
QString Qt4MaemoTargetFactory::buildNameForId(const QString &id) const
{
QString suffix;
if (id == QLatin1String(Constants::MAEMO5_DEVICE_TARGET_ID))
suffix = QLatin1String("maemo");
return QLatin1String("maemo");
else if (id == QLatin1String(Constants::HARMATTAN_DEVICE_TARGET_ID))
suffix = QLatin1String("harmattan");
return QLatin1String("harmattan");
else if (id == QLatin1String(Constants::MEEGO_DEVICE_TARGET_ID))
suffix = QLatin1String("meego");
return QLatin1String("meego");
else
return QString();
// currently we can't have the build directory to be deeper than the source directory
// since that is broken in qmake
// Once qmake is fixed we can change that to have a top directory and
// subdirectories per build. (Replacing "QChar('-')" with "QChar('/') )
return projectLocation + QLatin1Char('-') + suffix;
}
QList<BuildConfigurationInfo> Qt4MaemoTargetFactory::availableBuildConfigurations(const QString &id, const QString &proFilePath, const QtVersionNumber &minimumQtVersion)
QString Qt4MaemoTargetFactory::shadowBuildDirectory(const QString &profilePath, const QString &id, const QString &suffix)
{
QList<BuildConfigurationInfo> infos;
QList<QtVersion *> knownVersions = QtVersionManager::instance()->versionsForTargetId(id, minimumQtVersion);
foreach (QtVersion *version, knownVersions) {
if (!version->isValid() || !version->toolChainAvailable())
continue;
QtVersion::QmakeBuildConfigs config = version->defaultBuildConfig();
QString dir = defaultShadowBuildDirectory(Qt4Project::defaultTopLevelBuildDirectory(proFilePath), id);
infos.append(BuildConfigurationInfo(version, config, QString(), dir));
infos.append(BuildConfigurationInfo(version, config ^ QtVersion::DebugBuild, QString(), dir));
}
return infos;
//TODO why?
#if defined(Q_OS_WIN)
return projectDirectory;
#endif
return Qt4BaseTargetFactory::shadowBuildDirectory(profilePath, id, suffix);
}
bool Qt4MaemoTargetFactory::isMobileTarget(const QString &id)
......
......@@ -53,14 +53,15 @@ public:
bool canCreate(ProjectExplorer::Project *parent, const QString &id) const;
bool canRestore(ProjectExplorer::Project *parent, const QVariantMap &map) const;
ProjectExplorer::Target *restore(ProjectExplorer::Project *parent, const QVariantMap &map);
QString defaultShadowBuildDirectory(const QString &projectLocation, const QString &id);
QString shadowBuildDirectory(const QString &profilePath, const QString &id, const QString &suffix);
QString buildNameForId(const QString &id) const;
bool supportsTargetId(const QString &id) const;
ProjectExplorer::Target *create(ProjectExplorer::Project *parent, const QString &id);
ProjectExplorer::Target *create(ProjectExplorer::Project *parent, const QString &id, const QList<BuildConfigurationInfo> &infos);
QList<BuildConfigurationInfo> availableBuildConfigurations(const QString &id, const QString &proFilePath, const QtVersionNumber &minimumQtVersion);
bool isMobileTarget(const QString &id);
};
......
......@@ -112,11 +112,6 @@ QList<ProjectExplorer::ToolChain *> Qt4SymbianTarget::possibleToolChains(Project
return tmp;
}
QString Qt4SymbianTarget::defaultBuildDirectory() const
{
return project()->projectDirectory();
}
void Qt4SymbianTarget::createApplicationProFiles()
{
removeUnconfiguredCustomExectutableRunConfigurations();
......
......@@ -55,8 +55,6 @@ public:
QList<ProjectExplorer::ToolChain *> possibleToolChains(ProjectExplorer::BuildConfiguration *bc) const;
QString defaultBuildDirectory() const;
void createApplicationProFiles();
virtual QList<ProjectExplorer::RunConfiguration *> runConfigurationsForNode(ProjectExplorer::Node *n);
......
......@@ -127,12 +127,12 @@ ProjectExplorer::Target *Qt4SymbianTargetFactory::restore(ProjectExplorer::Proje
return 0;
}
QString Qt4SymbianTargetFactory::defaultShadowBuildDirectory(const QString &projectLocation, const QString &id)
QString Qt4SymbianTargetFactory::shadowBuildDirectory(const QString &projectDirectory, const QString &id, const QString &suffix)
{
Q_UNUSED(projectLocation);
Q_UNUSED(projectDirectory);
Q_UNUSED(id);
// should not be called from anywhere, since we override Qt4BaseTarget::defaultBuldDirectory()
return QString();
Q_UNUSED(suffix);
return projectDirectory;
}
QList<ProjectExplorer::Task> Qt4SymbianTargetFactory::reportIssues(const QString &proFile)
......@@ -165,25 +165,15 @@ QList<ProjectExplorer::Task> Qt4SymbianTargetFactory::reportIssues(const QString
QList<BuildConfigurationInfo> Qt4SymbianTargetFactory::availableBuildConfigurations(const QString &id, const QString &proFilePath, const QtVersionNumber &minimumQtVersion)
{
QList<BuildConfigurationInfo> infos;
QList<QtVersion *> knownVersions = QtVersionManager::instance()->versionsForTargetId(id, minimumQtVersion);
foreach (QtVersion *version, knownVersions) {
if (!version->isValid() || !version->toolChainAvailable())
continue;
bool buildAll = version->defaultBuildConfig() & QtVersion::BuildAll;
QtVersion::QmakeBuildConfigs config = buildAll ? QtVersion::BuildAll : QtVersion::QmakeBuildConfig(0);
QString dir = QFileInfo(proFilePath).absolutePath(), id;
if (id == Constants::S60_EMULATOR_TARGET_ID) {
infos.append(BuildConfigurationInfo(version, config | QtVersion::DebugBuild, QString(), dir));
} else {
infos.append(BuildConfigurationInfo(version, config, QString(), dir));
infos.append(BuildConfigurationInfo(version, config ^ QtVersion::DebugBuild, QString(), dir));
}
}
return infos;
QList<BuildConfigurationInfo> infos = Qt4BaseTargetFactory::availableBuildConfigurations(id, proFilePath, minimumQtVersion);
if (id != Constants::S60_EMULATOR_TARGET_ID)
return infos;
// For emulator filter out all non debug builds
QList<BuildConfigurationInfo> tmp;
foreach (const BuildConfigurationInfo &info, infos)
if (info.buildConfig & QtVersion::DebugBuild)
tmp << info;
return tmp;
}
bool Qt4SymbianTargetFactory::isMobileTarget(const QString &id)
......
......@@ -58,7 +58,7 @@ public:
virtual ProjectExplorer::Target *create(ProjectExplorer::Project *parent, const QString &id, const QList<BuildConfigurationInfo> &infos);
virtual ProjectExplorer::Target *create(ProjectExplorer::Project *parent, const QString &id, Qt4TargetSetupWidget *widget);
QString defaultShadowBuildDirectory(const QString &projectLocation, const QString &id);
QString shadowBuildDirectory(const QString &profilePath, const QString &id, const QString &suffix);
QList<ProjectExplorer::Task> reportIssues(const QString &proFile);
QList<BuildConfigurationInfo> availableBuildConfigurations(const QString &id, const QString &proFilePath, const QtVersionNumber &minimumQtVersion);
bool isMobileTarget(const QString &id);
......
......@@ -44,6 +44,7 @@
namespace Qt4ProjectManager {
class Qt4TargetSetupWidget;
class QtVersionNumber;
class QtVersion;
struct BuildConfigurationInfo;
class QT4PROJECTMANAGER_EXPORT Qt4BaseTargetFactory : public ProjectExplorer::ITargetFactory
......@@ -59,10 +60,15 @@ public:
bool importEnabled,
QList<BuildConfigurationInfo> importInfos);
virtual QString defaultShadowBuildDirectory(const QString &projectLocation, const QString &id) =0;
/// suffix should be unique
virtual QString shadowBuildDirectory(const QString &profilePath, const QString &id, const QString &suffix);
/// used by the default implementation of shadowBuildDirectory
virtual QString buildNameForId(const QString &id) const;
/// used by the default implementation of createTargetSetupWidget
/// not needed otherwise
virtual QList<BuildConfigurationInfo> availableBuildConfigurations(const QString &id, const QString &proFilePath, const QtVersionNumber &minimumQtVersion) = 0;
/// by default creates one debug + one release buildconfiguration per qtversion
virtual QList<BuildConfigurationInfo> availableBuildConfigurations(const QString &id, const QString &proFilePath, const QtVersionNumber &minimumQtVersion);
virtual QList<ProjectExplorer::Task> reportIssues(const QString &proFile);
/// only used in the TargetSetupPage
......
......@@ -125,17 +125,21 @@ static inline QString msgBuildConfigNotApplicable(const QString &d, const QtVers
arg(d, qtVersion->displayName(), qtVersion->qmakeCommand(), target->id());
}
#include "qt4basetargetfactory.h"
bool Qt4BuildConfiguration::fromMap(const QVariantMap &map)
{
if (!BuildConfiguration::fromMap(map))
return false;
m_shadowBuild = map.value(QLatin1String(USE_SHADOW_BUILD_KEY), true).toBool();
m_buildDirectory = map.value(QLatin1String(BUILD_DIRECTORY_KEY), qt4Target()->defaultBuildDirectory()).toString();
m_qtVersionId = map.value(QLatin1String(QT_VERSION_ID_KEY)).toInt();
ProjectExplorer::ToolChain *tc = 0;
tc = ProjectExplorer::ToolChainManager::instance()->findToolChain(map.value(QLatin1String(TOOLCHAIN_KEY)).toString());
m_qmakeBuildConfiguration = QtVersion::QmakeBuildConfigs(map.value(QLatin1String(BUILD_CONFIGURATION_KEY)).toInt());
m_buildDirectory = map.value(QLatin1String(BUILD_DIRECTORY_KEY), defaultShadowBuildDirectory()).toString();
m_lastEmmitedBuildDirectory = buildDirectory();
// Pick a Qt version if the default version is used:
// We assume that the default Qt version was used in earlier versions of Qt creator.
......@@ -190,12 +194,6 @@ bool Qt4BuildConfiguration::fromMap(const QVariantMap &map)
void Qt4BuildConfiguration::ctor()
{
m_buildDirectory = qt4Target()->defaultBuildDirectory();
if (m_buildDirectory == target()->project()->projectDirectory())
m_shadowBuild = false;
m_lastEmmitedBuildDirectory = buildDirectory();
connect(this, SIGNAL(environmentChanged()),
this, SLOT(emitBuildDirectoryChanged()));
......@@ -237,6 +235,13 @@ Utils::Environment Qt4BuildConfiguration::baseEnvironment() const
return env;
}
QString Qt4BuildConfiguration::defaultShadowBuildDirectory() const
{
Qt4BaseTargetFactory *factory = Qt4BaseTargetFactory::qt4BaseTargetFactoryForId(qt4Target()->id());
// todo displayName isn't ideal
return factory->shadowBuildDirectory(qt4Target()->qt4Project()->file()->fileName(), qt4Target()->id(), displayName());
}
/// returns the unexpanded build directory
QString Qt4BuildConfiguration::rawBuildDirectory() const
{
......@@ -245,7 +250,7 @@ QString Qt4BuildConfiguration::rawBuildDirectory() const
if (!m_buildDirectory.isEmpty())
workingDirectory = m_buildDirectory;
else
workingDirectory = qt4Target()->defaultBuildDirectory();
workingDirectory = defaultShadowBuildDirectory();
}
if (workingDirectory.isEmpty())
workingDirectory = target()->project()->projectDirectory();
......@@ -291,7 +296,7 @@ bool Qt4BuildConfiguration::shadowBuild() const
QString Qt4BuildConfiguration::shadowBuildDirectory() const
{
if (m_buildDirectory.isEmpty())
return qt4Target()->defaultBuildDirectory();
return defaultShadowBuildDirectory();
return m_buildDirectory;
}
......@@ -393,6 +398,7 @@ void Qt4BuildConfiguration::setQMakeBuildConfiguration(QtVersion::QmakeBuildConf
emit proFileEvaluateNeeded(this);
emit qmakeBuildConfigurationChanged();
emitBuildDirectoryChanged();
}
void Qt4BuildConfiguration::emitProFileEvaluteNeeded()
......
......@@ -158,6 +158,7 @@ private:
void ctor();
void pickValidQtVersion();
QString rawBuildDirectory() const;
QString defaultShadowBuildDirectory() const;
bool m_shadowBuild;
bool m_isEnabled;
......
......@@ -747,19 +747,6 @@ bool Qt4Project::wasEvaluateCanceled()
return m_cancelEvaluate;
}
QString Qt4Project::defaultTopLevelBuildDirectory() const
{
return defaultTopLevelBuildDirectory(file()->fileName());
}
QString Qt4Project::defaultTopLevelBuildDirectory(const QString &profilePath)
{
if (profilePath.isEmpty())
return QString();
QFileInfo info(profilePath);
return QDir::cleanPath(projectDirectory(profilePath) + QLatin1String("/../") + info.baseName() + QLatin1String("-build"));
}
void Qt4Project::asyncUpdate()
{
if (debug)
......
......@@ -179,9 +179,6 @@ public:
/// \internal
bool wasEvaluateCanceled();
QString defaultTopLevelBuildDirectory() const;
static QString defaultTopLevelBuildDirectory(const QString &profilePath);
Internal::CentralizedFolderWatcher *centralizedFolderWatcher();
// For Qt4ProFileNode after a on disk change
......
......@@ -97,6 +97,67 @@ ProjectExplorer::Target *Qt4BaseTargetFactory::create(ProjectExplorer::Project *
return create(parent, id, w->buildConfigurationInfos());
}
QList<BuildConfigurationInfo> Qt4BaseTargetFactory::availableBuildConfigurations(const QString &id, const QString &proFilePath, const QtVersionNumber &minimumQtVersion)
{
QList<BuildConfigurationInfo> infoList;
QList<QtVersion *> knownVersions = QtVersionManager::instance()->versionsForTargetId(id, minimumQtVersion);
foreach (QtVersion *version, knownVersions) {
if (!version->isValid() || !version->toolChainAvailable())
continue;
QtVersion::QmakeBuildConfigs config = version->defaultBuildConfig();
BuildConfigurationInfo info = BuildConfigurationInfo(version, config, QString(), QString());
info.directory = shadowBuildDirectory(proFilePath, id, msgBuildConfigurationName(info));
infoList.append(info);
info.buildConfig = config ^ QtVersion::DebugBuild;
info.directory = shadowBuildDirectory(proFilePath, id, msgBuildConfigurationName(info));
infoList.append(info);
}
return infoList;
}
QString sanitize(const QString &input)
{
QString result;
result.reserve(input.size());
foreach (const QChar &c, input) {
if ((c >= 'a' && c <='z')
|| (c >= 'A' && c <= 'Z')
|| (c >= '0' && c <= '9')
|| c == '-'
|| c == '_')
result.append(c);
else
result.append('_');
}
return result;
}
QString projectDirectory(const QString &proFile)
{
if (proFile.isEmpty())
return QString();
QFileInfo info(proFile);
return info.absoluteDir().path();
}
QString Qt4BaseTargetFactory::shadowBuildDirectory(const QString &profilePath, const QString &id, const QString &suffix)
{
if (profilePath.isEmpty())
return QString();
QFileInfo info(profilePath);
QString base = QDir::cleanPath(projectDirectory(profilePath) + QLatin1String("/../") + info.baseName() + QLatin1String("-build-"));
return base + buildNameForId(id) + QLatin1String("-") + sanitize(suffix);
}
QString Qt4BaseTargetFactory::buildNameForId(const QString &id) const
{
Q_UNUSED(id);
return QString();
}
Qt4BaseTargetFactory *Qt4BaseTargetFactory::qt4BaseTargetFactoryForId(const QString &id)
{
QList<Qt4BaseTargetFactory *> factories = ExtensionSystem::PluginManager::instance()->getObjects<Qt4BaseTargetFactory>();
......@@ -158,12 +219,6 @@ Qt4Project *Qt4BaseTarget::qt4Project() const
return static_cast<Qt4Project *>(project());
}
QString Qt4BaseTarget::defaultBuildDirectory() const
{
Qt4BaseTargetFactory *fac = Qt4BaseTargetFactory::qt4BaseTargetFactoryForId(id());
return fac->defaultShadowBuildDirectory(qt4Project()->defaultTopLevelBuildDirectory(), id());
}
QList<ProjectExplorer::ToolChain *> Qt4BaseTarget::possibleToolChains(ProjectExplorer::BuildConfiguration *bc) const
{
QList<ProjectExplorer::ToolChain *> tmp;
......@@ -977,13 +1032,17 @@ QList<BuildConfigurationInfo> BuildConfigurationInfo::importBuildConfigurations(
// Check for builds in build directoy
QList<Qt4BaseTargetFactory *> factories =
ExtensionSystem::PluginManager::instance()->getObjects<Qt4BaseTargetFactory>();
QString defaultTopLevelBuildDirectory = Qt4Project::defaultTopLevelBuildDirectory(proFilePath);
foreach (Qt4BaseTargetFactory *factory, factories) {
foreach (const QString &id, factory->supportedTargetIds(0)) {
QString expectedBuild = factory->defaultShadowBuildDirectory(defaultTopLevelBuildDirectory, id);
BuildConfigurationInfo info = checkForBuild(expectedBuild, proFilePath);
if (info.isValid())
result.append(info);
QString expectedBuildprefix = factory->shadowBuildDirectory(proFilePath, id, "");
QString baseDir = QFileInfo(expectedBuildprefix).absolutePath();
foreach (const QString &dir, QDir(baseDir).entryList()) {
if (dir.startsWith(expectedBuildprefix)) {
BuildConfigurationInfo info = checkForBuild(dir, proFilePath);
if (info.isValid())
result.append(info);
}
}
}
}
return result;
......
......@@ -85,7 +85,6 @@ public:
QString directory);
virtual void createApplicationProFiles() = 0;
virtual QString defaultBuildDirectory() const;