[Cmake] How do I link a static library into a library

Stuart MacKay smackay at flagstonesoftware.com
Thu, 22 Apr 2004 09:30:11 -0700


Thanks for the info - now that I am a bit more familiar with CMake I 
"think" I can now phrase my question a bit more constructively ;-)

It appears that using the TARGET_LINK_LIBRARY command will not work 
when building a static library:

ADD_LIBRARY(${LIB} ${LIBRARY_TYPE} ${SRCS})
TARGET_LINK_LIBRARY(${LIB} ${ZLIB})

Looking at the makefile generated the library dependency is not 
"honoured":

lib_DEPEND_LIBS =

I cannot find a way to get this variable set - I've trawled through the 
archives and I have seen this mentioned but no solution was offered 
other than it might be a feature/bug. Is there another way to link the 
library into the code that requires it ?

I only have one C++ class which uses the zlib code internally and I 
don't need to merge the libraries together in a single package.

The only way I can get the libraries to link is to wait until building 
the final application - is this a restriction in order to get CMake to 
be a cross platform tool ?

Thanks in advance,

Stuart
--
Stuart MacKay, Seattle, WA, USA