[CMake] Difference between PRIVATE and PUBLIC with target_link_libraries

Patrick Boettcher patrick.boettcher at posteo.de
Thu May 12 09:59:53 EDT 2016


On Thu, 12 May 2016 08:47:33 -0500
iosif neitzke <iosif.neitzke+cmake at gmail.com> wrote:

> My reading of your examples:
> 
> exe1 gets linked to lib2, and lib2/bin is included.  exe1 probably
> won't link ultimately because lib2 may need symbols from lib1.
> Depends on the structure of the C code between lib2 and lib1.   See
> John Lakos for further information on that.

It links - because it is a STATIC library - so propagated even though
it's PRIVATE.

My problem is just the include-dir of lib1 (/tmp) which should _not_ be
propagated to exe1, but it is propagated. 

regards,
--
Patrick.


More information about the CMake mailing list