<div dir="ltr">This seems to do what I want.<div><br></div><div>Is there a version of this that works for IMPORTED targets.</div><div><br></div><div>There&#39;s <b style="color:rgb(0,0,0);font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px;line-height:22px;text-align:justify"><code>IMPORTED_LINK_INTERFACE_LIBRARIES</code></b>, but I&#39;m not sure how to make them private for static libraries.</div>

<div><br></div><div>Thanks,</div><div>James</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Oct 16, 2013 at 12:17 PM, Robert Maynard <span dir="ltr">&lt;<a href="mailto:robert.maynard@kitware.com" target="_blank">robert.maynard@kitware.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Have you tried using the LINK_PRIVATE signature to target link libraries?<br>
<div class="HOEnZb"><div class="h5"><br>
On Wed, Oct 16, 2013 at 2:05 PM, James Bigler &lt;<a href="mailto:jamesbigler@gmail.com">jamesbigler@gmail.com</a>&gt; wrote:<br>
&gt; Is it possible to stop known static libraries from being carried through<br>
&gt; shared libraries?<br>
&gt;<br>
&gt; add_library(mystatic1 STATIC ...)<br>
&gt; add_library(mystatic2 STATIC ...)<br>
&gt; add_library(myshared SHARED ...)<br>
&gt; target_link_libraries(myshared mystatic1 mystatic2)<br>
&gt; add_executable(myexe)<br>
&gt; target_link_libraries(myexe myshared)<br>
&gt;<br>
&gt; Once a shared library is created, all the information about what libraries<br>
&gt; are needed should be encoded in the shared library.  In addition if myexe<br>
&gt; links against only myshared then only the symbols being exported by myshared<br>
&gt; should be visible to myexe.<br>
&gt;<br>
&gt; I&#39;m seeing problems where symbols from mystatic1 are being seen by myexe,<br>
&gt; when myexe should only be seeing symbols from myshared.  This is because<br>
&gt; CMake links myshared, mystatic1, and mystatic2 to myexe all in the same link<br>
&gt; line.<br>
&gt;<br>
&gt; James<br>
&gt;<br>
</div></div><div class="HOEnZb"><div class="h5">&gt; --<br>
&gt;<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the CMake FAQ at:<br>
&gt; <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
&gt;<br>
&gt; Kitware offers various services to support the CMake community. For more<br>
&gt; information on each offering, please visit:<br>
&gt;<br>
&gt; CMake Support: <a href="http://cmake.org/cmake/help/support.html" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
&gt; CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
&gt; CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</div></div></blockquote></div><br></div></div>