[CMake] Sub dependencies?

Doug douglas.linder at gmail.com
Fri Aug 12 21:55:06 EDT 2011


I see.

I've tried this approach and I get the error:
-- Found LIBPNG
CMake Error at CMakeLists.txt:49 (export):
  export given target "/usr/lib/libpng.so" which is not built by this
  project.


-- Configuring incomplete, errors occurred!

~
Doug.

On Fri, Aug 12, 2011 at 4:57 PM, Michael Wild <themiwi at gmail.com> wrote:

> On Fri 12 Aug 2011 10:49:45 AM CEST, Doug wrote:
> > I'm sorry if I'm being dumb here, but I fail to see how that helps.
> >
> > That example is one where foobar depends explicitly on foo and bar.
> >
> > What if foo depends on bar2?
> >
> > How do I inherit that dependency from foo in foobar?
> >
> > _that's_ what I'm looking for.
> >
> > (If that example somehow explains that, I'm sorry, I can't see it. Can
> > you point to a specific point in the page?)
> >
> > ~
> > Doug.
> >
> > On Fri, Aug 12, 2011 at 2:34 PM, Michael Wild <themiwi at gmail.com
> > <mailto:themiwi at gmail.com>> wrote:
> >
> >     If the projects are independent, you might want to take a look at
> this
> >     Wiki page:
> >
> http://www.cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file
> .
> >
> >     HTH
> >
> >     Michael
> >
>
> And that is what the example is *about*. The FooBar project *exports*
> its targets, along with their dependencies, so that when other projects
> do find_package(FooBar), they will be able to link against the foo
> library without having to know any of the dependencies of it. E.g. the
> project "hello" might look like this:
>
> project(hello)
> find_package(FooBar REQUIRED)
> include_directories(${FOOBAR_INCLUDE_DIRS})
> add_executable(hello hello.c)
> target_link_libraries(hello ${FOOBAR_LIBRARIES})
>
>
> Michael
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110813/c02f38b2/attachment.htm>


More information about the CMake mailing list