[CMake] Install Export and include

Nicola Brisotto nicolabrisotto at gmail.com
Thu Apr 22 08:44:10 EDT 2010


Hi,
I'm building a library QXmppClient that export properties with INSTALL (EXPORT ...)
How can I also export a variable with the include path of the library?

In the executable project I use find_package(QXmppClient). The target QXmppClient is imported so I can link with:
TARGET_LINK_LIBRARIES(myexecutable QXmppClient  )

This is a snippet from the QXmppClient CMakeLists.txt:

ADD_LIBRARY(QXmppClient ${SRC})
TARGET_LINK_LIBRARIES( QXmppClient ${LIB} )

INSTALL(TARGETS QXmppClient EXPORT QXmppClientConfig
	DESTINATION lib/QXmppClient )
INSTALL(FILES
	${Qt4_MOC}
	DESTINATION include/QXmppClient)
#Export Target into include dir
INSTALL(EXPORT QXmppClientConfig DESTINATION lib/QXmppClient )


Nicola Brisotto









More information about the CMake mailing list