[CMake] transitive dependencies (again)

Tom Kacvinsky tom.kacvinsky at vectorcast.com
Mon Dec 14 09:34:33 EST 2015


I am getting link errors because cmake is adding transitive
dependencies.  I am building a DLL which depends on a static archive
(and is marked as such with add_dependencies), but when I link an
executable that depends on the DLL, both libraries (import library for
the DLL and static archive) are specified on the link. leading to
duplicate symbol errors as the symbol are exported form the DLL and
defined in the static archive.

How do I work around this?  This is the one thing that has frustrated
me over the last couple of years - I have never received an answer
telling me how to turn off transitive dependencies.

Sorry for the minor rant.

Regards,

Tom


More information about the CMake mailing list