Re: [CMake] Using target_link_libraries INTERFACE with static libraries

2017-06-01 Thread Luis Caro Campos
Hi Mario, Eureka! I had glanced through that explanation in the past, however, I missed this key piece of information: "For this reason, when A links in B as PRIVATE and another target C links in A, CMake will still add B to the list of libraries to be linked for C because parts of B are needed b

Re: [CMake] Using target_link_libraries INTERFACE with static libraries

2017-06-01 Thread Mario Werner
Hi Luis, as you correctly concluded, if 'Foo' is not part of the public interface of 'Bar', then the PRIVATE is the correct specifier. However, you don't have to add 'Foo' to the consumers of 'Bar' (e.g., 'MyApp'). If everything works as expected, CMake automatically tracks the link dependency fr

[CMake] Using target_link_libraries INTERFACE with static libraries

2017-06-01 Thread Luis Caro Campos
I have the following scenario where I have 2 static libraries, where one uses symbols from the other, and the executable needs to link against both in order to build properly. Library 'Bar' uses symbols from library 'Foo' internally, but 'Foo' is not part of the "interface" of Bar, i.e., the calli