[CMake] can I make an AUTOMOC generated file depend on something ?

Kim Rydhof Thor Hansen kim at rthansen.dk
Fri Feb 27 03:54:08 EST 2015


On Wed, Feb 25, 2015 at 10:45 PM, Stephen Kelly <steveire at gmail.com> wrote:
> Kim Rydhof Thor Hansen wrote:
>
>> http://www.cmake.org/cmake/help/v3.0/prop_tgt/AUTOGEN_TARGET_DEPENDS.html
>>
>> I have a similar problem because automoc doesn't pick up that my
>> metadata.json file is a dependency to the generated moc_plugin.cpp
>> when building a Qt plugin
>
> Thanks for the testcase. I filed
>
>  http://public.kitware.com/Bug/view.php?id=15419
>
> with more information on what should be done to fix this.

Thanks for your work on this.

I can't find a good workaround, I tried using autoget_target_depends
without success but I suspect that it is because I have done something
wrong.

Can anyone suggest a line to put in CMakeLists.txt in order to
manually register the dependency between metadata.json and
moc_plugin.cpp?

Regards,
-- 
Kim Rydhof Thor Hansen
Vadgårdsvej 3, 2. tv.
2860 Søborg
Phone: +45 3091 2437


More information about the CMake mailing list