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

Deij-van Rijswijk, Menno M.Deij at marin.nl
Wed Aug 14 05:53:13 EDT 2019


Hi Johan,

Have you tried the trace mode of CMake? I got reasonably useful results with

cmake [path] [options] --trace 2>&1 | grep subdirectory

Gr,
Menno

From: CMake <cmake-bounces at cmake.org<mailto:cmake-bounces at cmake.org>> On Behalf Of Johan Holmberg
Sent: Wednesday, August 14, 2019 11:30 AM
To: cmake at cmake.org<mailto:cmake at cmake.org>
Subject: [CMake] Tree-like trace of add_subdirectory & include?

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



Help us improve the spam filter. If this message contains SPAM, click here<https://www.mailcontrol.com/sr/jVI8-GHVkQ7GX2PQPOmvUrxf8JpNKDSohA9aQOXjYicVQVEOI1tEcgG89FHd2j098I-NulT5b8LgE3KctAewCA==> to report. Thank you, MARIN Support Group

dr. ir. Menno A. Deij-van Rijswijk | Researcher | Research & Development
MARIN | T +31 317 49 35 06 | M.Deij at marin.nl<mailto:M.Deij at marin.nl> | www.marin.nl<http://www.marin.nl>

[LinkedIn]<https://www.linkedin.com/company/marin> [YouTube] <http://www.youtube.com/marinmultimedia>  [Twitter] <https://twitter.com/MARIN_nieuws>  [Facebook] <https://www.facebook.com/marin.wageningen>
MARIN news: Alternative fuels and power systems for support vessels<https://www.marin.nl/alternative-fuels-and-power-systems-for-support-vessels>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20190814/640c0781/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image7e5eb8.PNG
Type: image/png
Size: 293 bytes
Desc: image7e5eb8.PNG
URL: <https://cmake.org/pipermail/cmake/attachments/20190814/640c0781/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image0d3e9a.PNG
Type: image/png
Size: 331 bytes
Desc: image0d3e9a.PNG
URL: <https://cmake.org/pipermail/cmake/attachments/20190814/640c0781/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: imagee0ea3e.PNG
Type: image/png
Size: 333 bytes
Desc: imagee0ea3e.PNG
URL: <https://cmake.org/pipermail/cmake/attachments/20190814/640c0781/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image91d01a.PNG
Type: image/png
Size: 253 bytes
Desc: image91d01a.PNG
URL: <https://cmake.org/pipermail/cmake/attachments/20190814/640c0781/attachment-0003.png>


More information about the CMake mailing list