<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;">Command target_link_libraries do not populate directly the properties of the target due to many constraints regarding the values given to the command (generator expressions, other targets, etc…).
<div><br /></div>
<div>The full contents is taken into account at generation time not at the configuration time. This is why you cannot get full information using command get_target_property which is evaluated at configuration time.</div>
</div>
<div name="messageReplySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">Le 21 déc. 2018 à 09:30 +0100, Ciccio Pasticcio <dodungocorporation@gmail.com>, a écrit :<br />
<blockquote type="cite" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #1abc9c;">
<div dir="ltr">
<div>Hi all,<br /></div>
<div><br /></div>
<div>considering the following CMakeLists.txt:</div>
<div><br /></div>
<div>PROJECT(lib_foo)</div>
<div>ADD_LIBRARY(lib_foo SHARED <src>)</div>
<div>TARGET_INCLUDE_DIRECTORIES(PRIVATE private/ PUBLIC inc/)<br /></div>
<div>FIND_PACKAGE(Boost 1.55 REQUIRED COMPONENTS chrono system)</div>
<div>TARGET_LINK_LIBRARIES(lib_foo PRIVATE Boost::chrono Boost::system)</div>
<div>GET_TARGET_PROPERTIES(tinc lib_foo INCLUDE_DIRECTORIES)<br /></div>
<div>MESSAGE(STATUS "Include dirs: ${tinc}")</div>
<div><br /></div>
<div>I would expect a message with my private/ and inc/ paths, plus the one that comes with the Boost libraries, instead I only get the directories specified in TARGET_INCLUDE_DIRECTORIES. The manpage of TARGET_LINK_LIBRARIES says:</div>
<div><code class="gmail-docutils gmail-literal gmail-notranslate"><span class="gmail-pre">PRIVATE</span></code> and <code class="gmail-docutils gmail-literal gmail-notranslate"><span class="gmail-pre">PUBLIC</span></code> items will populate the <span class="gmail-target" id="gmail-index-0-prop_tgt:INCLUDE_DIRECTORIES"></span><a class="gmail-reference gmail-internal" href="https://cmake.org/cmake/help/v3.13/prop_tgt/INCLUDE_DIRECTORIES.html#prop_tgt:INCLUDE_DIRECTORIES" title="INCLUDE_DIRECTORIES"><code class="gmail-xref gmail-cmake gmail-cmake-prop_tgt gmail-docutils gmail-literal gmail-notranslate"><span class="gmail-pre">INCLUDE_DIRECTORIES</span></code></a> property of <code class="gmail-docutils gmail-literal gmail-notranslate"><span class="gmail-pre"><target></span></code>.</div>
<div><br /></div>
<div>If I print Boost_INCLUDE_DIR I found the inclusion path.</div>
<div><br /></div>
<div>Am I missing something?</div>
<div><br /></div>
<div>Thanks,<br /></div>
<div>Gabriele<br /></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>