[CMake] library export .lib .map

Philip Lowman philip at yhbt.com
Fri Sep 5 22:12:47 EDT 2008


On Mon, Sep 1, 2008 at 3:27 AM, Ingrid Kemgoum <ingrid.kemgoum at gmail.com>wrote:

> hi,
> i'm trying to export only some functions of a library with cmake
> i know with windows we use *__declspec(dllimport)* and *
> __declspec(dllexport)*  to generate the appropriate .lib of the dll
> is there a manner of generating the .map ?
>

Just specify the MSVC linking flag to generate map files using
SET_TARGET_PROPERTIES and the .map file should be generated.  Usually the
more popular options in the Visual Studio GUI have command line options
listed right next to them.

Incidentally, CMake doesn't have "/MAP" in it's list of understood VS flags
so it will show up under the Additional Linking Flags section of the Linker
properties and not where you're probably used to seeing it.

==============
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(foo)
ADD_LIBRARY(foo SHARED foo.cc)
IF(MSVC)
   SET_TARGET_PROPERTIES(foo PROPERTIES LINK_FLAGS "/MAP")
ENDIF()

-- 
Philip Lowman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080905/15f43433/attachment.htm>


More information about the CMake mailing list