Bug 330549 - Conditionally add line such as '#include "foo.moc"' in generated files from template
Summary: Conditionally add line such as '#include "foo.moc"' in generated files from t...
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: file create (show other bugs)
Version: 4.6.60
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL: https://phabricator.kde.org/D3657
Keywords: junior-jobs
Depends on:
Blocks:
 
Reported: 2014-01-29 16:08 UTC by Kevin Funk
Modified: 2016-12-29 10:39 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 5.0.4


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Funk 2014-01-29 16:08:57 UTC
The situation for including moc files has changed a bit since then:

What we currently do when generating files:
- Add '#include "myclass.moc"' => Okay for automoc4 times

There are now these possibilities, when using CMake automoc:
- Don't add an include at all, let CMake figure out when to include the moc file in the TU
- Add '#include "moc_myclass.cpp"'

We somehow need to make this behavior configurable (or automagically work), since it's getting a bit annoying creating files from templates when CMake-Automoc is in place: You'll always have to edit the generated .cpp by hand and fixup the moc include.

Proposal:
We know due to our CMake manager, when CMake-Automoc is in place. Make the template generator aware of that.

Also see: http://mail.kde.org/pipermail/kde-buildsystem/2011-November/008287.html (sheds some light on all that automoc stuff)

Reproducible: Always
Comment 1 Kevin Funk 2016-12-29 10:39:00 UTC
With https://phabricator.kde.org/D3657 we no longer add the line at all => Issue fixed.