Hrm... this seems like something cmake should be able to do, but I don't know how to make it work.<div><br></div><div>If I have library A, that depends on a library and an executable project that depends on library A, how can the executable project resolve the sub dependencies from A?</div>
<div><br></div><div>Specifically libpng in my case:</div><div><br></div><div>I have a library that depends on libpng.</div><div><br></div><div>I run cmake to build the library no problem.</div><div><br></div><div>Then I try to compile a program that depends on the library and get a heap of errors like:</div>
<div><br></div><div><div> undefined reference to `png_set_read_fn'</div></div><div> etc. etc.</div><div><br></div><div>Presumably this is something about how I depend on the library? I'm using the LibFindMacros, so my cmake module looks like this for the library:</div>
<div><br></div><div><div>include(LibFindMacros)</div><div><br></div><div>find_path(LIBNW_INCLUDE_DIR NAMES nw.h PATHS ${LIBNW_PKGCONF_INCLUDE_DIRS})</div><div><br></div><div>find_library(LIBNW_LIBRARY NAMES nw PATHS ${LIBNW_PKGCONF_LIBRARY_DIRS})</div>
<div><br></div><div>set(LIBNW_PROCESS_INCLUDES LIBNW_INCLUDE_DIR)</div><div>set(LIBNW_PROCESS_LIBS LIBNW_LIBRARY LIBNW_LIBRARIES)</div><div><br></div><div>libfind_process(LIBNW)</div></div><div><br></div><div> I know I can use ADD_SUBDIRECTORY to include stuff for a sub dir, but that isn't really appropriate in this case.</div>
<div><br></div><div>~</div><div>Doug.</div>