summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2017-02-15 19:36:39 (GMT)
committerBrad King <brad.king@kitware.com>2017-02-21 15:12:51 (GMT)
commit887e40034161589b63fdb14bfaee7f66374b9b83 (patch)
tree295eee40de86cda6cc4cd83dd995ac8fc60efc81 /Source
parent4c60099fea2b06229900cc16fed907185c4fe2ef (diff)
downloadCMake-887e40034161589b63fdb14bfaee7f66374b9b83.zip
CMake-887e40034161589b63fdb14bfaee7f66374b9b83.tar.gz
CMake-887e40034161589b63fdb14bfaee7f66374b9b83.tar.bz2
Autogen: Error message tweaks
Diffstat (limited to 'Source')
-rw-r--r--Source/cmQtAutoGenerators.cxx35
1 files changed, 17 insertions, 18 deletions
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index e84b04d..859b2de 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -808,7 +808,12 @@ bool cmQtAutoGenerators::ParseContentForMoc(
std::string fileToMoc;
if (relaxed) {
// Mode: Relaxed
- if (!requiresMoc || (incBasename != scannedFileBasename)) {
+ if (requiresMoc && (incBasename == scannedFileBasename)) {
+ // Include self
+ fileToMoc = absFilename;
+ ownDotMocIncluded = true;
+ } else {
+ // In relaxed mode try to find a header instead but issue a warning
const std::string headerToMoc = this->FindMatchingHeader(
scannedFileAbsPath, incBasename, incSubDir);
if (!headerToMoc.empty()) {
@@ -817,11 +822,10 @@ bool cmQtAutoGenerators::ParseContentForMoc(
if (!requiresMoc && (incBasename == scannedFileBasename)) {
std::ostringstream err;
err << "AutoMoc: Warning: " << absFilename << "\n"
- << "The file includes the moc file \"" << incString
- << "\", but does not contain a " << macroName
- << " macro. Running moc on "
- << "\"" << headerToMoc << "\" ! Include \"moc_"
- << incBasename
+ << "The file includes the moc file \"" << incString << "\""
+ << ", but does not contain a Q_OBJECT or Q_GADGET macro.\n"
+ << "Running moc on \"" << headerToMoc << "\"!\n"
+ << "Include \"moc_" << incBasename
<< ".cpp\" for a compatibility with "
"strict mode (see CMAKE_AUTOMOC_RELAXED_MODE).\n";
this->LogWarning(err.str());
@@ -829,10 +833,9 @@ bool cmQtAutoGenerators::ParseContentForMoc(
std::ostringstream err;
err << "AutoMoc: Warning: " << absFilename << "\n"
<< "The file includes the moc file \"" << incString
- << "\" instead of \"moc_" << incBasename
- << ".cpp\". Running moc on "
- << "\"" << headerToMoc << "\" ! Include \"moc_"
- << incBasename
+ << "\" instead of \"moc_" << incBasename << ".cpp\".\n"
+ << "Running moc on \"" << headerToMoc << "\"!\n"
+ << "Include \"moc_" << incBasename
<< ".cpp\" for compatibility with "
"strict mode (see CMAKE_AUTOMOC_RELAXED_MODE).\n";
this->LogWarning(err.str());
@@ -847,10 +850,6 @@ bool cmQtAutoGenerators::ParseContentForMoc(
this->LogError(err.str());
return false;
}
- } else {
- // Include self
- fileToMoc = absFilename;
- ownDotMocIncluded = true;
}
} else {
// Mode: Strict
@@ -892,9 +891,9 @@ bool cmQtAutoGenerators::ParseContentForMoc(
<< "The file contains a " << macroName
<< " macro, but does not include "
<< "\"" << scannedFileBasename << ".moc\", but instead includes "
- << "\"" << ownMocUnderscoreFile << "\". Running moc on "
- << "\"" << absFilename << "\" ! Better include \""
- << scannedFileBasename
+ << "\"" << ownMocUnderscoreFile << "\".\n"
+ << "Running moc on \"" << absFilename << "\"!\n"
+ << "Better include \"" << scannedFileBasename
<< ".moc\" for compatibility with "
"strict mode (see CMAKE_AUTOMOC_RELAXED_MODE).\n";
this->LogWarning(err.str());
@@ -908,7 +907,7 @@ bool cmQtAutoGenerators::ParseContentForMoc(
err << "AutoMoc: Error: " << absFilename << "\n"
<< "The file contains a " << macroName
<< " macro, but does not include "
- << "\"" << scannedFileBasename << ".moc\" !\n";
+ << "\"" << scannedFileBasename << ".moc\"!\n";
this->LogError(err.str());
return false;
}