[CMake] How to inform the linker of segment properties

Rolf Eike Beer eike at sf-mail.de
Tue Dec 14 06:57:32 EST 2010


> I am building a Windows DLL that has some of its global variables
> allocated in a special shared memory segment.
> 
> In order to inform the linker (VS Express 2008) about the segment's
> properties, I need to provide the following command-line parameter to the
> linker:
> 
> /SECTION:.shared,RWS
> 
> 
> Could anyone advise me of the recommended way to tell cmake to configure
> VS Express 2008 to use this command-line parameter?
> 
> 
> Currently, in my cmake file, I have a line like:
> 
> set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}
> /SECTION:.shared,RWS")
> 
> but it appears to have no effect on the linker configuration in VS
> Express 2008.

Try SET_TARGET_PROPERTES(mydll PROPERTIES LINK_FLAGS /SECTION...)

Eike


More information about the CMake mailing list