How does CMake parse and execute its lists and modules

I am trying to understand how does CMake go through CMakeLists.txt files and .cmake files to produce the output in order to fix a bug in my cmake code.

Can someone help?

If you want to examine the line-by-line execution of commands, you can run cmake --trace.

1 Like

--trace-expand can show you the full line that gets executed as well (rather than just dumping out the “I’m going to expand this variable” without showing what it actually does expand to).

1 Like