[CMake] Question about transitive dependencies

Robert Dailey rcdailey at gmail.com
Thu Dec 4 16:25:56 EST 2008


Hi,

Currently I have 3 projects named A, B, and C. A and B are both static
libraries, and C is an executable. B depends on A, and C depends on B via
add_dependencies(). When I generate a visual studio 9 project from this
setup, how will the libraries be linked? The way I want this to work is for
C to link against both A and B, and B will not link against A (Since B's
dependencies should transfer to C). Is there a way to accomplish this
behavior? I want to avoid using target_link_libraries for the most part
because it's redundant. I'm already specifying B as a dependency of C
through add_dependency(), why should I have to list B's static library file
as a dependency of C's executable? Can't CMake pull this information from
the call to add_dependency()?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20081204/98cdb726/attachment.htm>


More information about the CMake mailing list