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

Andreas Pakulat apaku at gmx.de
Thu Aug 5 14:29:39 EDT 2010


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.


More information about the CMake mailing list