Exemple #1
0
void MaemoQtVersion::addToEnvironment(Utils::Environment &env) const
{
    const QString maddeRoot = MaemoGlobal::maddeRoot(qmakeCommand());

    // Needed to make pkg-config stuff work.
    env.prependOrSet(QLatin1String("SYSROOT_DIR"), QDir::toNativeSeparators(systemRoot()));
    env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/madbin")
        .arg(maddeRoot)));
    env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/madlib")
        .arg(maddeRoot)));
    env.prependOrSet(QLatin1String("PERL5LIB"),
        QDir::toNativeSeparators(QString("%1/madlib/perl5").arg(maddeRoot)));

    env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/bin").arg(maddeRoot)));
    env.prependOrSetPath(QDir::toNativeSeparators(QString("%1/bin")
        .arg(MaemoGlobal::targetRoot(qmakeCommand()))));
}
static void prependOrSetQtEnvironment(Utils::Environment &env,
                                     const QString &key,
                                     const QString &value,
                                     bool &updated)
{
    const QString currentValue = env.value(key);
    const QString newValue = value + QLatin1String(":$") + key;
    if (!currentValue.isEmpty()) {
        if (currentValue == newValue)
            return;
        else
            env.unset(key);
    }

    env.prependOrSet(key, newValue);
    updated = true;
}