[CMake] Transitive Link Dependencies

Kevin Fitch kfitch42 at gmail.com
Wed Jul 14 11:51:03 EDT 2010

A.a is not intended to be a path. From my reading of the cmake book adding
.a is the way you say you specifically want the static library over the
dynamic library. To me libA.a would be a path.

So, you are saying that there is currently no way in cmake to get transitive
link dependencies AND specifically call out that you want to specifically
link against the static (or dynamic) version.


On Wed, Jul 14, 2010 at 9:13 AM, Michael Hertling <mhertling at online.de>wrote:

> On 07/14/2010 02:38 PM, Kevin Fitch wrote:
> > I have found a situation where transitive link dependencies don't seem to
> > work the way I would expect. I have a library A that depends on B. e.g.
> >
> > target_link_libraries(A B)
> > # and elsewhere we have ...
> > target_link_libraries(foo A)
> > #then B gets linked into foo as expected
> > #But, if I try to be more explicit in saying I want the static version of
> > A...
> > target_link_libraries(bar A.a)
> > # B does not get linked into bar ... :(
> >
> > Is this known/expected behavior, or is it a bug?
> Known/expected because "A.a" does not denote a target but a path, i.e.
> CMake links "bar" against the library file "A.a" but can't figure out
> any dependencies of the latter. With "target_link_libraries(foo A)",
> you link "foo" against a target "A", so CMake's dependency tracking
> applies and "B" is pulled in, too.
> Regards,
> Michael
> _______________________________________________
> Powered by www.kitware.com
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100714/8fcfc528/attachment.htm>

More information about the CMake mailing list