<div>I see.</div><div><br></div>I'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 "/usr/lib/libpng.so" 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"><<a href="mailto:themiwi@gmail.com">themiwi@gmail.com</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 Fri 12 Aug 2011 10:49:45 AM CEST, Doug wrote:<br>
> I'm sorry if I'm being dumb here, but I fail to see how that helps.<br>
><br>
> That example is one where foobar depends explicitly on foo and bar.<br>
><br>
> What if foo depends on bar2?<br>
><br>
> How do I inherit that dependency from foo in foobar?<br>
><br>
> _that's_ what I'm looking for.<br>
><br>
> (If that example somehow explains that, I'm sorry, I can't see it. Can<br>
> you point to a specific point in the page?)<br>
><br>
> ~<br>
> Doug.<br>
><br>
> On Fri, Aug 12, 2011 at 2:34 PM, Michael Wild <<a href="mailto:themiwi@gmail.com">themiwi@gmail.com</a><br>
</div><div class="im">> <mailto:<a href="mailto:themiwi@gmail.com">themiwi@gmail.com</a>>> wrote:<br>
><br>
> If the projects are independent, you might want to take a look at this<br>
> Wiki page:<br>
> <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>
><br>
> HTH<br>
><br>
> Michael<br>
><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 "hello" 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>