[CMake] Sub dependencies?

Andreas Pakulat apaku at gmx.de
Fri Aug 12 05:13:47 EDT 2011


On 12.08.11 16:48:09, Doug wrote:
> why?
> 
> I've invoked:
> 
> find_package(liba REQUIRED)
> 
> not:
> 
> find_package(libpng REQUIRED)
> 
> My application has no knowledge about libpng, or libjpg or whatever the heck
> else liba uses to load images.

I might have misinterpreted what you wrote so far, but if your
executable links only against liba and only uses symbols from liba then
indeed you won't need to link against libpng. However the linker errors
you posted initially indicated otherwise, since the linker seemed to
need libpng symbols when linking your executable. This means one of the
object files or static libraries of your executable uses symbols from
libpng, which means the executable needs to link against libpng.

Andreas



More information about the CMake mailing list