[CMake] CMake and def files

Totte Karlsson totte at dunescientific.com
Sun Jan 5 15:12:30 EST 2014


Thanks Nils,

>>
> Just listing a .def file in the sources for a target worked for me 
> (using the Microsoft compiler).
>
Does not work here, not sure why.

> Are you using one of the Makefile generators?
>
> In those CMAKE_LINK_DEF_FILE_FLAG seems to be used to handle .def 
> source files.
> For the Microsoft compiler this is defined as such:
>     set (CMAKE_LINK_DEF_FILE_FLAG "/DEF:")
>
> For Borland I don't see any such definition (but I am not really 
> familiar with the Borland setup either).

That is maybe why it is not working?

>
> Your workaround with CMAKE_MODULE_LINKER_FLAGS I expect can only work 
> if you used add_library(foo MODULE) rather than add_library(foo SHARED).
> For the later you would have to set CMAKE_SHARED_LINKER_FLAGS.
>
Yes, this is a MODULE, no import library present. The DLL is supposed to 
be loaded dynamically at runtime, (its a plugin). So the caller need to 
find proper names in the DLL.
I'll post to Borland ng to see ig anyonw have experience with this.
tk



More information about the CMake mailing list