[CMake] Customize dependencies scanned by CMake

Dieter Oberkofler doberkofler.lists at gmail.com
Sat Jan 15 07:57:16 EST 2011


I'm using CMake 2.8.3 using makefiles for the OSX and Windows platform.

I very much like CMake but unfortunately the build performance consistently
causes some problems.

And the main performance problem is the absolutely correct but painfully
slow dependency checking.
In a large (Qt/C++) project a single source file has over 1500 include
dependencies summing up to a "depend.make" file with several million lines.
Almost all (typically 99%) of the include dependencies are not needed in
real life because they come from Qt or other static frameworks but
dramatically slow down the build process.

I do know that CMake offers the /fast option but this removes all
dependencies and although it is 3-5 times faster, manually "optimizing" the
content of "depend.make" makes the build up to 20 times faster.
Why is the /fast option not (at least) as fast as a manually "optimized"
"depend.make"?

Is there a way to:
- customize what includes should be parsed?
- exclude dependency trees?
- limit the recursion level?

or any other option to solve this problem?

Thank you!




More information about the CMake mailing list