[CMake] INSTALL(EXPORT) does not honor LINK_INTERFACE_LIBRARIES?

Rolf Eike Beer eike at sf-mail.de
Mon Mar 28 08:51:02 EDT 2011


I try to do an INSTALL(EXPORT) to allow others to link against one of my
libraries. That libraries is linked against some other internal libraries
the target's don't need to link to as everything in them is purely
internal.

I tried something like that:

ADD_LIBRARY(publiclib SHARED 	${publiclib_SOURCES})

TARGET_LINK_LIBRARIES(publiclib privatelib)

SET_TARGET_PROPERTIES(publiclib PROPERTIES LINK_INTERFACE_LIBRARIES "")

INSTALL(TARGETS publiclib
			EXPORT publiclib_export
			RUNTIME DESTINATION bin
			LIBRARY DESTINATION lib
			ARCHIVE DESTINATION lib)

INSTALL(EXPORT publiclib_export DESTINATION cmake/modules)

This results in:

Make Error: INSTALL(EXPORT "publiclib_export" ...) includes target
"publiclib" which requires target "privatelib" that is not in the export
set.

Ehm, no, it doesn't? Is this intentional (why?), is there a workaround or
should I file a bug report?

Eike


More information about the CMake mailing list