[cmake-developers] Patch to only consider build dependencies between files in the source directory

Attila Krasznahorkay attila.krasznahorkay at gmail.com
Tue Mar 15 10:48:20 EDT 2016


Dear All,

I've already talked about this a bit back in December.

https://cmake.org/pipermail/cmake-developers/2015-December/027197.html

I looked at this issue today again, as in our builds we can be seriously hampered by "cmake -E cmake_depends" calls. And then, by the huge dependency trees that these calls create. To give you a sense of the extent of the issue: While compiling just a few files against our full software build (we have a relatively complicated build setup allowing us to build small parts of our code against a nightly build of our full release), I get a depend.cmake file almost 9 MBs large.

With the following patch, when setting the CMAKE_ONLY_IN_SOURCE_DEPENDENCIES variable to 1/ON/TRUE, this file size goes down to just a few kilobytes. Speeding up our build noticeably.

As far as I can see, the "cmake -E cmake_depends" call is only used by the Makefile generator at the moment. So I only taught that generator about this new variable. I just didn't see what I should do in the Ninja generator for instance to apply this setting. Even though I would be very interested in implementing the feature in that generator as well.

I know that the code is not at all generic enough right now. But even at limited functionality, it may already be useful to a few other people as well.

Cheers,
           Attila

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-CMAKE_ONLY_IN_SOURCE_DEPENDENCIES-feature-addition.patch
Type: application/octet-stream
Size: 3501 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20160315/dabe41e5/attachment-0001.obj>


More information about the cmake-developers mailing list