<div dir="ltr">Hi,<div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 26, 2015 at 3:10 PM, Jakob van Bethlehem <span dir="ltr"><<a href="mailto:jsvanbethlehem@gmail.com" target="_blank">jsvanbethlehem@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hej Andrew,<div><br></div><div>CMake does never scan source files (as far as I know), as it is not a compiler. From your question it almost seem you are making this assumption, so I just wanted to make sure to mention at least this.</div></div></blockquote><div><br></div><div>Thats wrong, CMake has to parse the source files you add to a target to be able to determine its dependencies (recursively) so it can generate makefile rules that ensure that if one of the (indirectly) included headers changes the source file is recompiled. You can see this in cmDependsC.cxx in the CMake sources for C (and possibly C++) source files.</div><div><br></div><div>It of course does not parse the C/C++ code, it merely finds lines that start with #include or #import and figures out the absolute path of the mentioned header file based on the targets include directories.</div><div><br></div><div>Of course you can help CMake here by specifying all headers in the add_executable/add_library call, but that easily ends up being a maintenance nightmare for files outside of your actual project (system headers, third-party libraries etc.).</div><div><br></div><div>Andreas</div></div></div></div>