Hi all,

considering the following CMakeLists.txt:

PROJECT(lib_foo)
ADD_LIBRARY(lib_foo SHARED <src>)
TARGET_INCLUDE_DIRECTORIES(PRIVATE private/ PUBLIC inc/)
FIND_PACKAGE(Boost 1.55 REQUIRED COMPONENTS chrono system)
TARGET_LINK_LIBRARIES(lib_foo PRIVATE Boost::chrono Boost::system)
GET_TARGET_PROPERTIES(tinc lib_foo INCLUDE_DIRECTORIES)
MESSAGE(STATUS "Include dirs: ${tinc}")

I would expect a message with my private/ and inc/ paths, plus the one that
comes with the Boost libraries, instead I only get the directories
specified in TARGET_INCLUDE_DIRECTORIES. The manpage of
TARGET_LINK_LIBRARIES says:
PRIVATE and PUBLIC items will populate the INCLUDE_DIRECTORIES
<https://cmake.org/cmake/help/v3.13/prop_tgt/INCLUDE_DIRECTORIES.html#prop_tgt:INCLUDE_DIRECTORIES>
property of <target>.

If I print Boost_INCLUDE_DIR I found the inclusion path.

Am I missing something?

Thanks,
Gabriele
-- 

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:
https://cmake.org/mailman/listinfo/cmake

Reply via email to