AW: [CMake] how to use CMAKE_LINK_DEF_FILE_FLAG

Gerhard Grimm ggrimm at detec.de
Thu Oct 25 12:59:07 EDT 2007


Hi Cees,
 
simply add the .def file to your sources in the ADD_LIBRARY command:
 
ADD_LIBRARY(Test SHARED InProcServer.cc dll.def)
 
Worked for me in a similar case.
 
Best regards, Gerhard

-----Ursprüngliche Nachricht-----
Von: cmake-bounces+ggrimm=detec.de at cmake.org [mailto:cmake-bounces+ggrimm=detec.de at cmake.org]Im Auftrag von Cees Wesseling
Gesendet: Donnerstag, 25. Oktober 2007 18:36
An: cmake at cmake.org
Betreff: [CMake] how to use CMAKE_LINK_DEF_FILE_FLAG



I am trying to build a C++ Windows dll that must use a linker definition file with the exports using cmake version 2.4-patch 7 for Visual Studio 2005 in nmake Makefile mode.

 

What I have tried is the following bare CMakeLists.txt:

 

SET (CMAKE_LINK_DEF_FILE_FLAG "/DEF:dll.def")

ADD_LIBRARY(Test

  SHARED

  InProcServer.cc

)

 

The dll builds fine, but has no entry points. In the resulting Makefile I do not find any mentioning of the DEF linker flag. And from inspecting Modules/Platform/Windows-cl.cmake of the cmake distro I am getting suspicious if the CMAKE_LINK_DEF_FILE_FLAG is ever rolled into the link options.

 

Am I overlooking something obvious? Is there another way to push this flag into the link options?

 

Thanks, Cees

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20071025/22c5ea38/attachment.html


More information about the CMake mailing list