[CMake] Control the build target's external dependencies

Attila Krasznahorkay attila.krasznahorkay at gmail.com
Mon Dec 7 04:57:15 EST 2015


Dear All,

I'm struggling since a few days with the following issue.

Our development setup is such that we build large software projects in a nightly build system, which puts these projects onto a network drive. The developers then set up these nightly projects, and build their own code against them. (They can even rebuild parts that are in the nightly itself, that also required some clever tricks in CMake...)

This kind of works by now. But the system is incredibly slow. When I try to build some source code against installed releases on the network file system, >90% of the time is seemingly just spent in dependency calculation/evaluation. To demonstrate the extent of the issue, here is an example of the files generated by CMake for one of our "packages". (Sorry, they are pretty large. But that's the point...) Mind you, this is a very simple package that just picks up Boost from the network disk. For high level packages the depend.make file can be up to 2 MB in size. :-(

-------------- next part --------------
A non-text attachment was scrubbed...
Name: depend.make
Type: application/octet-stream
Size: 127800 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake/attachments/20151207/9a766a2a/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: flags.make
Type: application/octet-stream
Size: 1314 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake/attachments/20151207/9a766a2a/attachment-0003.obj>
-------------- next part --------------


As you can see, I tried to convince CMake to treat the include directories coming from the network file system (AFS) as system include directories. But still, the dependencies put into depend.make list every single header file that the build targets have any relationship with.

As it turns out, AFS is pretty slow for such operations. Checking the change times of thousands of files. At least this is what I contribute the ridiculously slow build times to. (Not for this example. This package still builds reasonably. It's the higher level packages that break down completely. I just couldn't attach example files from those due to the size limitations of this mailing list.)

So... How could one convince CMake to exclude some directories from the dependency setup? The files that are part of the nightly builds should definitely not need to be checked for changes every time I run a build. As you can see, depend.make even list all the Boost headers at the moment. :-(

What I tried so far was to specify the include directories using SYSTEM in target_include_directories. But it didn't make any difference whether I used SYSTEM or not.

Is there some other mechanism that I could use here?

Cheers,
            Attila


More information about the CMake mailing list