When creating a static library, you can still use the function
"target_link_libraries" even though the static library is never linked, as
such.  What you're doing is creating a dependency record for cmake so that
target_link_libraries of a static library are included in a link of some
other target which depends on the static library.  What seems confusing is
that target_link_libraries accepts the keywords PUBLIC and PRIVATE as well
as INTERFACE when used with a static library, since only INTERFACE really
makes sense in this context.

Would it be beneficial to issue a warning when someone uses PUBLIC or
PRIVATE with target_link_libraries on a static library to make it clear
that they may not be understanding what's going on?

Andrew Bell

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 

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 

Follow this link to subscribe/unsubscribe:

Reply via email to