Could you not create a file in each subdirectory called something like header-deps.cmake ?  This file would contain the include_directory() commands necessary for using this module, plus include() commands of other modules that it depends on.  So for your example:<br>
<br># utils/b/header-deps.cmake<br>include_directories(...)<br>include(${CMAKE_SOURCE_DIR)/utils/a/header-deps.cmake)<br><br># utils/a/header-deps.cmake<br>include_directories(${CMAKE_SOURCE_DIR}/common/foo)<br><br>Then you can just do include(${CMAKE_SOURCE_DIR}/utils/b/header-deps.cmake) and it will add everything that B needs including all its dependencies.<br>

<br>--<br>Glenn<br>
<br><br><div class="gmail_quote">On 7 September 2011 06:53, Raymond Wan <span dir="ltr">&lt;<a href="mailto:r.wan@aist.go.jp">r.wan@aist.go.jp</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Victor,<br>
<br>
<br>
On Wed, Sep 7, 2011 at 05:39, Victor Yankee<br>
<div class="im">&lt;<a href="mailto:victor.whiskey.yankee@gmail.com">victor.whiskey.yankee@gmail.com</a>&gt; wrote:<br>
</div><div class="im">&gt; There may 3 or 4 levels. At the top level, I would very much like to avoid<br>
&gt; needing to know all the dependencies at all the lower levels and<br>
&gt; exhaustively listing each one in an  &#39;include_directories()&#39; command.<br>
&gt;<br>
&gt; If utils/B.h needs utils/A.h which needs foo/Z.h, then in my top-level<br>
&gt; directory (that only needs to know about B.h)  what does its CMakeLists.txt<br>
&gt; look like? I would like to just be add_includes(utils/B) and have cmake<br>
&gt; figure out it also needs utils/A and foo.<br>
<br>
<br>
</div>I see what you mean now.  David&#39;s reply says it better than I ever could...<br>
<br>
The only thing I can add is that I have the same problem as you.  :-)<br>
Many include_directories (), even for those that are more than one<br>
degree of separation away...  I&#39;ve since given up and just have a long<br>
list of include_directories ()...<br>
<div><div></div><div class="h5"><br>
Ray<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a></div></div></blockquote></div><br>