summaryrefslogtreecommitdiffstats
path: root/Source/cmQtAutoGenerators.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-07-11 11:35:26 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-07-11 11:35:56 (GMT)
commita49b235db9036d5ec8c8535d2074c136eeb13254 (patch)
treedc7ad88ecb46251d221001850a606269aa24f876 /Source/cmQtAutoGenerators.cxx
parent59e52b30416b3c1731ec56207baad2ef0295580b (diff)
parentecac50e133c339e4b4611631333f0f07e438c99d (diff)
downloadCMake-a49b235db9036d5ec8c8535d2074c136eeb13254.zip
CMake-a49b235db9036d5ec8c8535d2074c136eeb13254.tar.gz
CMake-a49b235db9036d5ec8c8535d2074c136eeb13254.tar.bz2
Merge topic 'autogen_skip_included'
ecac50e1 Autogen: Skip included files on demand Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1039
Diffstat (limited to 'Source/cmQtAutoGenerators.cxx')
-rw-r--r--Source/cmQtAutoGenerators.cxx61
1 files changed, 33 insertions, 28 deletions
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 948ac44..feec735 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -973,17 +973,19 @@ bool cmQtAutoGenerators::MocParseSourceContent(
const std::string headerToMoc =
this->MocFindHeader(scannedFileAbsPath, incSubDir + incRealBasename);
if (!headerToMoc.empty()) {
- // Register moc job
- mocsIncluded[headerToMoc] = incString;
- this->MocFindDepends(headerToMoc, contentText, mocDepends);
- // Store meta information for relaxed mode
- if (relaxed && (incRealBasename == scannedFileBasename)) {
- ownMocUnderscoreInclude = incString;
- ownMocUnderscoreHeader = headerToMoc;
+ if (!this->MocSkip(headerToMoc)) {
+ // Register moc job
+ mocsIncluded[headerToMoc] = incString;
+ this->MocFindDepends(headerToMoc, contentText, mocDepends);
+ // Store meta information for relaxed mode
+ if (relaxed && (incRealBasename == scannedFileBasename)) {
+ ownMocUnderscoreInclude = incString;
+ ownMocUnderscoreHeader = headerToMoc;
+ }
}
} else {
std::ostringstream ost;
- ost << "AutoMoc: Error: " << absFilename << "\n"
+ ost << "AutoMoc: Error: " << Quoted(absFilename) << "\n"
<< "The file includes the moc file " << Quoted(incString)
<< ", but could not find header "
<< Quoted(incRealBasename + "{" +
@@ -1005,36 +1007,39 @@ bool cmQtAutoGenerators::MocParseSourceContent(
// In relaxed mode try to find a header instead but issue a warning
const std::string headerToMoc =
this->MocFindHeader(scannedFileAbsPath, incSubDir + incBasename);
- if (!headerToMoc.empty() && !this->MocSkip(headerToMoc)) {
- // This is for KDE4 compatibility:
- fileToMoc = headerToMoc;
- if (!requiresMoc && (incBasename == scannedFileBasename)) {
- std::ostringstream ost;
- ost << "AutoMoc: Warning: " << Quoted(absFilename) << "\n"
+ if (!headerToMoc.empty()) {
+ if (!this->MocSkip(headerToMoc)) {
+ // This is for KDE4 compatibility:
+ fileToMoc = headerToMoc;
+ if (!requiresMoc && (incBasename == scannedFileBasename)) {
+ std::ostringstream ost;
+ ost
+ << "AutoMoc: Warning: " << Quoted(absFilename) << "\n"
<< "The file includes the moc file " << Quoted(incString)
<< ", but does not contain a Q_OBJECT or Q_GADGET macro.\n"
<< "Running moc on " << Quoted(headerToMoc) << "!\n"
<< "Include " << Quoted("moc_" + incBasename + ".cpp")
<< " for a compatibility with strict mode (see "
"CMAKE_AUTOMOC_RELAXED_MODE).\n";
- this->LogWarning(ost.str());
- } else {
- std::ostringstream ost;
- ost << "AutoMoc: Warning: " << Quoted(absFilename) << "\n"
- << "The file includes the moc file " << Quoted(incString)
- << " instead of " << Quoted("moc_" + incBasename + ".cpp")
- << ".\n"
- << "Running moc on " << Quoted(headerToMoc) << "!\n"
- << "Include " << Quoted("moc_" + incBasename + ".cpp")
- << " for compatibility with strict mode (see "
- "CMAKE_AUTOMOC_RELAXED_MODE).\n";
- this->LogWarning(ost.str());
+ this->LogWarning(ost.str());
+ } else {
+ std::ostringstream ost;
+ ost << "AutoMoc: Warning: " << Quoted(absFilename) << "\n"
+ << "The file includes the moc file " << Quoted(incString)
+ << " instead of "
+ << Quoted("moc_" + incBasename + ".cpp") << ".\n"
+ << "Running moc on " << Quoted(headerToMoc) << "!\n"
+ << "Include " << Quoted("moc_" + incBasename + ".cpp")
+ << " for compatibility with strict mode (see "
+ "CMAKE_AUTOMOC_RELAXED_MODE).\n";
+ this->LogWarning(ost.str());
+ }
}
} else {
std::ostringstream ost;
ost << "AutoMoc: Error: " << Quoted(absFilename) << "\n"
<< "The file includes the moc file " << Quoted(incString)
- << ". which seems to be the moc file from a different "
+ << ", which seems to be the moc file from a different "
"source file. CMake also could not find a matching "
"header.";
this->LogError(ost.str());
@@ -1050,7 +1055,7 @@ bool cmQtAutoGenerators::MocParseSourceContent(
// Accept but issue a warning if moc isn't required
if (!requiresMoc) {
std::ostringstream ost;
- ost << "AutoMoc: Error: " << Quoted(absFilename) << "\n"
+ ost << "AutoMoc: Warning: " << Quoted(absFilename) << "\n"
<< "The file includes the moc file " << Quoted(incString)
<< ", but does not contain a Q_OBJECT or Q_GADGET "
"macro.";