[CMake] Tree-like trace of add_subdirectory & include?

Johan Holmberg johan556 at gmail.com
Wed Aug 14 05:29:50 EDT 2019


Hi!
I'm trying to understand a large project built with CMake, and think it
would be very helpful to get a view of which CMake-file "calls" which other
CMake-file. I'm interested in the chain of calls using "add_subdirectory"
and "include".

I have looked at the options "--debug-output" and "--trace", but they only
give a "flat" view of the call graph. And reconstructing a tree-like
representation from that info seems non-trivial to me.

I'm hoping to get something like this (I hope the intended indentation can
be seen):

CMakeLists.txt
.... MyMacros/Setup.cmake
.... .... MyMacros/OtherStuff.cmake
.... lib1/CMakeLists.txt
.... lib2/CMakeLists.txt
.... Misc/CMakeLists.txt
.... .... prog_a/CMakeLists.txt
.... .... prog_b/CMakeLists.txt
.... foo/CMakeLists.txt

Is there some way to accomplish this, or something similar?

/Johan Holmberg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20190814/95d0c108/attachment.html>


More information about the CMake mailing list