[CMake] GenerateExportHeader for module library

Gregoire Aujay gaujay at movea.com
Fri Oct 26 13:26:24 EDT 2012


Hello,

I am doing my tests with visual 2008 and mingw.

As far as I understand a module is like a shared library that cannot be linked. Instead it is dynamically loaded and then we find and use symbols in it. It is like doing the linker's job manually at runtime.

If nothing is exported from my module then I do cannot find any symbol in it. Or at least I do not know how to do so.

I modified the GenerateExportHeader module to be able to export symbols from my MODULE:

  # if(${type} STREQUAL "MODULE")
    # message(WARNING "This macro should not be used with libraries of type MODULE")
    # return()
  # endif()
  if(NOT ${type} STREQUAL "STATIC_LIBRARY" AND NOT ${type} STREQUAL "SHARED_LIBRARY" AND NOT ${type} STREQUAL "MODULE_LIBRARY")
    message(WARNING "This macro can only be used with libraries")
    return()
  endif()


Regards,

Gregoire



-----Original Message-----
From: cmake-bounces at cmake.org [mailto:cmake-bounces at cmake.org] On Behalf Of Stephen Kelly
Sent: vendredi 26 octobre 2012 17:45
To: cmake at cmake.org
Subject: Re: [CMake] GenerateExportHeader for module library

Gregoire Aujay wrote:

> Hello,
> 
> I want to create a module with two symbols exported with visual:
> startPlugin
> stopPlugin
> 
> I wish I could use the convenient GENERATE_EXPORT_HEADER function to 
> do so. Is there any reason why the GENERATE_EXPORT_HEADER function is 
> disabled for the MODULE library type ?

When I wrote GenerateExportHeader, I didn't know of any reason to link to a MODULE. I thought MODULEs were always plugins to be loaded at runtime?

What does 'two symbols exported with visual' mean?

Thanks,

Steve.


--

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




More information about the CMake mailing list