[CMake] [Q] LINK_INTERFACE_LIBRARIES and the like

Michael Wild themiwi at gmail.com
Tue Dec 22 10:22:55 EST 2009


On 22. Dec, 2009, at 15:52 , Marcel Loose wrote:

> Hi all,
> 
> After reading, re-reading, and re-re-reading the manual, I still don't
> really get the concept of LINK_INTERFACE_LIBRARIES, 
> IMPORTED_LINK_DEPENDENT_LIBRARIES, and
> IMPORTED_LINK_INTERFACE_LIBRARIES. Is this mostly Windows-specific, or
> does it also apply for Linux?
> 
> Best regards,
> Marcel Loose.
> 

LINK_INTERFACE_LIBRARIES is a property you can set if you want to override the set of libraries that appear in the link-interface of one of your own libraries.

IMPORTED_LINK_INTERFACE_LIBRARIES is the same for IMPORTED targets. E.g. suppose you have this:

add_library(foo ${FOO_SRCS})
target_link_libraries(foo bar)
install(EXPORT ${PROJECT_NAME}Dependencies DESTINATION <somewhere>)

The created <somewhere>/${PROJECT_NAME}Dependencies.cmake file will list "bar" in the LINK_INTERFACE_LIBRARIES of "foo". This property is essentially a copy of LINK_INTERFACE_LIBRARIES property of "foo" in the build tree (if it is defined).


IMPORTED_LINK_DEPENDENT_LIBRARIES is AFAIK similar to IMPORTED_LINK_INTERFACE_LIBRARIES but refers to dependencies that are "implementation details".


HTH

Michael



More information about the CMake mailing list