diff options
author | Samuel Rødal <samuel.rodal@digia.com> | 2013-03-21 08:18:12 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@digia.com> | 2013-03-21 08:49:01 +0100 |
commit | 2ab9b747fcc5aa50e8cca758f7780158e734a222 (patch) | |
tree | 7017007823d54c2d658079e928f7220a1f57a852 /qmake/generators | |
parent | f1e681bed21e131864fe1e1c91679f7a56b06823 (diff) | |
parent | 8bfbaa41783dad66976fc83d4ca8c7e2673f5629 (diff) |
Merge remote-tracking branch 'gerrit/release' into stable
Conflicts:
configure
mkspecs/features/qt_module_headers.prf
mkspecs/features/qt_tool.prf
src/angle/angle.pro
src/tools/bootstrap/bootstrap.pro
tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
Change-Id: Ide5759fe419a50f1c944211a48f7c66f662684e0
Diffstat (limited to 'qmake/generators')
-rw-r--r-- | qmake/generators/mac/pbuilder_pbx.cpp | 7 | ||||
-rw-r--r-- | qmake/generators/makefile.cpp | 36 | ||||
-rw-r--r-- | qmake/generators/makefile.h | 2 | ||||
-rw-r--r-- | qmake/generators/metamakefile.cpp | 10 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_vcproj.cpp | 7 |
5 files changed, 29 insertions, 33 deletions
diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index 6b23cbe42e..a09e10c55e 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -137,6 +137,7 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t) QList<ProjectBuilderSubDirs*> pb_subdirs; pb_subdirs.append(new ProjectBuilderSubDirs(project, QString(), false)); QString oldpwd = qmake_getpwd(); + QString oldoutpwd = Option::output_dir; QMap<QString, ProStringList> groups; for(int pb_subdir = 0; pb_subdir < pb_subdirs.size(); ++pb_subdir) { ProjectBuilderSubDirs *pb = pb_subdirs[pb_subdir]; @@ -173,6 +174,7 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t) if(!qmake_setpwd(dir)) fprintf(stderr, "Cannot find directory: %s\n", dir.toLatin1().constData()); } + Option::output_dir = Option::globals->shadowedPath(QDir::cleanPath(fi.absoluteFilePath())); if(tmp_proj.read(fn)) { if(tmp_proj.first("TEMPLATE") == "subdirs") { QMakeProject *pp = new QMakeProject(&tmp_proj); @@ -190,13 +192,13 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t) bool in_root = true; QString name = qmake_getpwd(); if(project->isActiveConfig("flat")) { - QString flat_file = fileFixify(name, oldpwd, Option::output_dir, FileFixifyRelative); + QString flat_file = fileFixify(name, oldpwd, oldoutpwd, FileFixifyRelative); if(flat_file.indexOf(Option::dir_sep) != -1) { QStringList dirs = flat_file.split(Option::dir_sep); name = dirs.back(); } } else { - QString flat_file = fileFixify(name, oldpwd, Option::output_dir, FileFixifyRelative); + QString flat_file = fileFixify(name, oldpwd, oldoutpwd, FileFixifyRelative); if(QDir::isRelativePath(flat_file) && flat_file.indexOf(Option::dir_sep) != -1) { QString last_grp("QMAKE_SUBDIR_PBX_HEIR_GROUP"); QStringList dirs = flat_file.split(Option::dir_sep); @@ -278,6 +280,7 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t) } nextfile: qmake_setpwd(oldpwd); + Option::output_dir = oldoutpwd; } } } diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 3cac073d72..5a5f259358 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -92,18 +92,8 @@ bool MakefileGenerator::canExecute(const QStringList &cmdline, int *a) const QString MakefileGenerator::mkdir_p_asstring(const QString &dir, bool escape) const { - QString ret = "@" + chkdir + " "; - if(escape) - ret += escapeFilePath(dir); - else - ret += dir; - ret += " " + chkglue + "$(MKDIR) "; - if(escape) - ret += escapeFilePath(dir); - else - ret += dir; - ret += " "; - return ret; + QString edir = escape ? escapeFilePath(dir) : dir; + return "@" + makedir.arg(edir); } bool MakefileGenerator::mkdir(const QString &in_path) const @@ -440,13 +430,17 @@ MakefileGenerator::init() if (v["TARGET"].isEmpty()) warn_msg(WarnLogic, "TARGET is empty"); - chkdir = v["QMAKE_CHK_DIR_EXISTS"].join(' '); - chkfile = v["QMAKE_CHK_FILE_EXISTS"].join(' '); - if (chkfile.isEmpty()) // Backwards compat with Qt4 specs - chkfile = isWindowsShell() ? "if not exist" : "test -f"; - chkglue = v["QMAKE_CHK_EXISTS_GLUE"].join(' '); - if (chkglue.isEmpty()) // Backwards compat with Qt4 specs - chkglue = isWindowsShell() ? "" : "|| "; + makedir = v["QMAKE_MKDIR_CMD"].join(' '); + chkexists = v["QMAKE_CHK_EXISTS"].join(' '); + if (makedir.isEmpty()) { // Backwards compat with Qt < 5.0.2 specs + if (isWindowsShell()) { + makedir = "if not exist %1 mkdir %1 & if not exist %1 exit 1"; + chkexists = "if not exist %1"; + } else { + makedir = "test -d %1 || mkdir -p %1"; + chkexists = "test -e %1 ||"; + } + } if (v["QMAKE_LINK_O_FLAG"].isEmpty()) v["QMAKE_LINK_O_FLAG"].append("-o "); @@ -2401,8 +2395,8 @@ MakefileGenerator::writeSubTargetCall(QTextStream &t, if (!in.isEmpty()) { if (!in_directory.isEmpty()) t << "\n\t" << mkdir_p_asstring(out_directory); - pfx = "( " + chkfile + " " + out + " " + chkglue - + "$(QMAKE) " + in + buildArgs() + " -o " + out + pfx = "( " + chkexists.arg(out) + + + " $(QMAKE) " + in + buildArgs() + " -o " + out + " ) && "; } writeSubMakeCall(t, out_directory_cdin + pfx, makefilein); diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h index e1447c61c3..47acc8098f 100644 --- a/qmake/generators/makefile.h +++ b/qmake/generators/makefile.h @@ -81,7 +81,7 @@ class MakefileGenerator : protected QMakeSourceFileInfo QString spec; bool init_opath_already, init_already, no_io; QHash<QString, bool> init_compiler_already; - QString chkdir, chkfile, chkglue; + QString makedir, chkexists; QString build_args(const QString &outdir=QString()); //internal caches diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp index e3fa39c7e4..a037a966f6 100644 --- a/qmake/generators/metamakefile.cpp +++ b/qmake/generators/metamakefile.cpp @@ -385,18 +385,16 @@ SubdirsMetaMakefileGenerator::write() const QString &output_name = Option::output.fileName(); for(int i = 0; ret && i < subs.count(); i++) { const Subdir *sub = subs.at(i); - qmake_setpwd(subs.at(i)->input_dir); - Option::output_dir = QFileInfo(subs.at(i)->output_dir).absoluteFilePath(); - if(Option::output_dir.at(Option::output_dir.length()-1) != QLatin1Char('/')) - Option::output_dir += QLatin1Char('/'); - Option::output.setFileName(subs.at(i)->output_file); + qmake_setpwd(sub->input_dir); + Option::output_dir = QFileInfo(sub->output_dir).absoluteFilePath(); + Option::output.setFileName(sub->output_file); if(i != subs.count()-1) { for (int ind = 0; ind < sub->indent; ++ind) printf(" "); printf("Writing %s\n", QDir::cleanPath(Option::output_dir+"/"+ Option::output.fileName()).toLatin1().constData()); } - if (!(ret = subs.at(i)->makefile->write())) + if (!(ret = sub->makefile->write())) break; //restore because I'm paranoid qmake_setpwd(pwd); diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index fce2147ed5..793c2ad1ad 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -434,18 +434,21 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHash<QSt projLookup.insert(profileKey, fi.absoluteFilePath()); } QString oldpwd = qmake_getpwd(); + QString oldoutpwd = Option::output_dir; QMakeProject tmp_proj; QString dir = fi.absolutePath(), fn = fi.fileName(); if (!dir.isEmpty()) { if (!qmake_setpwd(dir)) fprintf(stderr, "Cannot find directory: %s", dir.toLatin1().constData()); } + Option::output_dir = Option::globals->shadowedPath(QDir::cleanPath(fi.absoluteFilePath())); if (tmp_proj.read(fn)) { // Check if all requirements are fulfilled if (!tmp_proj.isEmpty("QMAKE_FAILED_REQUIREMENTS")) { fprintf(stderr, "Project file(%s) not added to Solution because all requirements not met:\n\t%s\n", fn.toLatin1().constData(), tmp_proj.values("QMAKE_FAILED_REQUIREMENTS").join(" ").toLatin1().constData()); qmake_setpwd(oldpwd); + Option::output_dir = oldoutpwd; continue; } if (tmp_proj.first("TEMPLATE") == "vcsubdirs") { @@ -460,13 +463,10 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHash<QSt // and to be able to extract all the dependencies Option::QMAKE_MODE old_mode = Option::qmake_mode; Option::qmake_mode = Option::QMAKE_GENERATE_NOTHING; - QString old_output_dir = Option::output_dir; - Option::output_dir = QFileInfo(fileFixify(dir, qmake_getpwd(), Option::output_dir)).canonicalFilePath(); VcprojGenerator tmp_vcproj; tmp_vcproj.setNoIO(true); tmp_vcproj.setProjectFile(&tmp_proj); Option::qmake_mode = old_mode; - Option::output_dir = old_output_dir; // We assume project filename is [QMAKE_PROJECT_NAME].vcproj QString vcproj = unescapeFilePath(tmp_vcproj.project->first("QMAKE_PROJECT_NAME") + project->first("VCPROJ_EXTENSION")); @@ -578,6 +578,7 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHash<QSt } nextfile: qmake_setpwd(oldpwd); + Option::output_dir = oldoutpwd; } } } |