<div class="gmail_quote">On Fri, Apr 3, 2009 at 6:23 AM, elizabeta petreska <span dir="ltr"><<a href="mailto:elizabeta.petreska@gmail.com" target="_blank">elizabeta.petreska@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello<br><br>I have the following problem. <br>I have two libraries A and B. A depends on B. I am adding B in A with add_subdirectory<br><br><br>---this is B cmakelists.txt<br>......<br>include_directories(B_external_includes)<br>
<br><br><br>--this is A cmakelists.txt<br>.....<br>add_subdirectory(../B ${CMAKE_BINARY_DIR})<br><br>include_directories(B_includes B_external_includes)<br><br><br><br>B uses some external libraries, so it lists the headers from the external libraries in its include_directories().<br>
The thing is in that A also have to have the headers from the external libraries listied in its include_directories in order<br>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.<br>
<br>So the question is this :<br>Is there any way that A can inherit the include_directories specified by its child B, or maybe some other workaround?</blockquote><div><br>By design, include_directories() only affects the current directory and any subdirectories added with add_subdirectory().<br>
<br>If "A" and "B" are built in the same CMakeLists.txt they will have the same include paths. If this is a problem the easiest way to solve the problem is to build them in separate directories. If B is built in a subdirectory of A it will inherit A's include_directories().<br>
<br>Does this help at all?<br></div></div><br>-- <br>Philip Lowman<br>