[CMake] Dependency bug in cmake with a custom-command

David Cole david.cole at kitware.com
Thu Aug 5 17:05:46 EDT 2010


On Thu, Aug 5, 2010 at 2:29 PM, Andreas Pakulat <apaku at gmx.de> wrote:

> Hi,
>
> we're currently hitting what looks like a dependency problem with CMake
> and a custom-command. Unfortunately I couldn't reproduce this so far
> with a small example and it also only happens with one of the targets
> we're building in kdevplatform. This code was recently added, but looks
> the same as another plugin cmake-code and cpp-code wise.
>
> Ok, so here's the deal: We're using a KDE macro to run Qt's uic on our
> .ui files and add the generated header filename into a cmake variable.
> This cmake variable is then passed onto a add_library call (through
> another macro). Now when running make in a freshly created builddir
> using -j3 or so, the rule for generating the ui_xxx.h header is not
> executed before trying to compile the file that uses the header...
>
> I'm using CMake 2.8.2 here currently (or rather current HEAD of the
> release branch)
>
> This problem is only reproduceable after a make clean, once I hit the
> error and do another make -j3 run, the dependencies are proper and hence
> the generation is done.
>
> I've noticed that after the first failing run the depend.make and
> depend.internal files suddenly exist/have content. So it seems that
> cmake generates this info 'too late' and hence doesn't generate the
> ui-header early enough. Whats a bit strange though is that apparently in
> other plugins this stuff works.
>
> One more info: I'm seeing the 'Scanning dependencies of target
> kdevpatchreview' message a lot later than the error when using -k with
> make. And at that point I also see the 'Generating ui_xxx.h' message.
>
> Andreas
>
> --
> Good news from afar can bring you a welcome visitor.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>


So, you say it "looks the same" as other plugins that do not demonstrate the
problem... but there must be some differences.

What are the differences?

Can you re-name things in yours to the same names as one that works, and
then do a "diff" ...?

Or just send a few code snippets along that look different?

There are lots of folks doing Qt stuff with CMake, and I do not recall
hearing of anything like this recently. I'd think it should work, so there
must be some small difference in your CMakeLists.txt file (or something it
includes) that is triggering this issue.

Let us know more details... easier to help when looking at code or cmake
output.

Thanks,
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100805/96c5e150/attachment.htm>


More information about the CMake mailing list