[CMake] Chaining Dependencies

Bill Hoffman bill.hoffman at kitware.com
Wed May 19 14:46:10 EDT 2010


On 5/19/2010 2:31 PM, aaron.meadows at thomsonreuters.com wrote:
> *Hi all.  I hope this isn’t a terribly obvious question that I just
> can’t find in the documentation..*
>
> * *
>
> *If I have an executable ‘A’ that depends on a static library ‘B’, and
> static library ‘B’ depends on static library ‘C’, can I capture this
> dependency as part of the CMakeLists.txt for static library ‘B’, and
> have it picked up by the CMakeLists.txt for executable ‘A’?*
>
> * *
>
> *What I want to avoid is needing to know the complete dependencies in
> executable ‘A’ beyond what it directly depends on (static library ‘B’).*
>

target_link_libraries(B C)

target_link_libraries(A B)  # this will linke C into A.

-Bill




More information about the CMake mailing list