Commit 014a7b33 authored by Daniel Teske's avatar Daniel Teske

CMake: Rewrite logic for kit selection

Some time ago the all the wizards for the Plain C++ were coalesced into one wizard.

Since then the wizard asks first for the targets via a targetsetuppage and then
in the CMakeOpenProjectWizard asked for the kit again.

This patch clean thats up, by always using the TargetSetupPage for kit
selection and removing code from the CMakeOpenProjectWizard for kit selection.

It also adds more types of buildconfigurations

Offer: Debug, Release, ReleaseWithDebugInfo, MinSizeRelease with the
corresponding -DCMAKE_BUILD_TYPE parameters. That argument is saved
in the build configuration and used once for the first cmake run. (Subsequent
runs of cmake don't require passing that to cmake again.)

Also do not require running cmake on creating the buildconfiguraiton, instead
postpone that until the buildconfiguration is made active. With the current
cmake wizard, selecting multiple kits would show a dialog per buildconfiguration.

Change-Id: I3bb806113f4f529f8e291830647d2515a6c4df8a
Task-number: QTCREATORBUG-12219
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent 798fa669
......@@ -59,6 +59,7 @@ namespace CMakeProjectManager {
namespace Internal {
const char USE_NINJA_KEY[] = "CMakeProjectManager.CMakeBuildConfiguration.UseNinja";
const char INITIAL_ARGUMENTS[] = "CMakeProjectManager.CMakeBuildConfiguration.InitialArgument";
static FileName shadowBuildDirectory(const FileName &projectFilePath, const Kit *k, const QString &bcName)
{
......@@ -85,7 +86,8 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(ProjectExplorer::Target *parent
CMakeBuildConfiguration *source) :
BuildConfiguration(parent, source),
m_msvcVersion(source->m_msvcVersion),
m_useNinja(source->m_useNinja)
m_useNinja(source->m_useNinja),
m_initialArguments(source->m_initialArguments)
{
Q_ASSERT(parent);
cloneSteps(source);
......@@ -95,6 +97,7 @@ QVariantMap CMakeBuildConfiguration::toMap() const
{
QVariantMap map(ProjectExplorer::BuildConfiguration::toMap());
map.insert(QLatin1String(USE_NINJA_KEY), m_useNinja);
map.insert(QLatin1String(INITIAL_ARGUMENTS), m_initialArguments);
return map;
}
......@@ -104,6 +107,7 @@ bool CMakeBuildConfiguration::fromMap(const QVariantMap &map)
return false;
m_useNinja = map.value(QLatin1String(USE_NINJA_KEY), false).toBool();
m_initialArguments = map.value(QLatin1String(INITIAL_ARGUMENTS)).toString();
return true;
}
......@@ -126,6 +130,16 @@ void CMakeBuildConfiguration::emitBuildTypeChanged()
emit buildTypeChanged();
}
void CMakeBuildConfiguration::setInitialArguments(const QString &arguments)
{
m_initialArguments = arguments;
}
QString CMakeBuildConfiguration::initialArguments() const
{
return m_initialArguments;
}
CMakeBuildConfiguration::~CMakeBuildConfiguration()
{ }
......@@ -156,9 +170,12 @@ QList<ProjectExplorer::BuildInfo *> CMakeBuildConfigurationFactory::availableBui
{
QList<ProjectExplorer::BuildInfo *> result;
for (int type = BuildTypeNone; type != BuildTypeLast; ++type) {
CMakeBuildInfo *info = createBuildInfo(parent->kit(),
parent->project()->projectDirectory().toString());
parent->project()->projectDirectory().toString(),
BuildType(type));
result << info;
}
return result;
}
......@@ -175,11 +192,19 @@ QList<ProjectExplorer::BuildInfo *> CMakeBuildConfigurationFactory::availableSet
{
QList<ProjectExplorer::BuildInfo *> result;
const FileName projectPathName = FileName::fromString(projectPath);
CMakeBuildInfo *info = createBuildInfo(k, ProjectExplorer::Project::projectDirectory(projectPathName).toString());
for (int type = BuildTypeNone; type != BuildTypeLast; ++type) {
CMakeBuildInfo *info = createBuildInfo(k,
ProjectExplorer::Project::projectDirectory(projectPathName).toString(),
BuildType(type));
if (type == BuildTypeNone) {
//: The name of the build configuration created by default for a cmake project.
info->displayName = tr("Default");
} else {
info->displayName = info->typeName;
}
info->buildDirectory = shadowBuildDirectory(projectPathName, k, info->displayName);
result << info;
}
return result;
}
......@@ -192,17 +217,12 @@ ProjectExplorer::BuildConfiguration *CMakeBuildConfigurationFactory::create(Proj
CMakeBuildInfo copy(*static_cast<const CMakeBuildInfo *>(info));
CMakeProject *project = static_cast<CMakeProject *>(parent->project());
CMakeManager *manager = static_cast<CMakeManager *>(project->projectManager());
if (copy.buildDirectory.isEmpty()) {
copy.buildDirectory = shadowBuildDirectory(project->projectFilePath(), parent->kit(),
copy.displayName);
}
CMakeOpenProjectWizard copw(Core::ICore::mainWindow(), manager, CMakeOpenProjectWizard::ChangeDirectory, &copy);
if (copw.exec() != QDialog::Accepted)
return 0;
CMakeBuildConfiguration *bc = new CMakeBuildConfiguration(parent);
bc->setDisplayName(copy.displayName);
bc->setDefaultDisplayName(copy.displayName);
......@@ -218,8 +238,8 @@ ProjectExplorer::BuildConfiguration *CMakeBuildConfigurationFactory::create(Proj
cleanMakeStep->setAdditionalArguments(QLatin1String("clean"));
cleanMakeStep->setClean(true);
bc->setBuildDirectory(FileName::fromString(copw.buildDirectory()));
bc->setUseNinja(copw.useNinja());
bc->setBuildDirectory(copy.buildDirectory);
bc->setInitialArguments(copy.arguments);
// Default to all
if (project->hasBuildTarget(QLatin1String("all")))
......@@ -270,15 +290,39 @@ bool CMakeBuildConfigurationFactory::canHandle(const ProjectExplorer::Target *t)
}
CMakeBuildInfo *CMakeBuildConfigurationFactory::createBuildInfo(const ProjectExplorer::Kit *k,
const QString &sourceDir) const
const QString &sourceDir,
BuildType buildType) const
{
CMakeBuildInfo *info = new CMakeBuildInfo(this);
info->typeName = tr("Build");
info->kitId = k->id();
info->environment = Environment::systemEnvironment();
k->addToEnvironment(info->environment);
info->useNinja = false;
info->sourceDirectory = sourceDir;
switch (buildType) {
case BuildTypeNone:
info->typeName = tr("Build");
break;
case BuildTypeDebug:
info->arguments = QLatin1String("-DCMAKE_BUILD_TYPE=Debug");
info->typeName = tr("Debug");
break;
case BuildTypeRelease:
info->arguments = QLatin1String("-DCMAKE_BUILD_TYPE=Release");
info->typeName = tr("Release");
break;
case BuildTypeMinSizeRel:
info->arguments = QLatin1String("-DCMAKE_BUILD_TYPE=MinSizeRel");
info->typeName = tr("Minimum Size Release");
break;
case BuildTypeRelWithDebInfo:
info->arguments = QLatin1String("-DCMAKE_BUILD_TYPE=RelWithDebInfo");
info->typeName = tr("Release with Debug Information");
break;
default:
QTC_CHECK(false);
break;
}
return info;
}
......
......@@ -64,6 +64,9 @@ public:
void emitBuildTypeChanged();
void setInitialArguments(const QString &arguments);
QString initialArguments() const;
signals:
void useNinjaChanged(bool);
......@@ -74,6 +77,7 @@ protected:
private:
QString m_msvcVersion;
bool m_useNinja;
QString m_initialArguments;
friend class CMakeProjectManager::CMakeProject;
};
......@@ -101,7 +105,17 @@ public:
private:
bool canHandle(const ProjectExplorer::Target *t) const;
CMakeBuildInfo *createBuildInfo(const ProjectExplorer::Kit *k, const QString &sourceDir) const;
enum BuildType { BuildTypeNone = 0,
BuildTypeDebug = 1,
BuildTypeRelease = 2,
BuildTypeRelWithDebInfo = 3,
BuildTypeMinSizeRel = 4,
BuildTypeLast = 5 };
CMakeBuildInfo *createBuildInfo(const ProjectExplorer::Kit *k,
const QString &sourceDir,
BuildType buildType) const;
};
} // namespace Internal
......
......@@ -59,10 +59,12 @@ public:
QTC_ASSERT(bc->target()->project(), return);
sourceDirectory = bc->target()->project()->projectDirectory().toString();
arguments = bc->initialArguments();
}
Utils::Environment environment;
QString sourceDirectory;
QString arguments;
bool useNinja;
};
......
......@@ -86,7 +86,9 @@ void CMakeBuildSettingsWidget::openChangeBuildDirectoryDialog()
CMakeBuildInfo info(m_buildConfiguration);
CMakeOpenProjectWizard copw(Core::ICore::mainWindow(),
manager, CMakeOpenProjectWizard::ChangeDirectory,
&info);
&info,
project->activeTarget()->displayName(),
project->activeTarget()->activeBuildConfiguration()->displayName());
if (copw.exec() == QDialog::Accepted) {
project->changeBuildDirectory(m_buildConfiguration, copw.buildDirectory());
m_buildConfiguration->setUseNinja(copw.useNinja());
......@@ -103,7 +105,9 @@ void CMakeBuildSettingsWidget::runCMake()
CMakeBuildInfo info(m_buildConfiguration);
CMakeOpenProjectWizard copw(Core::ICore::mainWindow(),
manager,
CMakeOpenProjectWizard::WantToUpdate, &info);
CMakeOpenProjectWizard::WantToUpdate, &info,
project->activeTarget()->displayName(),
project->activeTarget()->activeBuildConfiguration()->displayName());
if (copw.exec() == QDialog::Accepted)
project->parseCMakeLists();
}
......
......@@ -104,6 +104,12 @@ void CMakeLocatorFilter::accept(Core::LocatorFilterEntry selection) const
if (!cmakeProject)
return;
if (!cmakeProject->activeTarget())
return;
if (!cmakeProject->activeTarget()->activeBuildConfiguration())
return;
// Find the make step
MakeStep *makeStep = 0;
ProjectExplorer::BuildStepList *buildStepList = cmakeProject->activeTarget()->activeBuildConfiguration()
......
......@@ -80,36 +80,11 @@ using namespace CMakeProjectManager::Internal;
//////////////
/// CMakeOpenProjectWizard
//////////////
CMakeOpenProjectWizard::CMakeOpenProjectWizard(QWidget *parent, CMakeManager *cmakeManager, const QString &sourceDirectory, Utils::Environment env)
: Utils::Wizard(parent),
m_cmakeManager(cmakeManager),
m_sourceDirectory(sourceDirectory),
m_environment(env),
m_useNinja(false),
m_kit(0)
{
if (CMakeToolManager::cmakeTools().isEmpty())
addPage(new NoCMakePage(this));
if (!compatibleKitExist())
addPage(new NoKitPage(this));
if (hasInSourceBuild()) {
m_buildDirectory = m_sourceDirectory;
addPage(new InSourceBuildPage(this));
} else {
m_buildDirectory = m_sourceDirectory + QLatin1String("-build");
addPage(new ShadowBuildPage(this));
}
addPage(new CMakeRunPage(this));
init();
}
CMakeOpenProjectWizard::CMakeOpenProjectWizard(QWidget *parent, CMakeManager *cmakeManager, CMakeOpenProjectWizard::Mode mode,
const CMakeBuildInfo *info)
CMakeOpenProjectWizard::CMakeOpenProjectWizard(QWidget *parent, CMakeManager *cmakeManager,
CMakeOpenProjectWizard::Mode mode,
const CMakeBuildInfo *info,
const QString &kitName,
const QString &buildConfigurationName)
: Utils::Wizard(parent),
m_cmakeManager(cmakeManager),
m_sourceDirectory(info->sourceDirectory),
......@@ -137,7 +112,8 @@ CMakeOpenProjectWizard::CMakeOpenProjectWizard(QWidget *parent, CMakeManager *cm
if (CMakeToolManager::cmakeTools().isEmpty())
addPage(new NoCMakePage(this));
addPage(new CMakeRunPage(this, rmode, info->buildDirectory.toString()));
addPage(new CMakeRunPage(this, rmode, info->buildDirectory.toString(), info->arguments,
kitName, buildConfigurationName));
init();
}
......@@ -409,14 +385,19 @@ void NoCMakePage::showOptions()
Core::ICore::showOptionsDialog(Constants::CMAKE_SETTINGSPAGE_ID, this);
}
CMakeRunPage::CMakeRunPage(CMakeOpenProjectWizard *cmakeWizard, Mode mode, const QString &buildDirectory)
CMakeRunPage::CMakeRunPage(CMakeOpenProjectWizard *cmakeWizard, Mode mode,
const QString &buildDirectory, const QString &initialArguments,
const QString &kitName, const QString &buildConfigurationName)
: QWizardPage(cmakeWizard),
m_cmakeWizard(cmakeWizard),
m_haveCbpFile(false),
m_mode(mode),
m_buildDirectory(buildDirectory)
m_buildDirectory(buildDirectory),
m_kitName(kitName),
m_buildConfigurationName(buildConfigurationName)
{
initWidgets();
m_argumentsLineEdit->setText(initialArguments);
}
void CMakeRunPage::initWidgets()
......@@ -507,41 +488,37 @@ QByteArray CMakeRunPage::cachedGeneratorFromFile(const QString &cache)
void CMakeRunPage::initializePage()
{
if (m_mode == Initial) {
bool upToDateXmlFile = m_cmakeWizard->existsUpToDateXmlFile();
m_buildDirectory = m_cmakeWizard->buildDirectory();
if (upToDateXmlFile) {
m_descriptionLabel->setText(
tr("The directory %1 already contains a cbp file, which is recent enough. "
"You can pass special arguments and rerun CMake. "
"Or simply finish the wizard directly.").arg(m_buildDirectory));
m_haveCbpFile = true;
} else {
m_descriptionLabel->setText(
tr("The directory %1 does not contain a cbp file. Qt Creator needs to create this file by running CMake. "
"Some projects require command line arguments to the initial CMake call.").arg(m_buildDirectory));
}
} else if (m_mode == CMakeRunPage::NeedToUpdate) {
m_descriptionLabel->setText(tr("The directory %1 contains an outdated .cbp file. Qt "
if (m_mode == CMakeRunPage::NeedToUpdate) {
m_descriptionLabel->setText(tr("The build directory \"%1\" for the buildconfiguration \"%2\" "
"for target \"%3\" contains an outdated .cbp file. Qt "
"Creator needs to update this file by running CMake. "
"If you want to add additional command line arguments, "
"add them below. Note that CMake remembers command "
"line arguments from the previous runs.").arg(m_buildDirectory));
"line arguments from the previous runs.")
.arg(m_buildDirectory)
.arg(m_buildConfigurationName)
.arg(m_kitName));
} else if (m_mode == CMakeRunPage::Recreate) {
m_descriptionLabel->setText(tr("The directory %1 specified in a build-configuration, "
"does not contain a cbp file. Qt Creator needs to "
"recreate this file, by running CMake. "
m_descriptionLabel->setText(tr("The directory \"%1\" specified in the build-configuration \"%2\", "
"for target \"%3\" does not contain a cbp file. "
"Qt Creator needs to recreate this file, by running CMake. "
"Some projects require command line arguments to "
"the initial CMake call. Note that CMake remembers command "
"line arguments from the previous runs.").arg(m_buildDirectory));
"line arguments from the previous runs.")
.arg(m_buildDirectory)
.arg(m_buildConfigurationName)
.arg(m_kitName));
} else if (m_mode == CMakeRunPage::ChangeDirectory) {
m_buildDirectory = m_cmakeWizard->buildDirectory();
m_descriptionLabel->setText(tr("Qt Creator needs to run CMake in the new build directory. "
"Some projects require command line arguments to the "
"initial CMake call."));
} else if (m_mode == CMakeRunPage::WantToUpdate) {
m_descriptionLabel->setText(tr("Refreshing cbp file in %1.").arg(m_buildDirectory));
m_descriptionLabel->setText(tr("Refreshing cbp file in \"%1\" for buildconfiguration \"%2\" "
"for target \"%3\".")
.arg(m_buildDirectory)
.arg(m_buildConfigurationName)
.arg(m_kitName));
}
// Build the list of generators/toolchains we want to offer
......@@ -549,46 +526,6 @@ void CMakeRunPage::initializePage()
bool preferNinja = m_cmakeWizard->cmakeManager()->preferNinja();
if (m_mode == Initial) {
// Try figuring out generator and toolchain from CMakeCache.txt
QByteArray cachedGenerator = cachedGeneratorFromFile(m_buildDirectory + QLatin1String("/CMakeCache.txt"));
m_generatorComboBox->show();
QList<ProjectExplorer::Kit *> kitList = ProjectExplorer::KitManager::kits();
int defaultIndex = 0;
foreach (ProjectExplorer::Kit *k, kitList) {
CMakeTool *cmake = CMakeKitInformation::cmakeTool(k);
if (!cmake)
continue;
bool hasCodeBlocksGenerator = cmake->hasCodeBlocksMsvcGenerator();
bool hasNinjaGenerator = cmake->hasCodeBlocksNinjaGenerator();
QList<GeneratorInfo> infos = GeneratorInfo::generatorInfosFor(k,
hasNinjaGenerator ? GeneratorInfo::OfferNinja : GeneratorInfo::NoNinja,
preferNinja,
hasCodeBlocksGenerator);
if (k == ProjectExplorer::KitManager::defaultKit())
defaultIndex = m_generatorComboBox->count();
foreach (const GeneratorInfo &info, infos)
if (cachedGenerator.isEmpty() || info.generator() == cachedGenerator)
m_generatorComboBox->addItem(info.displayName(), qVariantFromValue(info));
}
if (!m_generatorComboBox->count()) {
m_generatorExtraText->setVisible(true);
m_generatorExtraText->setText(tr("The cached generator %1 is incompatible with the configured kits.")
.arg(QString::fromLatin1(cachedGenerator)));
} else {
m_generatorExtraText->setVisible(false);
}
m_generatorComboBox->setCurrentIndex(defaultIndex);
} else {
QList<GeneratorInfo> infos;
CMakeTool *cmake = CMakeKitInformation::cmakeTool(m_cmakeWizard->kit());
if (cmake) {
......@@ -611,7 +548,7 @@ void CMakeRunPage::initializePage()
}
foreach (const GeneratorInfo &info, infos)
m_generatorComboBox->addItem(info.displayName(), qVariantFromValue(info));
}
}
bool CMakeRunPage::validatePage()
......@@ -640,11 +577,6 @@ void CMakeRunPage::runCMake()
m_cmakeWizard->setKit(generatorInfo.kit());
m_cmakeWizard->setUseNinja(generatorInfo.isNinja());
// If mode is initial the user chooses the kit, otherwise it's already chosen
// and the environment already contains the kit
if (m_mode == Initial)
generatorInfo.kit()->addToEnvironment(env);
m_runCMake->setEnabled(false);
m_argumentsLineEdit->setEnabled(false);
m_generatorComboBox->setEnabled(false);
......
......@@ -74,13 +74,14 @@ public:
ChangeDirectory
};
/// used at importing a project without a .user file
CMakeOpenProjectWizard(QWidget *parent, CMakeManager *cmakeManager, const QString &sourceDirectory, Utils::Environment env);
/// used to update if we have already a .user file
/// recreates or updates the cbp file
/// Also used to change the build directory of one buildconfiguration or create a new buildconfiguration
CMakeOpenProjectWizard(QWidget *parent, CMakeManager *cmakeManager, Mode mode, const CMakeBuildInfo *info);
CMakeOpenProjectWizard(QWidget *parent, CMakeManager *cmakeManager,
Mode mode,
const CMakeBuildInfo *info,
const QString &kitName,
const QString &buildConfigurationName);
QString buildDirectory() const;
QString sourceDirectory() const;
......@@ -163,8 +164,12 @@ class CMakeRunPage : public QWizardPage
{
Q_OBJECT
public:
enum Mode { Initial, NeedToUpdate, Recreate, ChangeDirectory, WantToUpdate };
explicit CMakeRunPage(CMakeOpenProjectWizard *cmakeWizard, Mode mode = Initial, const QString &buildDirectory = QString());
enum Mode { NeedToUpdate, Recreate, ChangeDirectory, WantToUpdate };
explicit CMakeRunPage(CMakeOpenProjectWizard *cmakeWizard, Mode mode,
const QString &buildDirectory,
const QString &initialArguments,
const QString &kitName,
const QString &buildConfigurationName);
virtual void initializePage();
virtual bool validatePage();
......@@ -191,6 +196,8 @@ private:
bool m_haveCbpFile;
Mode m_mode;
QString m_buildDirectory;
QString m_kitName;
QString m_buildConfigurationName;
};
}
......
......@@ -144,9 +144,12 @@ void CMakeProject::changeActiveBuildConfiguration(ProjectExplorer::BuildConfigur
if (mode != CMakeOpenProjectWizard::Nothing) {
CMakeBuildInfo info(cmakebc);
CMakeOpenProjectWizard copw(Core::ICore::mainWindow(), m_manager, mode, &info);
if (copw.exec() == QDialog::Accepted)
CMakeOpenProjectWizard copw(Core::ICore::mainWindow(), m_manager, mode, &info,
bc->target()->displayName(), bc->displayName());
if (copw.exec() == QDialog::Accepted) {
cmakebc->setUseNinja(copw.useNinja()); // NeedToCreate can change the Ninja setting
cmakebc->setInitialArguments(QString());
}
}
// reparse
......@@ -379,6 +382,16 @@ bool CMakeProject::parseCMakeLists()
return true;
}
bool CMakeProject::needsConfiguration() const
{
return targets().isEmpty();
}
bool CMakeProject::requiresTargetPanel() const
{
return false;
}
bool CMakeProject::isProjectFile(const FileName &fileName)
{
return m_watchedFiles.contains(fileName);
......@@ -529,31 +542,7 @@ Project::RestoreResult CMakeProject::fromMap(const QVariantMap &map, QString *er
bool hasUserFile = activeTarget();
if (!hasUserFile) {
CMakeOpenProjectWizard copw(Core::ICore::mainWindow(), m_manager, projectDirectory().toString(), Environment::systemEnvironment());
if (copw.exec() != QDialog::Accepted)
return RestoreResult::UserAbort;
Kit *k = copw.kit();
Target *t = new Target(this, k);
CMakeBuildConfiguration *bc(new CMakeBuildConfiguration(t));
bc->setDefaultDisplayName(QLatin1String("all"));
bc->setUseNinja(copw.useNinja());
bc->setBuildDirectory(FileName::fromString(copw.buildDirectory()));
ProjectExplorer::BuildStepList *buildSteps = bc->stepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
ProjectExplorer::BuildStepList *cleanSteps = bc->stepList(ProjectExplorer::Constants::BUILDSTEPS_CLEAN);
// Now create a standard build configuration
buildSteps->insertStep(0, new MakeStep(buildSteps));
MakeStep *cleanMakeStep = new MakeStep(cleanSteps);
cleanSteps->insertStep(0, cleanMakeStep);
cleanMakeStep->setAdditionalArguments(QLatin1String("clean"));
cleanMakeStep->setClean(true);
t->addBuildConfiguration(bc);
t->updateDefaultDeployConfigurations();
addTarget(t);
// Nothing to do, the target setup page will show up
} else {
// We have a user file, but we could still be missing the cbp file
// or simply run createXml with the saved settings
......@@ -573,11 +562,14 @@ Project::RestoreResult CMakeProject::fromMap(const QVariantMap &map, QString *er
if (mode != CMakeOpenProjectWizard::Nothing) {
CMakeBuildInfo info(activeBC);
CMakeOpenProjectWizard copw(Core::ICore::mainWindow(), m_manager, mode, &info);
if (copw.exec() != QDialog::Accepted)
CMakeOpenProjectWizard copw(Core::ICore::mainWindow(), m_manager, mode, &info,
activeBC->target()->displayName(), activeBC->displayName());
if (copw.exec() != QDialog::Accepted) {
return RestoreResult::UserAbort;
else
} else {
activeBC->setUseNinja(copw.useNinja());
activeBC->setInitialArguments(QString());
}
}
}
......@@ -614,6 +606,8 @@ CMakeBuildTarget CMakeProject::buildTargetForTitle(const QString &title)
QString CMakeProject::uiHeaderFile(const QString &uiFile)
{
if (!activeTarget())
return QString();
QFileInfo fi(uiFile);
FileName project = projectDirectory();
FileName baseDirectory = FileName::fromString(fi.absolutePath());
......@@ -684,6 +678,8 @@ void CMakeProject::updateRunConfigurations(Target *t)
void CMakeProject::updateApplicationAndDeploymentTargets()
{
Target *t = activeTarget();
if (!t)
return;
QFile deploymentFile;
QTextStream deploymentStream;
......
......@@ -113,6 +113,10 @@ public:
bool parseCMakeLists();
bool needsConfiguration() const;