forked from qt-creator/qt-creator
use QT_HOST_* where appropriate
for x-builds, the host binaries and data may be in a different place than the ones for the target. we have fallback code for qt 4, so we can use the new variables unconditionally. this patch may be incomplete - there are still some uses which *may* need changing. Change-Id: Ia96c4ea99c5c7fc62bbe32d0283c82eef5c1eefd Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
@@ -79,6 +79,7 @@ using ProjectExplorer::FormType;
|
|||||||
using ProjectExplorer::ResourceType;
|
using ProjectExplorer::ResourceType;
|
||||||
using ProjectExplorer::UnknownFileType;
|
using ProjectExplorer::UnknownFileType;
|
||||||
|
|
||||||
|
static const char kHostBins[] = "CurrentProject:QT_HOST_BINS";
|
||||||
static const char kInstallBins[] = "CurrentProject:QT_INSTALL_BINS";
|
static const char kInstallBins[] = "CurrentProject:QT_INSTALL_BINS";
|
||||||
|
|
||||||
// Known file types of a Qt 4 project
|
// Known file types of a Qt 4 project
|
||||||
@@ -142,8 +143,11 @@ void Qt4Manager::init()
|
|||||||
this, SLOT(editorChanged(Core::IEditor*)));
|
this, SLOT(editorChanged(Core::IEditor*)));
|
||||||
|
|
||||||
Core::VariableManager *vm = Core::VariableManager::instance();
|
Core::VariableManager *vm = Core::VariableManager::instance();
|
||||||
|
vm->registerVariable(kHostBins,
|
||||||
|
tr("Full path to the host bin directory of the current project's Qt version."));
|
||||||
vm->registerVariable(kInstallBins,
|
vm->registerVariable(kInstallBins,
|
||||||
tr("Full path to the bin directory of the current project's Qt version."));
|
tr("Full path to the target bin directory of the current project's Qt version."
|
||||||
|
" You probably want %1 instead.").arg(QString::fromLatin1(kHostBins)));
|
||||||
connect(vm, SIGNAL(variableUpdateRequested(QByteArray)),
|
connect(vm, SIGNAL(variableUpdateRequested(QByteArray)),
|
||||||
this, SLOT(updateVariable(QByteArray)));
|
this, SLOT(updateVariable(QByteArray)));
|
||||||
}
|
}
|
||||||
@@ -189,10 +193,10 @@ void Qt4Manager::editorAboutToClose(Core::IEditor *editor)
|
|||||||
|
|
||||||
void Qt4Manager::updateVariable(const QByteArray &variable)
|
void Qt4Manager::updateVariable(const QByteArray &variable)
|
||||||
{
|
{
|
||||||
if (variable == kInstallBins) {
|
if (variable == kHostBins || variable == kInstallBins) {
|
||||||
Qt4Project *qt4pro = qobject_cast<Qt4Project *>(ProjectExplorer::ProjectExplorerPlugin::currentProject());
|
Qt4Project *qt4pro = qobject_cast<Qt4Project *>(ProjectExplorer::ProjectExplorerPlugin::currentProject());
|
||||||
if (!qt4pro) {
|
if (!qt4pro) {
|
||||||
Core::VariableManager::instance()->remove(kInstallBins);
|
Core::VariableManager::instance()->remove(variable);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
QString value;
|
QString value;
|
||||||
@@ -203,8 +207,10 @@ void Qt4Manager::updateVariable(const QByteArray &variable)
|
|||||||
qtv = QtSupport::QtProfileInformation::qtVersion(ProjectExplorer::ProfileManager::instance()->defaultProfile());
|
qtv = QtSupport::QtProfileInformation::qtVersion(ProjectExplorer::ProfileManager::instance()->defaultProfile());
|
||||||
|
|
||||||
if (qtv)
|
if (qtv)
|
||||||
value = qtv->versionInfo().value(QLatin1String("QT_INSTALL_BINS"));
|
value = qtv->versionInfo().value(variable == kHostBins
|
||||||
Core::VariableManager::instance()->insert(kInstallBins, value);
|
? QLatin1String("QT_HOST_BINS")
|
||||||
|
: QLatin1String("QT_INSTALL_BINS"));
|
||||||
|
Core::VariableManager::instance()->insert(variable, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -362,7 +362,7 @@ bool BaseQtVersion::isValid() const
|
|||||||
|
|
||||||
return !qmakeCommand().isEmpty()
|
return !qmakeCommand().isEmpty()
|
||||||
&& m_installed
|
&& m_installed
|
||||||
&& m_versionInfo.contains(QLatin1String("QT_INSTALL_BINS"))
|
&& m_versionInfo.contains(QLatin1String("QT_HOST_BINS"))
|
||||||
&& !m_mkspecFullPath.isEmpty()
|
&& !m_mkspecFullPath.isEmpty()
|
||||||
&& m_qmakeIsExecutable;
|
&& m_qmakeIsExecutable;
|
||||||
}
|
}
|
||||||
@@ -377,7 +377,7 @@ QString BaseQtVersion::invalidReason() const
|
|||||||
return QCoreApplication::translate("QtVersion", "qmake does not exist or is not executable");
|
return QCoreApplication::translate("QtVersion", "qmake does not exist or is not executable");
|
||||||
if (!m_installed)
|
if (!m_installed)
|
||||||
return QCoreApplication::translate("QtVersion", "Qt version is not properly installed, please run make install");
|
return QCoreApplication::translate("QtVersion", "Qt version is not properly installed, please run make install");
|
||||||
if (!m_versionInfo.contains(QLatin1String("QT_INSTALL_BINS")))
|
if (!m_versionInfo.contains(QLatin1String("QT_HOST_BINS")))
|
||||||
return QCoreApplication::translate("QtVersion",
|
return QCoreApplication::translate("QtVersion",
|
||||||
"Could not determine the path to the binaries of the Qt installation, maybe the qmake path is wrong?");
|
"Could not determine the path to the binaries of the Qt installation, maybe the qmake path is wrong?");
|
||||||
if (m_mkspecUpToDate && m_mkspecFullPath.isEmpty())
|
if (m_mkspecUpToDate && m_mkspecFullPath.isEmpty())
|
||||||
@@ -533,7 +533,7 @@ void BaseQtVersion::updateSourcePath() const
|
|||||||
if (!m_sourcePath.isEmpty())
|
if (!m_sourcePath.isEmpty())
|
||||||
return;
|
return;
|
||||||
updateVersionInfo();
|
updateVersionInfo();
|
||||||
const QString installData = m_versionInfo.value(QLatin1String("QT_INSTALL_DATA"));
|
const QString installData = m_versionInfo.value(QLatin1String("QT_INSTALL_PREFIX"));
|
||||||
QString sourcePath = installData;
|
QString sourcePath = installData;
|
||||||
QFile qmakeCache(installData + QLatin1String("/.qmake.cache"));
|
QFile qmakeCache(installData + QLatin1String("/.qmake.cache"));
|
||||||
if (qmakeCache.exists()) {
|
if (qmakeCache.exists()) {
|
||||||
@@ -592,7 +592,7 @@ QString BaseQtVersion::findQtBinary(Binaries binary) const
|
|||||||
{
|
{
|
||||||
QString baseDir;
|
QString baseDir;
|
||||||
if (qtVersion() < QtVersionNumber(5, 0, 0)) {
|
if (qtVersion() < QtVersionNumber(5, 0, 0)) {
|
||||||
baseDir = versionInfo().value(QLatin1String("QT_INSTALL_BINS"));
|
baseDir = versionInfo().value(QLatin1String("QT_HOST_BINS"));
|
||||||
} else {
|
} else {
|
||||||
ensureMkSpecParsed();
|
ensureMkSpecParsed();
|
||||||
switch (binary) {
|
switch (binary) {
|
||||||
@@ -604,7 +604,7 @@ QString BaseQtVersion::findQtBinary(Binaries binary) const
|
|||||||
baseDir = m_mkspecValues.value(QLatin1String("QT.designer.bins"));
|
baseDir = m_mkspecValues.value(QLatin1String("QT.designer.bins"));
|
||||||
break;
|
break;
|
||||||
case Uic:
|
case Uic:
|
||||||
baseDir = versionInfo().value(QLatin1String("QT_INSTALL_BINS"));
|
baseDir = versionInfo().value(QLatin1String("QT_HOST_BINS"));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// Can't happen
|
// Can't happen
|
||||||
@@ -953,8 +953,8 @@ QList<ProjectExplorer::HeaderPath> BaseQtVersion::systemHeaderPathes(const Proje
|
|||||||
void BaseQtVersion::addToEnvironment(const ProjectExplorer::Profile *p, Utils::Environment &env) const
|
void BaseQtVersion::addToEnvironment(const ProjectExplorer::Profile *p, Utils::Environment &env) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(p);
|
Q_UNUSED(p);
|
||||||
env.set(QLatin1String("QTDIR"), QDir::toNativeSeparators(versionInfo().value(QLatin1String("QT_INSTALL_DATA"))));
|
env.set(QLatin1String("QTDIR"), QDir::toNativeSeparators(versionInfo().value(QLatin1String("QT_HOST_DATA"))));
|
||||||
env.prependOrSetPath(versionInfo().value(QLatin1String("QT_INSTALL_BINS")));
|
env.prependOrSetPath(versionInfo().value(QLatin1String("QT_HOST_BINS")));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BaseQtVersion::hasGdbDebuggingHelper() const
|
bool BaseQtVersion::hasGdbDebuggingHelper() const
|
||||||
|
@@ -1236,7 +1236,7 @@ QStringList QMakeEvaluator::qmakeMkspecPaths() const
|
|||||||
if (!m_sourceRoot.isEmpty())
|
if (!m_sourceRoot.isEmpty())
|
||||||
ret << m_sourceRoot + concat;
|
ret << m_sourceRoot + concat;
|
||||||
|
|
||||||
ret << m_option->propertyValue(ProString("QT_INSTALL_DATA")) + concat;
|
ret << m_option->propertyValue(ProString("QT_HOST_DATA")) + concat;
|
||||||
|
|
||||||
ret.removeDuplicates();
|
ret.removeDuplicates();
|
||||||
return ret;
|
return ret;
|
||||||
@@ -1280,7 +1280,7 @@ QStringList QMakeEvaluator::qmakeFeaturePaths() const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
feature_bases << (m_option->propertyValue(ProString("QT_INSTALL_DATA")).toQString(m_mtmp)
|
feature_bases << (m_option->propertyValue(ProString("QT_HOST_DATA")).toQString(m_mtmp)
|
||||||
+ mkspecs_concat);
|
+ mkspecs_concat);
|
||||||
|
|
||||||
foreach (const QString &fb, feature_bases) {
|
foreach (const QString &fb, feature_bases) {
|
||||||
|
Reference in New Issue
Block a user