summaryrefslogtreecommitdiffstats
path: root/qmake/generators/metamakefile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qmake/generators/metamakefile.cpp')
-rw-r--r--qmake/generators/metamakefile.cpp48
1 files changed, 45 insertions, 3 deletions
diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp
index dc3bbc7..e76e596 100644
--- a/qmake/generators/metamakefile.cpp
+++ b/qmake/generators/metamakefile.cpp
@@ -293,7 +293,15 @@ SubdirsMetaMakefileGenerator::init()
init_flag = true;
bool hasError = false;
- if(Option::recursive) {
+ // It might make sense to bequeath the CONFIG option to the recursed
+ // projects. OTOH, one would most likely have it in all projects anyway -
+ // either through a qmakespec, a .qmake.cache or explicitly - as otherwise
+ // running qmake in a subdirectory would have a different auto-recurse
+ // setting than in parent directories.
+ bool recurse = Option::recursive == Option::QMAKE_RECURSIVE_YES
+ || (Option::recursive == Option::QMAKE_RECURSIVE_DEFAULT
+ && project->isRecursive());
+ if(recurse) {
QString old_output_dir = Option::output_dir;
QString old_output = Option::output.fileName();
QString oldpwd = qmake_getpwd();
@@ -375,7 +383,7 @@ SubdirsMetaMakefileGenerator::init()
Subdir *self = new Subdir;
self->input_dir = qmake_getpwd();
self->output_dir = Option::output_dir;
- if(!Option::recursive || (!Option::output.fileName().endsWith(Option::dir_sep) && !QFileInfo(Option::output).isDir()))
+ if(!recurse || (!Option::output.fileName().endsWith(Option::dir_sep) && !QFileInfo(Option::output).isDir()))
self->output_file = Option::output.fileName();
self->makefile = new BuildsMetaMakefileGenerator(project, name, false);
self->makefile->init();
@@ -459,7 +467,7 @@ MetaMakefileGenerator::createMakefileGenerator(QMakeProject *proj, bool noIO)
} else if(gen == "PROJECTBUILDER" || gen == "XCODE") {
mkfile = new ProjectBuilderMakefileGenerator;
} else if(gen == "MSVC.NET") {
- if(proj->first("TEMPLATE").indexOf(QRegExp("^vc.*")) != -1)
+ if (proj->first("TEMPLATE").startsWith("vc"))
mkfile = new VcprojGenerator;
else
mkfile = new NmakeMakefileGenerator;
@@ -481,6 +489,40 @@ MetaMakefileGenerator::createMakefileGenerator(QMakeProject *proj, bool noIO)
return mkfile;
}
+bool
+MetaMakefileGenerator::modesForGenerator(const QString &gen,
+ Option::HOST_MODE *host_mode, Option::TARG_MODE *target_mode)
+{
+ if (gen == "UNIX") {
+#ifdef Q_OS_MAC
+ *host_mode = Option::HOST_MACX_MODE;
+ *target_mode = Option::TARG_MACX_MODE;
+#else
+ *host_mode = Option::HOST_UNIX_MODE;
+ *target_mode = Option::TARG_UNIX_MODE;
+#endif
+ } else if (gen == "MSVC.NET" || gen == "MINGW" || gen == "BMAKE") {
+ *host_mode = Option::HOST_WIN_MODE;
+ *target_mode = Option::TARG_WIN_MODE;
+ } else if (gen == "PROJECTBUILDER" || gen == "XCODE") {
+ *host_mode = Option::HOST_MACX_MODE;
+ *target_mode = Option::TARG_MACX_MODE;
+ } else if (gen == "SYMBIAN_ABLD" || gen == "SYMBIAN_SBSV2" || gen == "SYMBIAN_UNIX") {
+#if defined(Q_OS_MAC)
+ *host_mode = Option::HOST_MACX_MODE;
+#elif defined(Q_OS_UNIX)
+ *host_mode = Option::HOST_UNIX_MODE;
+#else
+ *host_mode = Option::HOST_WIN_MODE;
+#endif
+ *target_mode = Option::TARG_SYMBIAN_MODE;
+ } else {
+ fprintf(stderr, "Unknown generator specified: %s\n", gen.toLatin1().constData());
+ return false;
+ }
+ return true;
+}
+
MetaMakefileGenerator *
MetaMakefileGenerator::createMetaGenerator(QMakeProject *proj, const QString &name, bool op, bool *success)
{