Ignore:
Timestamp:
May 3, 2011, 4:49:08 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

vendor: Imported qt-everywhere-opensource-src-4.7.2 from Nokia (excluding doc/html and doc/qch dirs generated from doc/src, and imports and templates dirs which are emtpy).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/vendor/nokia/qt/current/qmake/option.cpp

    r767 r844  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    8585//all modes
    8686QString Option::qmake_abslocation;
    87 int Option::warn_level = WarnLogic;
     87int Option::warn_level = WarnLogic;
    8888int Option::debug_level = 0;
    8989QFile Option::output;
    9090QString Option::output_dir;
    91 bool Option::recursive = false;
     91;
    9292QStringList Option::before_user_vars;
    9393QStringList Option::after_user_vars;
     
    9797QString Option::user_template_prefix;
    9898QStringList Option::shellPath;
    99 #if defined(Q_OS_WIN32)
    100 Option::TARG_MODE Option::target_mode = Option::TARG_WIN_MODE;
    101 #elif defined(Q_OS_MAC)
    102 Option::TARG_MODE Option::target_mode = Option::TARG_MACX_MODE;
    103 #else
    104 Option::TARG_MODE Option::target_mode = Option::TARG_UNIX_MODE;
    105 #endif
     99Option::HOST_MODE Option::host_mode = Option::HOST_UNKNOWN_MODE;
     100Option::TARG_MODE Option::target_mode = Option::TARG_UNKNOWN_MODE;
     101bool Option::target_mode_overridden = false;
    106102
    107103//QMAKE_*_PROPERTY stuff
     
    127123static Option::QMAKE_MODE default_mode(QString progname)
    128124{
    129     int s = progname.lastIndexOf(Option::dir_sep);
     125    int s = progname.lastIndexOf();
    130126    if(s != -1)
    131127        progname = progname.right(progname.length() - (s + 1));
     
    135131        return Option::QMAKE_QUERY_PROPERTY;
    136132    return Option::QMAKE_GENERATE_MAKEFILE;
     133
     134
     135
     136
     137
     138
     139
     140
     141
     142
     143
     144
     145
     146
    137147}
    138148
     
    161171            "\n"
    162172            "Warnings Options:\n"
    163             "  -Wnone         Turn off all warnings\n"
     173            "  -Wnone         Turn off all warnings; specific ones may be re-enabled by\n"
     174            "                 later -W options\n"
    164175            "  -Wall          Turn on all warnings\n"
    165176            "  -Wparser       Turn on parser warnings\n"
    166             "  -Wlogic        Turn on logic warnings\n"
     177            "  -Wlogic        Turn on logic warnings (on by default)\n"
     178            "  -Wdeprecated   Turn on deprecation warnings (on by default)\n"
    167179            "\n"
    168180            "Options:\n"
     
    171183            "   * before [files].                                                     *\n"
    172184            "  -o file        Write output to file\n"
    173             "  -unix          Run in unix mode\n"
    174             "  -win32         Run in win32 mode\n"
    175             "  -macx          Run in Mac OS X mode\n"
    176185            "  -d             Increase debug level\n"
    177186            "  -t templ       Overrides TEMPLATE as templ\n"
     
    210219                bool specified = true;
    211220                if(opt == "project") {
    212                     Option::recursive = true;
     221                    Option::recursive = ;
    213222                    Option::qmake_mode = Option::QMAKE_GENERATE_PROJECT;
    214223                } else if(opt == "prl") {
     
    237246            } else if(opt == "tp" || opt == "template_prefix") {
    238247                Option::user_template_prefix = argv[++x];
    239             } else if(opt == "mac9") {
    240                 Option::target_mode = TARG_MAC9_MODE;
    241248            } else if(opt == "macx") {
     249
     250
    242251                Option::target_mode = TARG_MACX_MODE;
     252
    243253            } else if(opt == "unix") {
     254
     255
    244256                Option::target_mode = TARG_UNIX_MODE;
     257
    245258            } else if(opt == "win32") {
     259
     260
    246261                Option::target_mode = TARG_WIN_MODE;
     262
    247263            } else if(opt == "d") {
    248264                Option::debug_level++;
     
    265281            } else if(opt == "Wlogic") {
    266282                Option::warn_level |= WarnLogic;
     283
     284
    267285            } else if(opt == "Wnone") {
    268286                Option::warn_level = WarnNone;
    269287            } else if(opt == "r" || opt == "recursive") {
    270                 Option::recursive = true;
    271             } else if(opt == "norecursive") {
    272                 Option::recursive = false;
     288                Option::recursive = ;
     289            } else if(opt == "norecursive") {
     290                Option::recursive = ;
    273291            } else if(opt == "config") {
    274292                Option::user_configs += argv[++x];
     
    287305                        Option::mkfile::do_dep_heuristics = false;
    288306                    } else if(opt == "E") {
     307
    289308                        Option::mkfile::do_preprocess = true;
    290309                    } else if(opt == "cache") {
     
    323342                        arg = fi.filePath();
    324343                    if(Option::qmake_mode == Option::QMAKE_GENERATE_MAKEFILE ||
    325                        Option::qmake_mode == Option::QMAKE_GENERATE_PRL)
     344                       Option::qmake_mode == Option::QMAKE_GENERATE_PRL) {
     345                        if(fi.isDir()) {
     346                            QString proj = detectProjectFile(arg);
     347                            if (!proj.isNull())
     348                                arg = proj;
     349                        }
    326350                        Option::mkfile::project_files.append(arg);
    327                     else if(Option::qmake_mode == Option::QMAKE_GENERATE_PROJECT)
     351                   
    328352                        Option::projfile::project_dirs.append(arg);
    329                     else
     353                   
    330354                        handled = false;
     355
    331356                }
    332357                if(!handled) {
     
    388413    Option::dirlist_sep = ";";
    389414    Option::shellPath = detectShellPath();
     415
    390416#else
    391417    Option::dirlist_sep = ":";
     418
    392419#endif
    393420    Option::sysenv_mod = "QMAKE_ENV_";
     
    495522        //try REALLY hard to do it for them, lazy..
    496523        if(Option::mkfile::project_files.isEmpty()) {
    497             QString pwd = qmake_getpwd(),
    498                    proj = pwd + "/" + pwd.right(pwd.length() - (pwd.lastIndexOf('/') + 1)) + Option::pro_ext;
    499             if(QFile::exists(proj)) {
     524            QString proj = detectProjectFile(qmake_getpwd());
     525            if(!proj.isNull())
    500526                Option::mkfile::project_files.append(proj);
    501             } else { //last try..
    502                 QStringList profiles = QDir(pwd).entryList(QStringList("*" + Option::pro_ext));
    503                 if(profiles.count() == 1)
    504                     Option::mkfile::project_files.append(pwd + "/" + profiles[0]);
    505             }
    506527#ifndef QT_BUILD_QMAKE_LIBRARY
    507528            if(Option::mkfile::project_files.isEmpty()) {
     
    511532#endif
    512533        }
     534
     535
     536
     537
     538
     539
     540
     541
     542
     543
     544
    513545    }
    514546
    515547    //defaults for globals
    516     if(Option::target_mode == Option::TARG_WIN_MODE) {
    517         Option::dir_sep = "\\";
    518         Option::obj_ext = ".obj";
    519         Option::res_ext = ".res";
    520     } else {
    521         if(Option::target_mode == Option::TARG_MAC9_MODE)
    522             Option::dir_sep = ":";
    523         else
    524             Option::dir_sep = "/";
    525         Option::obj_ext = ".o";
    526     }
    527     Option::qmake_abslocation = Option::fixPathToTargetOS(Option::qmake_abslocation);
     548    if (Option::host_mode != Option::HOST_UNKNOWN_MODE)
     549        applyHostMode();
    528550    return QMAKE_CMDLINE_SUCCESS;
     551
     552
     553
     554
     555
     556
     557
     558
     559
     560
     561
    529562}
    530563
     
    585618Option::fixString(QString string, uchar flags)
    586619{
    587     const QString orig_string = string;
     620    const QString orig_string = string;
    588621    static QHash<FixStringCacheKey, QString> *cache = 0;
    589622    if(!cache) {
Note: See TracChangeset for help on using the changeset viewer.