Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
CMake
CMake
Commits
f7f721d4
Commit
f7f721d4
authored
Jul 10, 2017
by
Brad King
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'autogen_skip_included' into release-3.9
parents
9b9a57e1
ecac50e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
28 deletions
+33
-28
Source/cmQtAutoGenerators.cxx
Source/cmQtAutoGenerators.cxx
+33
-28
No files found.
Source/cmQtAutoGenerators.cxx
View file @
f7f721d4
...
...
@@ -971,17 +971,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
+
"{"
+
...
...
@@ -1003,36 +1005,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
());
...
...
@@ -1048,7 +1053,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."
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment