Ignore:
Timestamp:
Feb 11, 2010, 11:19:06 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.1 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/qmake/generators/metamakefile.cpp

    r363 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information ([email protected])
     4** All rights reserved.
     5** Contact: Nokia Corporation ([email protected])
    56**
    67** This file is part of the qmake application of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you
     37** @nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    6161class BuildsMetaMakefileGenerator : public MetaMakefileGenerator
    6262{
     63
    6364    bool init_flag;
    64 private:
    6565    struct Build {
    6666        QString name, build;
     
    137137        build->name = name;
    138138        build->makefile = createMakefileGenerator(project, false);
    139         makefiles += build;
     139        if (build->makefile){
     140            makefiles += build;
     141        }else {
     142            delete build;
     143            return false;
     144        }
    140145    }
    141146    return true;
     
    259264class SubdirsMetaMakefileGenerator : public MetaMakefileGenerator
    260265{
     266
    261267    bool init_flag;
    262 private:
    263268    struct Subdir {
    264269        Subdir() : makefile(0), indent(0) { }
     
    287292        return false;
    288293    init_flag = true;
     294
    289295
    290296    if(Option::recursive) {
    291         QString old_output_dir = QDir::cleanPath(Option::output_dir);
    292         if(!old_output_dir.endsWith('/'))
    293            old_output_dir += '/';
     297        QString old_output_dir = Option::output_dir;
    294298        QString old_output = Option::output.fileName();
    295         QString oldpwd = QDir::cleanPath(qmake_getpwd());
    296         if(!oldpwd.endsWith('/'))
    297            oldpwd += '/';
     299        QString oldpwd = qmake_getpwd();
     300        QString thispwd = oldpwd;
     301        if(!thispwd.endsWith('/'))
     302           thispwd += '/';
    298303        const QStringList &subdirs = project->values("SUBDIRS");
    299304        static int recurseDepth = -1;
     
    315320            if(!subdir.isRelative()) { //we can try to make it relative
    316321                QString subdir_path = subdir.filePath();
    317                 if(subdir_path.startsWith(oldpwd))
    318                     subdir = QFileInfo(subdir_path.mid(oldpwd.length()));
     322                if(subdir_path.startsWith(pwd))
     323                    subdir = QFileInfo(subdir_path.mid(pwd.length()));
    319324            }
    320325
     
    333338            qmake_setpwd(sub->input_dir);
    334339            Option::output_dir = sub->output_dir;
    335             if(Option::output_dir.at(Option::output_dir.length()-1) != QLatin1Char('/'))
    336                 Option::output_dir += QLatin1Char('/');
    337             sub_proj->read(subdir.fileName());
     340            bool tmpError = !sub_proj->read(subdir.fileName());
    338341            if(!sub_proj->variables()["QMAKE_FAILED_REQUIREMENTS"].isEmpty()) {
    339342                fprintf(stderr, "Project file(%s) not recursed because all requirements not met:\n\t%s\n",
     
    342345                delete sub;
    343346                delete sub_proj;
     347
     348
    344349                continue;
     350
     351
    345352            }
    346353            sub->makefile = MetaMakefileGenerator::createMetaGenerator(sub_proj, sub_name);
     
    350357                const QString output_name = Option::output.fileName();
    351358                Option::output.setFileName(sub->output_file);
    352                 sub->makefile->write(sub->output_dir);
     359                sub->makefile->write(sub->output_dir);
    353360                delete sub;
    354361                qmakeClearCaches();
     
    374381    self->makefile->init();
    375382    subs.append(self);
    376     return true;
     383
     384    return !hasError;
    377385}
    378386
     
    428436#include "msvc_dsp.h"
    429437#include "msvc_vcproj.h"
     438
     439
    430440QT_END_INCLUDE_NAMESPACE
    431441
     
    442452    QString gen = proj->first("MAKEFILE_GENERATOR");
    443453    if(gen.isEmpty()) {
    444         fprintf(stderr, "No generator specified in config file: %s\n",
     454        fprintf(stderr, "\n",
    445455                proj->projectFile().toLatin1().constData());
    446456    } else if(gen == "UNIX") {
     
    466476    } else if(gen == "BMAKE") {
    467477        mkfile = new BorlandMakefileGenerator;
     478
     479
     480
     481
    468482    } else {
    469483        fprintf(stderr, "Unknown generator specified: %s\n", gen.toLatin1().constData());
     
    477491
    478492MetaMakefileGenerator *
    479 MetaMakefileGenerator::createMetaGenerator(QMakeProject *proj, const QString &name, bool op)
     493MetaMakefileGenerator::createMetaGenerator(QMakeProject *proj, const QString &name, bool op)
    480494{
    481495    MetaMakefileGenerator *ret = 0;
    482     if((Option::qmake_mode == Option::QMAKE_GENERATE_MAKEFILE ||
    483         Option::qmake_mode == Option::QMAKE_GENERATE_PRL)) {
    484         if(proj->first("TEMPLATE").endsWith("subdirs"))
     496    if((Option::qmake_mode == Option::QMAKE_GENERATE_MAKEFILE ||
     497        Option::qmake_mode == Option::QMAKE_GENERATE_PRL)) {
     498        if(proj->first("TEMPLATE").endsWith("subdirs"))
    485499            ret = new SubdirsMetaMakefileGenerator(proj, name, op);
    486500    }
    487     if(!ret)
     501    if(!ret)
    488502        ret = new BuildsMetaMakefileGenerator(proj, name, op);
    489     ret->init();
     503    bool res = ret->init();
     504    if (success)
     505        *success = res;
    490506    return ret;
    491507}
Note: See TracChangeset for help on using the changeset viewer.