コード例 #1
0
ファイル: puppetcreator.cpp プロジェクト: colede/qtcreator
bool PuppetCreator::build(const QString &qmlPuppetProjectFilePath) const
{
    PuppetBuildProgressDialog progressDialog;

    m_compileLog.clear();

    QTemporaryDir buildDirectory;

    bool buildSucceeded = false;

    if (qtIsSupported()) {
        if (buildDirectory.isValid()) {
            QStringList qmakeArguments;
            qmakeArguments.append(QStringLiteral("-r"));
            qmakeArguments.append(QStringLiteral("-after"));
            qmakeArguments.append(QStringLiteral("DESTDIR=") + qmlpuppetDirectory(UserSpacePuppet));
#ifndef QT_DEBUG
            qmakeArguments.append(QStringLiteral("CONFIG+=release"));
#endif
            qmakeArguments.append(qmlPuppetProjectFilePath);
            buildSucceeded = startBuildProcess(buildDirectory.path(), qmakeCommand(), qmakeArguments);
            if (buildSucceeded) {
                progressDialog.show();
                buildSucceeded = startBuildProcess(buildDirectory.path(), buildCommand(), QStringList(), &progressDialog);
                progressDialog.hide();
            }
        } else {
            buildSucceeded = true;
        }
    }

    m_useOnlyFallbackPuppet = !buildSucceeded;  // fall back to creator puppet and don't compile again

    return buildSucceeded;
}
コード例 #2
0
void MaemoQtVersion::fromMap(const QVariantMap &map)
{
    QtSupport::BaseQtVersion::fromMap(map);
    QString path = qmakeCommand();
    m_osType = MaemoGlobal::osType(path);
    m_isvalidVersion = MaemoGlobal::isValidMaemoQtVersion(path, m_osType);
}
コード例 #3
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()))));
}
コード例 #4
0
QString MaemoQtVersion::systemRoot() const
{
    if (m_systemRoot.isNull()) {
        QFile file(QDir::cleanPath(MaemoGlobal::targetRoot(qmakeCommand()))
                   + QLatin1String("/information"));
        if (file.exists() && file.open(QIODevice::ReadOnly | QIODevice::Text)) {
            QTextStream stream(&file);
            while (!stream.atEnd()) {
                const QString &line = stream.readLine().trimmed();
                const QStringList &list = line.split(QLatin1Char(' '));
                if (list.count() <= 1)
                    continue;
                if (list.at(0) == QLatin1String("sysroot")) {
                    m_systemRoot = MaemoGlobal::maddeRoot(qmakeCommand())
                            + QLatin1String("/sysroots/") + list.at(1);
                }
            }
        }
    }
    return m_systemRoot;
}