[CMake] Problem with target_link_libraries

Tyler Roscoe tyler at cryptio.net
Fri May 8 13:51:33 EDT 2009


On Fri, May 08, 2009 at 07:25:04PM +0200, Benoit wrote:
> And i don't know why it link also with the static library
> ..\3rdparty\lib\liblibjpeg.a ..\3rdparty\lib\libtinyxml.a because they have
> already been linked in ..\x7s\src\x7scv\libx7scv.dll.a
> ..\x7s\src\x7sxml\libx7sxml.dll.a

By default, CMake handles transitive linking. That is, if A links to B
and B links to C, then CMake knows that A must also link to C. This is
true for shared libraries. I'm not sure how having static libraries in
the mix affects this situation, but I suspect that's why the jpeg
library is showing up.

I'm also a little puzzled by your filenames. Is your jpeg library really
called "liblibjpeg"? That seems weird. Also, are these .dll.a static
libraries? That's an unusual naming convention.

tyler


More information about the CMake mailing list