summaryrefslogtreecommitdiff
path: root/Source/cmQtAutoGeneratorMocUic.cxx
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2018-01-18 11:45:54 +0100
committerSebastian Holtermann <sebholt@xwmw.org>2018-01-18 18:37:49 +0100
commita1d491ca2721d234eb10553a9e336f51752aa2a0 (patch)
tree8376da841b69c2a8e3e5a80b320e861bb5dbd1d9 /Source/cmQtAutoGeneratorMocUic.cxx
parentc1ea96d04c90ac174989b3771ff90c001189036b (diff)
downloadcmake-a1d491ca2721d234eb10553a9e336f51752aa2a0.tar.gz
Autogen: AUTOMOC/UIC fix for moc/uic include on the first line
When moc/uic include was found on the first line of a file it was ignored. This fixes the issue by extending the regular expression for include detection. Closes #17655
Diffstat (limited to 'Source/cmQtAutoGeneratorMocUic.cxx')
-rw-r--r--Source/cmQtAutoGeneratorMocUic.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/cmQtAutoGeneratorMocUic.cxx b/Source/cmQtAutoGeneratorMocUic.cxx
index 4b02e0bf87..037279a87f 100644
--- a/Source/cmQtAutoGeneratorMocUic.cxx
+++ b/Source/cmQtAutoGeneratorMocUic.cxx
@@ -221,7 +221,7 @@ bool cmQtAutoGeneratorMocUic::JobParseT::ParseMocSource(WorkerT& wrk,
const char* contentChars = meta.Content.c_str();
cmsys::RegularExpressionMatch match;
while (wrk.Moc().RegExpInclude.find(contentChars, match)) {
- std::string incString = match.match(1);
+ std::string incString = match.match(2);
std::string incDir(SubDirPrefix(incString));
std::string incBase =
cmSystemTools::GetFilenameWithoutLastExtension(incString);
@@ -500,7 +500,7 @@ bool cmQtAutoGeneratorMocUic::JobParseT::ParseUic(WorkerT& wrk,
const char* contentChars = meta.Content.c_str();
cmsys::RegularExpressionMatch match;
while (wrk.Uic().RegExpInclude.find(contentChars, match)) {
- if (!ParseUicInclude(wrk, meta, match.match(1))) {
+ if (!ParseUicInclude(wrk, meta, match.match(2))) {
success = false;
break;
}
@@ -1124,9 +1124,9 @@ cmQtAutoGeneratorMocUic::cmQtAutoGeneratorMocUic()
{
// Precompile regular expressions
Moc_.RegExpInclude.compile(
- "[\n][ \t]*#[ \t]*include[ \t]+"
+ "(^|\n)[ \t]*#[ \t]*include[ \t]+"
"[\"<](([^ \">]+/)?moc_[^ \">/]+\\.cpp|[^ \">]+\\.moc)[\">]");
- Uic_.RegExpInclude.compile("[\n][ \t]*#[ \t]*include[ \t]+"
+ Uic_.RegExpInclude.compile("(^|\n)[ \t]*#[ \t]*include[ \t]+"
"[\"<](([^ \">]+/)?ui_[^ \">/]+\\.h)[\">]");
// Initialize libuv asynchronous iteration request