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