[cmake-developers] linked-usage-cleanup regressed automoc
Brad King
brad.king at kitware.com
Thu Mar 14 09:32:15 EDT 2013
On 03/13/2013 05:36 PM, Alexander Neundorf wrote:
> On Wednesday 13 March 2013, Stephen Kelly wrote:
>> I think Alex' objection is only related to thinking that the case of a
>> header-only-library-with-automoc-generated-cxx-file should be an error.
>
> Yes, looks like it.
> If this is really a feature (and not a bug), then this is probably needed.
> I still think it's kind of strange.
> I mean, this turns a header-only library, and for those I would expect that it
> was a deliberate decision to make it header-only, into a normal link library.
There is no such thing as a header-only add_library. It would have no
link language or objects and CMake would not generate. The point is to
support a header-only Qt library where the moc part is the only source
of C++ code.
> Also, at least in theory, it could be a C (and not C++) header-only library,
> which would then turn into C++.
Don't set the AUTOMOC property on the target if you don't want it.
> Really, who is using this ?
If no one was using it I wouldn't have started this thread and
this discussion wouldn't be happening (yet). It was in one of Kitware's
other projects but I don't remember which one. Since then they've
stopped using this though and moved the header into another library that
also has real sources.
However, since it worked in 2.8.10 others could be using it so it will
take a post-2.8.11 policy to drop it.
-Brad
More information about the cmake-developers
mailing list