Changeset 362 for trunk/qmake/generators


Ignore:
Timestamp:
Nov 30, 2009, 12:56:45 AM (16 years ago)
Author:
Dmitry A. Kuminov
Message:

qmake: Don't assume that relative paths in all OSes look like in *nix [vendor bug].

Location:
trunk/qmake/generators
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/qmake/generators/makefile.cpp

    r356 r362  
    125125    }
    126126    bool ret = true;
    127 #if defined(Q_OS_WIN) || defined(Q_OS_OS2)
     127#if defined(Q_OS_WIN)
    128128    bool driveExists = true;
    129129    if(!QDir::isRelativePath(path)) {
     
    138138    }
    139139    if(driveExists)
     140
     141
     142
     143
     144
     145
     146
    140147#endif
    141148    {
     
    341348                        vpath += Option::output_dir;
    342349                }
    343                 for(QStringList::Iterator vpath_it = vpath.begin();
    344                     vpath_it != vpath.end(); ++vpath_it) {
    345                     QString real_dir = Option::fixPathToLocalOS((*vpath_it));
    346                     if(exists(real_dir + QDir::separator() + val)) {
    347                         QString dir = (*vpath_it);
    348                         if(dir.right(Option::dir_sep.length()) != Option::dir_sep)
    349                             dir += Option::dir_sep;
    350                         val = dir + val;
     350                foreach(const QString &vp, vpath) {
     351                    QString real_val = QDir(vp).absoluteFilePath(val);
     352                    if (exists(real_val)) {
     353                        val = real_val;
    351354                        if(!(flags & VPATH_NoFixify))
    352355                            val = fileFixify(val);
     
    850853                    file = libinfo.first("QMAKE_PRL_TARGET");
    851854                    if(QDir::isRelativePath(file))
    852                         file.prepend(dir);
     855                        file);
    853856                }
    854857            }
     
    27822785    if(fix == FileFixifyAbsolute || (fix == FileFixifyDefault && project->isActiveConfig("no_fixpath"))) {
    27832786        if(fix == FileFixifyAbsolute && QDir::isRelativePath(ret)) //already absolute
    2784             ret.prepend(pwd);
     2787            ret);
    27852788        ret = Option::fixPathToTargetOS(ret, false, canon);
    27862789    } else { //fix it..
     
    28002803        if(out_dir != in_dir || !qfileinfo.isRelative()) {
    28012804            if(qfileinfo.isRelative()) {
    2802                 ret = in_dir + "/" + qfile;
     2805                ret = ;
    28032806                qfileinfo.setFile(ret);
    28042807            }
     
    30223025        if(!file.fileName().isEmpty()) {
    30233026            if(QDir::isRelativePath(file.fileName()))
    3024                 file.setFileName(Option::output_dir + "/" + file.fileName()); //pwd when qmake was run
     3027                file.setFileName()); //pwd when qmake was run
    30253028            QFileInfo fi(fileInfo(file.fileName()));
    30263029            if(fi.isDir())
     
    30353038    }
    30363039    if(QDir::isRelativePath(file.fileName())) {
    3037         QString fname = Option::output_dir;  //pwd when qmake was run
    3038         if(!fname.endsWith("/"))
    3039             fname += "/";
    3040         fname += file.fileName();
    3041         file.setFileName(fname);
     3040        file.setFileName(QDir(Option::output_dir).absoluteFilePath(file.fileName())); //pwd when qmake was run
    30423041    }
    30433042    if(!build.isEmpty())
     
    30573056        od = Option::fixPathToTargetOS(od);
    30583057        if(QDir::isRelativePath(od))
    3059             od.prepend(Option::output_dir);
     3058            od);
    30603059        Option::output_dir = od;
    30613060        return true;
  • trunk/qmake/generators/makefiledeps.cpp

    r2 r362  
    625625                    if(try_local) {
    626626                        QString dir = findFileInfo(file->file).path();
    627                         if(QDir::isRelativePath(dir))
    628                             dir.prepend(qmake_getpwd() + "/");
    629                         if(!dir.endsWith("/"))
    630                             dir += "/";
    631                         QMakeLocalFileName f(dir + lfn.local());
     627                        QMakeLocalFileName f(QDir(dir).absoluteFilePath(lfn.local()));
    632628                        if(findFileInfo(f).exists()) {
    633629                            lfn = fixPathForFile(f);
     
    636632                    }
    637633                    if(!exists) { //path lookup
    638                         for(QList<QMakeLocalFileName>::Iterator it = depdirs.begin(); it != depdirs.end(); ++it) {
    639                             QMakeLocalFileName f((*it).real() + Option::dir_sep + lfn.real());
     634                        for) {
     635                            QMakeLocalFileName f());
    640636                            QFileInfo fi(findFileInfo(f));
    641637                            if(fi.exists() && !fi.isDir()) {
  • trunk/qmake/generators/metamakefile.cpp

    r29 r362  
    325325            sub->input_dir = subdir.absolutePath();
    326326            if(subdir.isRelative() && old_output_dir != oldpwd) {
    327                 sub->output_dir = old_output_dir + "/" + subdir.path();
     327                sub->output_dir = );
    328328                printf("Reading %s [%s]\n", subdir.absoluteFilePath().toLatin1().constData(), sub->output_dir.toLatin1().constData());
    329329            } else { //what about shadow builds?
  • trunk/qmake/generators/win32/winmakefile.cpp

    r193 r362  
    246246                        tmp = opt;
    247247                    for(QList<QMakeLocalFileName>::Iterator it = libdirs.begin(); it != libdirs.end(); ++it) {
    248                         QString prl = (*it).local() + Option::dir_sep + tmp;
     248                        QString prl = ;
    249249                        // the original is used as the key
    250250                        QString orgprl = prl;
Note: See TracChangeset for help on using the changeset viewer.