[cmake-developers] Tracking Dependencies
Brad King
brad.king at kitware.com
Thu Nov 29 14:01:08 EST 2012
On 11/28/2012 09:36 PM, J Decker wrote:
> I really thought that CMake had a good handle on generation of dependencies
The implicit dependency scanning uses heuristics but does not do
full preprocessing. The Ninja generator actually does use the
"gcc -M" approach IIUC, but it does not support all compilers.
> makefiles had optional includes on the dependencies
CMake generates makefiles that work with non-GNU make tools that
lack this feature.
> GCC has option (-M?) which will write a dependency makefile-format
CMake supports compilers that do not have this feature.
Ideally every tool (compilers or otherwise) invoked by a build
system would produce dependencies as a side-effect of its
execution, but reality is far from that.
The approach could be added by creating a new "GNU Makefiles"
generator that takes advantage of optional includes and perhaps
other features of GNU make. For toolchains known to support
dependency generation that can be invoked when compiling the
object files. For other toolchains we could substitute our
own preprocessing tool that runs near the compiler to produce
dependencies.
-Brad
More information about the cmake-developers
mailing list