[CMake] Doesn't "make -k" work with CMake?

Johan Holmberg johan556 at gmail.com
Mon Aug 16 08:53:40 EDT 2010


On Mon, Aug 16, 2010 at 2:25 PM, Andreas Pakulat <apaku at gmx.de> wrote:
> On 16.08.10 14:06:21, Johan Holmberg wrote:
>
>> I work on Linux and have been using the Makefile:s generated by CMake to
>> build, using "make -k" at the top build directory.
>>
>> I assumed the the "-k" flag would take care of building "as much as
>> possible" globally in my whole build tree.
>
> It does, but a file can only be compiled when all its dependencies are
> being fulfilled. Which might not be the case for you, e.g. if app A depends
> on lib B, the generated Makefile's won't be starting to compile A before B
> is completely build.
>

No it doesn't :) Note the use of the word "globally" in my original
mail. The source files of app A could very well be compiled before the
library B is built (B will be needed at *link time*, not before).

A tool such as Cons/SCons would work that way given "-k" since it has
a *global* view of all dependencies. But maybe the behaviour of CMake
is limited by the way Make is used and suffers from the same problems
as described by "Recursive Make Considered Harmful".

If it is like you described, that CMake decides to build A only after
B is successfully built, I understand the current behaviour. In a way
this answers my original question (even if I had hoped for another
answer).

And it seems like "make -i" works ok for me. I wanted to "see" all
compile errors at once before starting to fix them.

Thanks,
/Johan Holmberg


More information about the CMake mailing list