<div dir="ltr">As of 2.8.12, you can set target properties on an imported library to specify its include directories, compile options etc, and these will be automatically propagated to any other target that links to it via target_link_libraries(). No more tedious faffing about with global variables like GTEST_INCLUDE_DIRS, GTEST_LIBRARIES etc. It's really quite nice.<div>
<br></div><div style>Check the 2.8.12 CMake docs for target properties that start with "INTERFACE".</div><div><br></div><div>Nick</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 19 October 2013 08:59, Magnus Therning <span dir="ltr"><<a href="mailto:magnus@therning.org" target="_blank">magnus@therning.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Sat, Oct 19, 2013 at 11:28:53AM +0400, Игорь Пашев wrote:<br>
> 2013/10/19 Magnus Therning <<a href="mailto:magnus@therning.org">magnus@therning.org</a>>:<br>
> > Is it possible to put the include path in some property on the library<br>
> > as well, to avoid using a separate variable for that?<br>
><br>
> SET_TARGET_PROPERTIES (target PROPERTIES <VARIABLE-NAME> <VARIABLE-VALUE>)<br>
<br>
</div>Of course, but then how do I use it conveniently?<br>
<br>
Would it be possible, by choosing a good property name, to simply do<br>
<br>
target_include_directories(one_test PRIVATE<br>
target<br>
)<br>
<br>
Or would I have to<br>
<br>
get_target_property(INC_DIR target <variable-name>)<br>
target_include_directories(one_test PRIVATE<br>
${INC_DIR}<br>
)<br>
<br>
in which case using a property wouldn't give me very much.<br>
<div class="im"><br>
/M<br>
<br>
--<br>
Magnus Therning OpenPGP: 0xAB4DFBA4<br>
email: <a href="mailto:magnus@therning.org">magnus@therning.org</a> jabber: <a href="mailto:magnus@therning.org">magnus@therning.org</a><br>
twitter: magthe <a href="http://therning.org/magnus" target="_blank">http://therning.org/magnus</a><br>
<br>
</div>The British have "the perfect temperament to be hackers--technically<br>
skilled, slightly disrespectful of authority, and just a touch of<br>
criminal behavior".<br>
-- Mary Ann Davidson, Oracle's Security Chief<br>
<br>--<br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br></div>