Commit 102860f2 authored by Daniel Teske's avatar Daniel Teske Committed by Tobias Hunger

Fix crash with no generator selected

Change-Id: If1e09d4f6fda3b266de17087aa9b1aa0014ecaf7
Task-Nr: QTCREATORBUG-5883
Reviewed-on: http://codereview.qt.nokia.com/3410Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@nokia.com>
parent ebede115
......@@ -450,11 +450,20 @@ void CMakeRunPage::initializePage()
void CMakeRunPage::runCMake()
{
if (m_cmakeExecutable) {
// We asked the user for the cmake executable
m_cmakeWizard->cmakeManager()->setCMakeExecutable(m_cmakeExecutable->path());
}
int index = m_generatorComboBox->currentIndex();
ProjectExplorer::ToolChain *tc = 0;
if (index >= 0)
tc = static_cast<ProjectExplorer::ToolChain *>(m_generatorComboBox->itemData(index).value<void *>());
if (!tc) {
m_output->appendPlainText(tr("No generator selected."));
return;
}
m_cmakeWizard->setToolChain(tc);
......@@ -475,10 +484,7 @@ void CMakeRunPage::runCMake()
Utils::Environment env = m_cmakeWizard->environment();
tc->addToEnvironment(env);
if (m_cmakeExecutable) {
// We asked the user for the cmake executable
m_cmakeWizard->cmakeManager()->setCMakeExecutable(m_cmakeExecutable->path());
}
m_output->clear();
......
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