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"><<a href="mailto:r.wan@aist.go.jp">r.wan@aist.go.jp</a>></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"><<a href="mailto:victor.whiskey.yankee@gmail.com">victor.whiskey.yankee@gmail.com</a>> wrote:<br>
</div><div class="im">> There may 3 or 4 levels. At the top level, I would very much like to avoid<br>
> needing to know all the dependencies at all the lower levels and<br>
> exhaustively listing each one in an 'include_directories()' command.<br>
><br>
> If utils/B.h needs utils/A.h which needs foo/Z.h, then in my top-level<br>
> directory (that only needs to know about B.h) what does its CMakeLists.txt<br>
> look like? I would like to just be add_includes(utils/B) and have cmake<br>
> figure out it also needs utils/A and foo.<br>
<br>
<br>
</div>I see what you mean now. David'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'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>