Commit 4fc6a17d authored by con's avatar con

Add setting for GCCE tool chain path.

parent 7b117ba9
......@@ -36,15 +36,12 @@
using namespace ProjectExplorer;
using namespace Qt4ProjectManager::Internal;
namespace {
const char *GCCE_COMMAND = "arm-none-symbianelf-gcc.exe";
}
GCCEToolChain::GCCEToolChain(S60Devices::Device device)
: GccToolChain(QLatin1String(GCCE_COMMAND)),
GCCEToolChain::GCCEToolChain(S60Devices::Device device, const QString &gcceCommand)
: GccToolChain(gcceCommand),
m_deviceId(device.id),
m_deviceName(device.name),
m_deviceRoot(device.epocRoot)
m_deviceRoot(device.epocRoot),
m_gcceCommand(gcceCommand)
{
}
......@@ -68,9 +65,9 @@ QList<HeaderPath> GCCEToolChain::systemHeaderPaths()
void GCCEToolChain::addToEnvironment(ProjectExplorer::Environment &env)
{
// TODO: do we need to set path to gcce?
env.prependOrSetPath(QString("%1\\epoc32\\tools").arg(m_deviceRoot)); // e.g. make.exe
env.prependOrSetPath(QString("%1\\epoc32\\gcc\\bin").arg(m_deviceRoot)); // e.g. gcc.exe
env.prependOrSetPath(QFileInfo(m_gcceCommand).absolutePath());
env.set("EPOCDEVICE", QString("%1:%2").arg(m_deviceId, m_deviceName));
env.set("EPOCROOT", S60Devices::cleanedRootPath(m_deviceRoot));
}
......
......@@ -40,7 +40,7 @@ namespace Internal {
class GCCEToolChain : public ProjectExplorer::GccToolChain
{
public:
GCCEToolChain(S60Devices::Device device);
GCCEToolChain(S60Devices::Device device, const QString &gcceCommand);
QList<ProjectExplorer::HeaderPath> systemHeaderPaths();
void addToEnvironment(ProjectExplorer::Environment &env);
ProjectExplorer::ToolChain::ToolChainType type() const;
......@@ -52,6 +52,7 @@ private:
QString m_deviceId;
QString m_deviceName;
QString m_deviceRoot;
QString m_gcceCommand;
};
} // namespace Internal
......
......@@ -46,15 +46,16 @@
#include <QtGui/QMainWindow>
namespace {
const char *GCCE_COMMAND = "arm-none-symbianelf-gcc.exe";
const char *S60_AUTODETECTION_SOURCE = "QTS60";
}
namespace Qt4ProjectManager {
namespace Internal {
S60Manager *S60Manager::m_instance = 0;
namespace {
static const char *S60_AUTODETECTION_SOURCE = "QTS60";
}
// ======== Parametrizable Factory for RunControls, depending on the configuration
// class and mode.
......@@ -201,7 +202,10 @@ ProjectExplorer::ToolChain *S60Manager::createWINSCWToolChain(const Qt4ProjectMa
ProjectExplorer::ToolChain *S60Manager::createGCCEToolChain(const Qt4ProjectManager::QtVersion *version) const
{
return new GCCEToolChain(deviceForQtVersion(version));
ProjectExplorer::Environment env = ProjectExplorer::Environment::systemEnvironment();
env.prependOrSetPath(version->gcceDirectory()+"/bin");
QString gcceCommandPath= env.searchInPath(GCCE_COMMAND);
return new GCCEToolChain(deviceForQtVersion(version), gcceCommandPath);
}
ProjectExplorer::ToolChain *S60Manager::createRVCTToolChain(
......@@ -238,5 +242,5 @@ S60Devices::Device S60Manager::deviceForQtVersion(const Qt4ProjectManager::QtVer
return device;
}
}
}
} // namespace internal
} // namespace qt4projectmanager
......@@ -126,6 +126,8 @@ QtOptionsPageWidget::QtOptionsPageWidget(QWidget *parent, QList<QtVersion *> ver
m_ui->mwcPath->setPromptDialogTitle(tr("Select Carbide Install Directory"));
m_ui->s60SDKPath->setExpectedKind(Utils::PathChooser::Directory);
m_ui->s60SDKPath->setPromptDialogTitle(tr("Select S60 SDK Root"));
m_ui->gccePath->setExpectedKind(Utils::PathChooser::Directory);
m_ui->gccePath->setPromptDialogTitle(tr("Select the CSL Arm Toolchain (GCCE) Directory"));
m_ui->addButton->setIcon(QIcon(Core::Constants::ICON_PLUS));
m_ui->delButton->setIcon(QIcon(Core::Constants::ICON_MINUS));
......@@ -174,6 +176,8 @@ QtOptionsPageWidget::QtOptionsPageWidget(QWidget *parent, QList<QtVersion *> ver
this, SLOT(updateCurrentMwcDirectory()));
connect(m_ui->s60SDKPath, SIGNAL(changed(QString)),
this, SLOT(updateCurrentS60SDKDirectory()));
connect(m_ui->gccePath, SIGNAL(changed(QString)),
this, SLOT(updateCurrentGcceDirectory()));
#endif
connect(m_ui->addButton, SIGNAL(clicked()),
......@@ -396,6 +400,7 @@ void QtOptionsPageWidget::updateState()
m_ui->mingwPath->setEnabled(enabled);
m_ui->mwcPath->setEnabled(enabled);
m_ui->s60SDKPath->setEnabled(enabled && !isAutodetected);
m_ui->gccePath->setEnabled(enabled);
const bool hasLog = enabled && !m_ui->qtdirList->currentItem()->data(2, Qt::UserRole).toString().isEmpty();
m_ui->showLogButton->setEnabled(hasLog);
......@@ -423,6 +428,8 @@ void QtOptionsPageWidget::makeS60Visible(bool visible)
m_ui->mwcPath->setVisible(visible);
m_ui->s60SDKLabel->setVisible(visible);
m_ui->s60SDKPath->setVisible(visible);
m_ui->gcceLabel->setVisible(visible);
m_ui->gccePath->setVisible(visible);
}
void QtOptionsPageWidget::showEnvironmentPage(QTreeWidgetItem *item)
......@@ -472,6 +479,7 @@ void QtOptionsPageWidget::showEnvironmentPage(QTreeWidgetItem *item)
makeS60Visible(true);
m_ui->mwcPath->setPath(m_versions.at(index)->mwcDirectory());
m_ui->s60SDKPath->setPath(m_versions.at(index)->s60SDKDirectory());
m_ui->gccePath->setPath(m_versions.at(index)->gcceDirectory());
#endif
} else if (types.contains(ProjectExplorer::ToolChain::INVALID)) {
makeMSVCVisible(false);
......@@ -698,6 +706,15 @@ void QtOptionsPageWidget::updateCurrentS60SDKDirectory()
return;
m_versions[currentItemIndex]->setS60SDKDirectory(m_ui->s60SDKPath->path());
}
void QtOptionsPageWidget::updateCurrentGcceDirectory()
{
QTreeWidgetItem *currentItem = m_ui->qtdirList->currentItem();
Q_ASSERT(currentItem);
int currentItemIndex = indexForTreeItem(currentItem);
if (currentItemIndex < 0)
return;
m_versions[currentItemIndex]->setGcceDirectory(m_ui->gccePath->path());
}
#endif
QList<QSharedPointerQtVersion> QtOptionsPageWidget::versions() const
......
......@@ -121,6 +121,7 @@ private slots:
#ifdef QTCREATOR_WITH_S60
void updateCurrentMwcDirectory();
void updateCurrentS60SDKDirectory();
void updateCurrentGcceDirectory();
#endif
void msvcVersionChanged();
void buildDebuggingHelper();
......
......@@ -128,6 +128,7 @@ QtVersionManager::QtVersionManager()
#ifdef QTCREATOR_WITH_S60
version->setMwcDirectory(s->value("MwcDirectory").toString());
version->setS60SDKDirectory(s->value("S60SDKDirectory").toString());
version->setGcceDirectory(s->value("GcceDirectory").toString());
#endif
m_versions.append(version);
}
......@@ -265,6 +266,7 @@ void QtVersionManager::writeVersionsIntoSettings()
#ifdef QTCREATOR_WITH_S60
s->setValue("MwcDirectory", version->mwcDirectory());
s->setValue("S60SDKDirectory", version->s60SDKDirectory());
s->setValue("GcceDirectory", version->gcceDirectory());
#endif
}
s->endArray();
......@@ -1239,6 +1241,16 @@ void QtVersion::setS60SDKDirectory(const QString &directory)
{
m_s60SDKDirectory = directory;
}
QString QtVersion::gcceDirectory() const
{
return m_gcceDirectory;
}
void QtVersion::setGcceDirectory(const QString &directory)
{
m_gcceDirectory = directory;
}
#endif
QString QtVersion::mingwDirectory() const
......
......@@ -88,6 +88,8 @@ public:
void setMwcDirectory(const QString &directory);
QString s60SDKDirectory() const;
void setS60SDKDirectory(const QString &directory);
QString gcceDirectory() const;
void setGcceDirectory(const QString &directory);
#endif
QString mingwDirectory() const;
void setMingwDirectory(const QString &directory);
......@@ -147,6 +149,7 @@ private:
#ifdef QTCREATOR_WITH_S60
QString m_mwcDirectory;
QString m_s60SDKDirectory;
QString m_gcceDirectory;
#endif
mutable bool m_mkspecUpToDate;
......
......@@ -100,7 +100,7 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</item>
<item row="7" column="1">
<item row="8" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="debuggingHelperStateLabel">
......@@ -133,12 +133,6 @@ p, li { white-space: pre-wrap; }
</item>
<item row="0" column="0" colspan="2">
<widget class="QTreeWidget" name="qtdirList">
<property name="minimumSize">
<size>
<width>0</width>
<height>150</height>
</size>
</property>
<property name="uniformRowHeights">
<bool>true</bool>
</property>
......@@ -210,23 +204,33 @@ p, li { white-space: pre-wrap; }
<widget class="Utils::PathChooser" name="s60SDKPath" native="true"/>
</item>
<item row="6" column="0">
<widget class="QLabel" name="gcceLabel">
<property name="text">
<string>CLS/GCCE Directory:</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="Utils::PathChooser" name="gccePath" native="true"/>
</item>
<item row="7" column="0">
<widget class="QLabel" name="mwcLabel">
<property name="text">
<string>Carbide Directory:</string>
</property>
</widget>
</item>
<item row="6" column="1">
<item row="7" column="1">
<widget class="Utils::PathChooser" name="mwcPath" native="true"/>
</item>
<item row="7" column="0">
<item row="8" column="0">
<widget class="QLabel" name="debuggingHelperLabel">
<property name="text">
<string>Debugging Helper:</string>
</property>
</widget>
</item>
<item row="8" column="1">
<item row="9" column="1">
<widget class="QLabel" name="errorLabel">
<property name="text">
<string/>
......
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