[CMake] Libraries for a Target and/or its Dependents
Wojciech Mamrak
wmamrak at gmail.com
Mon Sep 14 06:10:50 EDT 2015
Hello,
The docs say [1]:
"Libraries and targets following PRIVATE are linked to, but are not
made part of the link interface."
If so, why does this snippet:
add_library(private_lib STATIC ...)
add_library(public_lib STATIC ...)
target_link_libraries(Test PRIVATE private_lib
PUBLIC public_lib)
install(EXPORT ...)
sets Test's imported target's properties with:
IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE "private_lib;public_lib"
I thought BUILD_INTERFACE and INSTALL_INTERFACE generator expressions
can solve this, but it turns out BUILD_INTERFACE is propagated, and
INSTALL_INTERFACE is not, i.e.
IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE
"private_lib;public_lib;build_interface_lib"
regards
[1] http://www.cmake.org/cmake/help/v3.3/command/target_link_libraries.html#libraries-for-a-target-and-or-its-dependents
More information about the CMake
mailing list