On Mon, Dec 12, 2011 at 3:15 PM, Robert Dailey <rcdai...@gmail.com> wrote:
> On Mon, Dec 12, 2011 at 2:13 PM, Robert Dailey <rcdai...@gmail.com> wrote:
>>
>> On Mon, Dec 12, 2011 at 2:10 PM, David Cole <david.c...@kitware.com>
>> wrote:
>>>
>>> Apparently, they are undocumented, but there are also:
>>>
>>> CMAKE_SHARED_LINKER_FLAGS and CMAKE_MODULE_LINKER_FLAGS (and their
>>> per-config variants) for SHARED and MODULE library targets as well.
>>>
>>> Use CMAKE_SHARED_LINKER_FLAGS instead.
>>
>>
>> Thanks for the information guys. I'm having a minor problem with these
>> variables though.
>>
>> Here is how I use it:
>>
>> set( CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS}
>> /NODEFAULTLIB:\"${lib}\" )
>>
>> Prior to calling the set above, the shared linker flags look like this:
>>
>>  /STACK:10000000 /machine:X86
>>
>> After calling the set above, it looks like this:
>>
>>   /STACK:10000000 /machine:X86 ;/NODEFAULTLIB:"LIBC"
>>
>> For some reason a semi-colon is being inserted prior to the /NODEFAULTLIB
>> part. I don't know why this is happening but visual studio is complaining
>> about it. Any reason why this is happening? Thanks.
>
>
> Actually I just realized it is probably putting the semi-colon there because
> it thinks I'm trying to create a list. I guess I need to create a temp
> variable and call list(APPEND) on it first, then set
> CMAKE_SHARED_LINKER_FLAGS to the temp list variable? Kind of messy...

These are space separated in the final value, and passed to the linker
as is, so you should set it like this:

set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}
/NODEFAULTLIB:\"${lib}\"" )

(Double-quote the whole thing, so the space is embedded in the string,
rather than used by cmake as an argument separator for the set
command.)


HTH,
David
--

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