From d74bb06079428b8581f7fc2a7e3a855fa0c1e8c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 20 Oct 2011 10:53:28 +0200 Subject: Generate dependencies for moc_ style includes when using CONFIG+=GNUmake Sometimes you will include "moc_foo.cpp" from a a cpp file, not to tell qmake to run moc on it (that's handled by having foo.h in HEADERS), but so that the moc'ed sources are compiled as part of foo.cpp instead of a separate compilation unit, or if the moc'ed sources need defintions from the cpp file. The dependency logic for CONFIG+=GNUmake failed to take this case into account, resulting in failures to find files when generating dependency information for those files. Change-Id: Iac00424e2d196b518b1ef576d7567335b8ff24f0 Reviewed-by: Simon Hausmann Reviewed-by: Oswald Buddenhagen --- qmake/generators/unix/unixmake2.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'qmake') diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 70a7d66a9b..2037e3f368 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -323,7 +323,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) if(!d_file.isEmpty()) { d_file = odir + ".deps/" + fileFixify(d_file, pwd, Option::output_dir) + ".d"; - QStringList deps = findDependencies((*it)).filter(QRegExp(Option::cpp_moc_ext + "$")); + QStringList deps = findDependencies((*it)).filter(QRegExp( + "((^|/)" + Option::h_moc_mod + "|" + Option::cpp_moc_ext + "$)")); if(!deps.isEmpty()) t << d_file << ": " << deps.join(" ") << endl; t << "-include " << d_file << endl; -- cgit v1.2.3