From 5308f954c9ad13cfc6cc84f1f1255fb5faff48c6 Mon Sep 17 00:00:00 2001 From: Sebastian Holtermann Date: Wed, 15 Feb 2017 20:47:58 +0100 Subject: Autogen: Issue a warning if moc isn't required in strict mode --- Source/cmQtAutoGenerators.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 859b2de..4e4ab30 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -857,6 +857,15 @@ bool cmQtAutoGenerators::ParseContentForMoc( // Include self fileToMoc = absFilename; ownDotMocIncluded = true; + // Accept but issue a warning if moc isn't required + if (!requiresMoc) { + std::ostringstream err; + err << "AutoMoc: Error: " << absFilename << "\n" + << "The file includes the moc file \"" << incString << "\"" + << ", but does not contain a Q_OBJECT or Q_GADGET " + "macro.\n"; + this->LogWarning(err.str()); + } } else { // Don't allow FOO.moc include other than self in strict mode std::ostringstream err; -- cgit v0.12