[CMake] INCLUDE_DIRECTORIES per project

Philip Lowman philip at yhbt.com
Sat Apr 11 00:47:54 EDT 2009


On Sat, Apr 11, 2009 at 12:17 AM, Adrian Boeing <aboeing at gmail.com> wrote:

> Great, thanks Philip! It would be fantastic if CMake included this
> feature in future.
>
> Just for clarification to make sure I haven't misunderstood, the
> solution Alex proposed would not do what I wanted (separate includes)
> because both files are in the same directory? What Alex is suggesting
> would work if I moved the files into separate directories?


include_directories() is additive as you recurse into new subdirectories
with add_subdirectory().

include
   my include files are here...
src
   include_directories(../include)
src/foo
   include_directories(${FOO_INCLUDE_DIRS})
src/bar

In the example above, src, src/foo, and src/bar will all have include in
their include path.
Only src/foo will have the contents of FOO_INCLUDE_DIRS in it's directory.

Does that answer your question?

-- 
Philip Lowman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090411/9366fd64/attachment-0001.htm>


More information about the CMake mailing list