[CMake] how to inherit includes from other directories

Raymond Wan r.wan at aist.go.jp
Wed Sep 7 01:53:47 EDT 2011


Hi Victor,


On Wed, Sep 7, 2011 at 05:39, Victor Yankee
<victor.whiskey.yankee at gmail.com> wrote:
> There may 3 or 4 levels. At the top level, I would very much like to avoid
> needing to know all the dependencies at all the lower levels and
> exhaustively listing each one in an  'include_directories()' command.
>
> If utils/B.h needs utils/A.h which needs foo/Z.h, then in my top-level
> directory (that only needs to know about B.h)  what does its CMakeLists.txt
> look like? I would like to just be add_includes(utils/B) and have cmake
> figure out it also needs utils/A and foo.


I see what you mean now.  David's reply says it better than I ever could...

The only thing I can add is that I have the same problem as you.  :-)
Many include_directories (), even for those that are more than one
degree of separation away...  I've since given up and just have a long
list of include_directories ()...

Ray


More information about the CMake mailing list