target_include_directories(lib1 INTERFACE /tmp) means /tmp is
propagated with lib1, but not used to build lib1.

"The INTERFACE, PUBLIC and PRIVATE keywords are required to specify
the scope of the following arguments. PRIVATE and PUBLIC items will
populate the INCLUDE_DIRECTORIES property of <target>. PUBLIC and
INTERFACE items will populate the INTERFACE_INCLUDE_DIRECTORIES
property of <target>."

https://cmake.org/cmake/help/v3.5/command/target_include_directories.html

On Thu, May 12, 2016 at 8:59 AM, Patrick Boettcher
<patrick.boettc...@posteo.de> wrote:
> On Thu, 12 May 2016 08:47:33 -0500
> iosif neitzke <iosif.neitzke+cm...@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.
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to