LINK_PUBLIC
: makes transitive dependencies of the currently linked target visible to other targets which are going to be linked against the current one. So lib1
and lib2
will be linked along with my_library
when my_library
is linked against something else.
LINK_PRIVATE
: makes transitive dependencies of the currently linked target invisible to other targets which are going to be linked against the current one. So lib1
and lib2
will not be linked along with my_library
when my_library
is linked against something else.
To conclude, when some_other_library
will be linked against something else, its dependencies will not be seen to those targets it is linked against because of the final LINK_PRIVATE
.