Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/qmake/generators/metamakefile.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    5858        delete project;
    5959}
     60
     61#ifndef QT_QMAKE_PARSER_ONLY
    6062
    6163class BuildsMetaMakefileGenerator : public MetaMakefileGenerator
     
    294296    bool hasError = false;
    295297
    296     if(Option::recursive) {
     298    // It might make sense to bequeath the CONFIG option to the recursed
     299    // projects. OTOH, one would most likely have it in all projects anyway -
     300    // either through a qmakespec, a .qmake.cache or explicitly - as otherwise
     301    // running qmake in a subdirectory would have a different auto-recurse
     302    // setting than in parent directories.
     303    bool recurse = Option::recursive == Option::QMAKE_RECURSIVE_YES
     304                   || (Option::recursive == Option::QMAKE_RECURSIVE_DEFAULT
     305                       && project->isRecursive());
     306    if(recurse) {
    297307        QString old_output_dir = Option::output_dir;
    298308        QString old_output = Option::output.fileName();
     
    376386    self->input_dir = qmake_getpwd();
    377387    self->output_dir = Option::output_dir;
    378     if(!Option::recursive || (!Option::output.fileName().endsWith(Option::dir_sep) && !QFileInfo(Option::output).isDir()))
     388    if(!recurse || (!Option::output.fileName().endsWith(Option::dir_sep) && !QFileInfo(Option::output).isDir()))
    379389        self->output_file = Option::output.fileName();
    380390    self->makefile = new BuildsMetaMakefileGenerator(project, name, false);
     
    434444#include "msvc_nmake.h"
    435445#include "borland_bmake.h"
    436 #include "msvc_dsp.h"
    437446#include "msvc_vcproj.h"
     447#include "msvc_vcxproj.h"
    438448#include "symmake_abld.h"
    439449#include "symmake_sbsv2.h"
     450#include "symbian_makefile.h"
    440451QT_END_INCLUDE_NAMESPACE
    441452
     
    462473    } else if(gen == "PROJECTBUILDER" || gen == "XCODE") {
    463474        mkfile = new ProjectBuilderMakefileGenerator;
    464     } else if(gen == "MSVC") {
    465         // Visual Studio =< v6.0
    466         if(proj->first("TEMPLATE").indexOf(QRegExp("^vc.*")) != -1)
    467             mkfile = new DspMakefileGenerator;
     475    } else if(gen == "MSVC.NET") {
     476        if (proj->first("TEMPLATE").startsWith("vc"))
     477            mkfile = new VcprojGenerator;
    468478        else
    469479            mkfile = new NmakeMakefileGenerator;
    470     } else if(gen == "MSVC.NET") {
    471         // Visual Studio >= v7.0
    472         if(proj->first("TEMPLATE").indexOf(QRegExp("^vc.*")) != -1 || proj->first("TEMPLATE").indexOf(QRegExp("^ce.*")) != -1)
    473             mkfile = new VcprojGenerator;
     480    } else if(gen == "MSBUILD") {
     481        // Visual Studio >= v11.0
     482        if (proj->first("TEMPLATE").startsWith("vc"))
     483            mkfile = new VcxprojGenerator;
    474484        else
    475485            mkfile = new NmakeMakefileGenerator;
     
    480490    } else if(gen == "SYMBIAN_SBSV2") {
    481491        mkfile = new SymbianSbsv2MakefileGenerator;
     492    } else if(gen == "SYMBIAN_UNIX") {
     493        mkfile = new SymbianMakefileTemplate<UnixMakefileGenerator>;
    482494    } else {
    483495        fprintf(stderr, "Unknown generator specified: %s\n", gen.toLatin1().constData());
     
    507519}
    508520
     521#endif // QT_QMAKE_PARSER_ONLY
     522
     523bool
     524MetaMakefileGenerator::modesForGenerator(const QString &gen,
     525        Option::HOST_MODE *host_mode, Option::TARG_MODE *target_mode)
     526{
     527    if (gen == "UNIX") {
     528#ifdef Q_OS_MAC
     529        *host_mode = Option::HOST_MACX_MODE;
     530        *target_mode = Option::TARG_MACX_MODE;
     531#else
     532        *host_mode = Option::HOST_UNIX_MODE;
     533        *target_mode = Option::TARG_UNIX_MODE;
     534#endif
     535    } else if (gen == "MSVC.NET" || gen == "BMAKE" || gen == "MSBUILD") {
     536        *host_mode = Option::HOST_WIN_MODE;
     537        *target_mode = Option::TARG_WIN_MODE;
     538    } else if (gen == "MINGW") {
     539#if defined(Q_OS_MAC)
     540        *host_mode = Option::HOST_MACX_MODE;
     541#elif defined(Q_OS_UNIX)
     542        *host_mode = Option::HOST_UNIX_MODE;
     543#else
     544        *host_mode = Option::HOST_WIN_MODE;
     545#endif
     546        *target_mode = Option::TARG_WIN_MODE;
     547    } else if (gen == "PROJECTBUILDER" || gen == "XCODE") {
     548        *host_mode = Option::HOST_MACX_MODE;
     549        *target_mode = Option::TARG_MACX_MODE;
     550    } else if (gen == "SYMBIAN_ABLD" || gen == "SYMBIAN_SBSV2" || gen == "SYMBIAN_UNIX") {
     551#if defined(Q_OS_MAC)
     552        *host_mode = Option::HOST_MACX_MODE;
     553#elif defined(Q_OS_UNIX)
     554        *host_mode = Option::HOST_UNIX_MODE;
     555#else
     556        *host_mode = Option::HOST_WIN_MODE;
     557#endif
     558        *target_mode = Option::TARG_SYMBIAN_MODE;
     559    } else {
     560        fprintf(stderr, "Unknown generator specified: %s\n", gen.toLatin1().constData());
     561        return false;
     562    }
     563    return true;
     564}
     565
    509566QT_END_NAMESPACE
Note: See TracChangeset for help on using the changeset viewer.