[CMake] Determine dependency between targets

Jörg Kreuzberger j.kreuzberger at procitec.de
Wed Jul 16 11:37:06 EDT 2014


Hi!

i am looking for a way to determine REAL LINKER dependencies between an application and static libraries for use with gcc.

the include dependencies and cmake dependencies are quite good to determine.

For the linker is more or less the question, against which libraries i should link. This is done more or less by "try and error".

eg. app depends on lib2. This lib depends on lib1.
so in cmake i would link against lib2 and lib1

ok, so i add a dependency (target_link_libraries( lib2 lib1) and link app only agains lib2.

But if the link dependency changes ( lib2 does not require to link against lib1 any more), how can i detect it to remove the target_link_libraries( .. ) entry from lib2 ?

Or the other way around, if i use only PARTS of lib2 that does not require to link to lib1 (stripping -ffunctions-sections), how can i determine that?

Greetz,
Joerg

Mannheim HRB 504702
Geschäftsführer: Dipl.-Ing. (FH) Michael Brenk (Vorsitzender), Dipl.-Ing. (FH) Dipl.-Inf. (FH) Jens Heyen

This e-mail may contain confidential and/or legally protected information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this email is strictly forbidden.
Thank you!




More information about the CMake mailing list