<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div name="messageBodySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">It is quite inexact because a target can store many information like include directories or preprocessor definitions for example (through properties like INCLUDE_DIRECTORIES or COMPILE_DEFINITIONS).
<div><br /></div>
<div>So it make sense to enable to specify link libraries to a static library using PRIVATE or PUBLIC to ensure various settings are propagated to the static library compilation step. </div>
</div>
<div name="messageReplySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">Le 25 janv. 2019 à 15:46 +0100, Andrew Bell <andrew.bell.ia@gmail.com>, a écrit :<br />
<blockquote type="cite" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #1abc9c;">
<div dir="ltr">
<div><br /></div>
When creating a static library, you can still use the function "target_link_libraries" even though the static library is never linked, as such.  What you're doing is creating a dependency record for cmake so that target_link_libraries of a static library are included in a link of some other target which depends on the static library.  What seems confusing is that target_link_libraries accepts the keywords PUBLIC and PRIVATE as well as INTERFACE when used with a static library, since only INTERFACE really makes sense in this context.
<div><br /></div>
<div>Would it be beneficial to issue a warning when someone uses PUBLIC or PRIVATE with target_link_libraries on a static library to make it clear that they may not be understanding what's going on?</div>
<div> <br />
--<br />
<div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Andrew Bell<br />
<a href="mailto:andrew.bell.ia@gmail.com" target="_blank">andrew.bell.ia@gmail.com</a></div>
</div>
</div>
--<br />
<br />
Powered by www.kitware.com<br />
<br />
Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ<br />
<br />
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br />
<br />
CMake Support: http://cmake.org/cmake/help/support.html<br />
CMake Consulting: http://cmake.org/cmake/help/consulting.html<br />
CMake Training Courses: http://cmake.org/cmake/help/training.html<br />
<br />
Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html<br />
<br />
Follow this link to subscribe/unsubscribe:<br />
https://cmake.org/mailman/listinfo/cmake<br /></blockquote>
<div></div>
</div>
</body>
</html>