[CMake] inherit include directories from child directory

elizabeta petreska elizabeta.petreska at gmail.com
Fri Apr 3 06:23:54 EDT 2009


Hello

I have the following problem.
I have two libraries A and B.  A depends on B. I am adding B in A with
add_subdirectory


---this is B cmakelists.txt
......
include_directories(B_external_includes)



--this is A cmakelists.txt
.....
add_subdirectory(../B ${CMAKE_BINARY_DIR})

include_directories(B_includes B_external_includes)



B uses some external libraries, so it lists the headers from the external
libraries in its include_directories().
The thing is in that A also have to have the headers from the external
libraries listied in its include_directories in order
to compile. This is unacceptable for me, because all libraries that are
using B should include not just B_includes but also B_external_inlcudes.

So the question is this :
Is there any way that A can inherit the include_directories specified by its
child B, or maybe some other workaround?

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090403/b6b05f87/attachment-0001.htm>


More information about the CMake mailing list