> -----Original Message-----
> From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On
> Behalf Of Pere Mato Vila
> Sent: Sonntag, 27. Februar 2011 22:38
> To: cmake@cmake.org
> Subject: [CMake] Is there an elegant way to get list of object files
> participating into a library?
> 
> Hi,
> 
>   For the Windows platform  I am generating the .DEF files with all
defined
> symbols to be exported.  For this  I need to get the list of all object
files (.obj)
> participating into a library. 

Are you trying to export all symbols from a shared library, something that
emulates Unix linkers behavior  (Microsoft  linker has no option for it=?

If it is so, then you can create a static library first. Then  add custom
command that e.g runs dumpbin  with you static library to extract symbols
and produces .DEF (for example using a script like this one
http://kenai.com/projects/mysql-jvm/sources/source/content/win/create_def_fi
le.js?rev=25 ). Finally, to produce DLL,  use a  dummy source file , and
your generated .DEF and link the DLL to the static library, like

ADD_LIBRARY(mydll SHARED dummy.c generated.def)
TARGET_LINK_LIBRARIES(mydll staticlib)

Vladislav

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to