<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hej,</div><div class=""><br class=""></div><div class="">Did you notice this one?</div><div class=""><a href="https://public.kitware.com/Bug/bug_relationship_graph.php?bug_id=14778&graph=relation" class="">https://public.kitware.com/Bug/bug_relationship_graph.php?bug_id=14778&graph=relation</a></div><div class=""><br class=""></div><div class="">Also, since you’re asking about a ‘why’, you could check out this thread:</div><div class=""><a href="http://public.kitware.com/pipermail/cmake-developers/2015-February/024518.html" class="">http://public.kitware.com/pipermail/cmake-developers/2015-February/024518.html</a></div><div class=""><br class=""></div><div class="">The less involved option would be to do exactly what you mention you don’t want. You don’t mention why you don’t want to create a separate library though, which may be of importance to guess a different solution.</div><div class=""><br class=""></div><div class="">Sincerely, Jakob</div><br class=""><div><blockquote type="cite" class=""><div class="">On 09 Sep 2015, at 15:02, Daniel Wirtz <<a href="mailto:daniel.wirtz@simtech.uni-stuttgart.de" class="">daniel.wirtz@simtech.uni-stuttgart.de</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">Hey all,<br class=""><br class="">i've been wondering why CMake (3.3.+) yells at me if i want to add link libraries to an OBJECT target.<br class="">Consider the scenario<br class=""><br class="">find_package(package_with_bar_target)<br class=""><br class="">add_library(foo OBJECT ${foo_src})<br class=""><br class=""># Would like to write<br class=""><br class=""># target_link_libraries(foo bar)<br class=""><br class=""># But have to use<br class=""><br class="">target_include_directories(foo PRIVATE $<TARGET_PROPERTY:bar,INTERFACE_INCLUDE_DIRECTORIES>)<br class=""><br class=""><br class="">I know that intuitively "link library" is something different than "include directory". but one of the nice things<br class="">of cmake is that it automatically sorts out everything for you when you specify link libraries.<br class="">if there are more bar-dependent properties that need to be set in order to successfully compile foo (e.g. compile flags),<br class="">i have to literally re-write all the nice internal cmake logic to establish the compile environment of bar for foo.<br class=""><br class="">what's the plan with that? or are there any other (less involved) solutions? i need the objects of foo inside a larger<br class="">target and want to avoid having a separate library being build that needs extra linking.<br class=""><br class="">cheers!<br class=""><br class="">-- <br class="">Dr. Daniel Wirtz<br class="">Dipl. Math. Dipl. Inf.<br class="">SRC SimTech<br class="">Pfaffenwaldring 5a<br class="">+49 711 685 60044<br class=""><br class="">-- <br class=""><br class="">Powered by <a href="http://www.kitware.com" class="">www.kitware.com</a><br class=""><br class="">Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" class="">http://www.cmake.org/Wiki/CMake_FAQ</a><br class=""><br class="">Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br class=""><br class="">CMake Support: <a href="http://cmake.org/cmake/help/support.html" class="">http://cmake.org/cmake/help/support.html</a><br class="">CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" class="">http://cmake.org/cmake/help/consulting.html</a><br class="">CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" class="">http://cmake.org/cmake/help/training.html</a><br class=""><br class="">Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" class="">http://www.kitware.com/opensource/opensource.html</a><br class=""><br class="">Follow this link to subscribe/unsubscribe:<br class=""><a href="http://public.kitware.com/mailman/listinfo/cmake" class="">http://public.kitware.com/mailman/listinfo/cmake</a><br class=""></div></blockquote></div><br class=""></body></html>