[CMake] Qt, PrivateClass and not fount moc_xxx.cpp

John Drescher drescherjm at gmail.com
Wed Jul 29 11:15:06 EDT 2009


On Wed, Jul 29, 2009 at 10:52 AM, Bill Hoffman<bill.hoffman at kitware.com> wrote:
> panter.dsd wrote:
>
>>
>> CMake does not generate moc_XXX.cpp. When compiling the generated file
>> moc_XXX.cxx, but I need the cpp.
>>
> I think you might want to not use #include with cpp when using Cmake, and
> that should fix your problem.  qt4_wrap_cpp( MOC_SOURCES ...) will put the
> list of moc sources in the variable MOC_SOURCES add_executable(
> PantherCommander ....${MOC_SOURCES} ) will compile them into your exe, so no
> need to #include them.
>

I see. Thanks. I had the same problem a long while back and ended up
pulling class definition out of the cpp file and putting it in a
separate header file but this makes a lot of sense..

John


More information about the CMake mailing list