<div>I see.</div><div><br></div>I&#39;ve tried this approach and I get the error:<div><div>-- Found LIBPNG</div><div>CMake Error at CMakeLists.txt:49 (export):</div><div>  export given target &quot;/usr/lib/libpng.so&quot; which is not built by this</div>
<div>  project.</div><div><br></div><div><br></div><div>-- Configuring incomplete, errors occurred!</div></div><div><br></div><div>~</div><div>Doug.<br><br><div class="gmail_quote">On Fri, Aug 12, 2011 at 4:57 PM, Michael Wild <span dir="ltr">&lt;<a href="mailto:themiwi@gmail.com">themiwi@gmail.com</a>&gt;</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 Fri 12 Aug 2011 10:49:45 AM CEST, Doug wrote:<br>
&gt; I&#39;m sorry if I&#39;m being dumb here, but I fail to see how that helps.<br>
&gt;<br>
&gt; That example is one where foobar depends explicitly on foo and bar.<br>
&gt;<br>
&gt; What if foo depends on bar2?<br>
&gt;<br>
&gt; How do I inherit that dependency from foo in foobar?<br>
&gt;<br>
&gt; _that&#39;s_ what I&#39;m looking for.<br>
&gt;<br>
&gt; (If that example somehow explains that, I&#39;m sorry, I can&#39;t see it. Can<br>
&gt; you point to a specific point in the page?)<br>
&gt;<br>
&gt; ~<br>
&gt; Doug.<br>
&gt;<br>
&gt; On Fri, Aug 12, 2011 at 2:34 PM, Michael Wild &lt;<a href="mailto:themiwi@gmail.com">themiwi@gmail.com</a><br>
</div><div class="im">&gt; &lt;mailto:<a href="mailto:themiwi@gmail.com">themiwi@gmail.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     If the projects are independent, you might want to take a look at this<br>
&gt;     Wiki page:<br>
&gt;     <a href="http://www.cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file" target="_blank">http://www.cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file</a>.<br>
&gt;<br>
&gt;     HTH<br>
&gt;<br>
&gt;     Michael<br>
&gt;<br>
<br>
</div>And that is what the example is *about*. The FooBar project *exports*<br>
its targets, along with their dependencies, so that when other projects<br>
do find_package(FooBar), they will be able to link against the foo<br>
library without having to know any of the dependencies of it. E.g. the<br>
project &quot;hello&quot; might look like this:<br>
<br>
project(hello)<br>
find_package(FooBar REQUIRED)<br>
include_directories(${FOOBAR_INCLUDE_DIRS})<br>
add_executable(hello hello.c)<br>
target_link_libraries(hello ${FOOBAR_LIBRARIES})<br>
<font color="#888888"><br>
<br>
Michael<br>
</font></blockquote></div><br></div>