[CMake] link static lib to dll

Micha Renner Micha.Renner at t-online.de
Tue Feb 9 05:05:40 EST 2010


A DLL-library is linked to static library. 
The structure of the project is this:

main-project 
	+--------- Project STATIC
	|
	+--------- Project DLL

This works very well.
But if I include the following export part to the project of the DLL...

INSTALL(TARGETS T-DLL EXPORT T-DLLExport 
		RUNTIME DESTINATION dll		
		LIBRARY DESTINATION lib
	 	ARCHIVE DESTINATION lib)
INSTALL(EXPORT T-DLLExport DESTINATION lib/${T-DLL})

... CMake generates the message: "CMake Error: INSTALL(EXPORT
"TLIBExport" ...) includes target "T-DLL" which requires target
"T-Static" that is not in the export set."

This is unexpected. I don't want export the static library because it is
already linked to the DLL and it is used only by the DLL.

Micha






More information about the CMake mailing list