<div class="gmail_quote">2011/7/13 Andreas Pokorny <span dir="ltr">&lt;<a href="mailto:andreas.pokorny@gmail.com">andreas.pokorny@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Such an improvement would be very welcome.. but.. have you considered a<br>
different user interface?</blockquote><div><br>Yes, i have considered that.<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"> E.g. take a look at static libraries, CMake already<br>

does transitive dependency resolution (if i am not mistaken). It also differs<br>
between like &quot;interface libraries&quot; and &quot;link libraries&quot;. Couldnt we<br>
define something<br>
like:<br>
 *  header directories i need for building target A as a property of a target<br>
 *  header directories other targets need if they depend on target A<br>
<br>
then we would write in subdirectory foo:<br>
<br>
add_library(foo ....)<br>
target_include_paths(foo include/foo )<br>
target_include_targets(foo bar)<br>
</blockquote><div><br>target_include_targets would not even be required, target_link_libraries could handle that. Whenever a target is linked to a library, it also should use the appropriate include directories.<br><br></div>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
then in a differerent subdirectory bar:<br>
add_library(bar ...)<br>
target_include_paths(bar include/bar src/mydirtystuff)<br>
target_include_targets(bar foo)<br>
# now since we do not want foo or any other target to access src/mydirtystuff:<br>
set_target_properties(bar PROPERTIES INCLUDE_INTERFACE_PATH include/bar )<br>
<br>
The existing include_directories command could &quot;call&quot;<br>
target_include_paths(..) internally<br>
for all targets defined afterwards..<br></blockquote><br>This works iff there is a 1:1 relationship between targets and directories. Boost also has components that provide multiple libraries. And it also has (quite a lot) of header-only libraries, these are components that provide no library target at all.<br>
<br>cheers, Daniel<br></div>