<div dir="ltr">Answering to myself.<div><br></div><div>This mail by Craig explains a lot:</div><div><a href="https://cmake.org/pipermail/cmake/2016-May/063400.html">https://cmake.org/pipermail/cmake/2016-May/063400.html</a><br></div><div><br></div><div>Sorry for the noise. I guess I have my answer in there.</div><div>I'll try to propose a documentation update based on Craig's explanation because, </div><div><a href="https://cmake.org/cmake/help/v3.8/manual/cmake-buildsystem.7.html#transitive-usage-requirements">https://cmake.org/cmake/help/v3.8/manual/cmake-buildsystem.7.html#transitive-usage-requirements</a><br></div><div><br></div><div>does not contains clues on specific treatment for static libs.</div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-04-18 16:30 GMT+02:00 Eric Noulard <span dir="ltr"><<a href="mailto:eric.noulard@gmail.com" target="_blank">eric.noulard@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I have a question concerning the transitive linking of dependence and static libs.<div><div><br></div><div>I'm working a on prokect where some shared lib are linked to static lib (do not ask me why).</div><div>So I do:</div><div><br></div><div>set(CMAKE_POSITION_<wbr>INDEPENDENT_CODE True)<br></div><div><br></div><div>then I have a bunch of libraries (either static or shared) which depends on each other.</div><div>I use PRIVATE and PUBLIC specification with target_link_librairies.</div><div><br></div><div>Now I expected that the transitive link properties would be fullfilled simply i.e. that</div><div>when some target LIB1 is PRIVATEly link against say pthread. Then if a another</div><div>lib LIB2 is linked against LIB1 then then "pthread" wouldn't be dragged into the link</div><div>interface of LIB2.</div><div><br></div><div>It seems that this is not as simple as I thought and as soon as LIB1 is static</div><div>then LIB2 gets the dependency (be it PRIVATE or PUBLIC)...</div><div><br></div><div>Find attached a small example.</div><div><br></div><div>Is this a bug, a feature or something I didn't catch?</div><span class="HOEnZb"><font color="#888888"><div><br></div><div> </div>-- <br><div class="m_-4560604014629953188gmail-m_-6646876370203668695gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Eric<br></div></div></div></div></div>
</font></span></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Eric<br></div></div></div></div></div>
</div>