[CMake] Initial C# support (was Re: Adding support for new languages to CMake)

Mathieu Malaterre mathieu.malaterre at gmail.com
Mon Oct 20 05:46:59 EDT 2008


Just FYI,

On Mon, Oct 20, 2008 at 11:30 AM, Mathieu Malaterre
<mathieu.malaterre at gmail.com> wrote:
> On Fri, Oct 17, 2008 at 7:00 PM, Alexander Neundorf
> <a.neundorf-work at gmx.net> wrote:
>> On Friday 17 October 2008, Mathieu Malaterre wrote:
>> ...
>>> Quick question, here is how one create executable in C#:
>>>
>>>   SET(CMAKE_CSharp_LINK_EXECUTABLE
>>>     "<CMAKE_CSharp_COMPILER> <FLAGS> <OBJECTS> -out:<TARGET>.exe
>>> <LINK_LIBRARIES>")
>>>
>>> The problem here is that i need to prepend each added libary using
>>> "/r" , I could not figure out which flag dictate that (for now
>>> <LINK_LIBRARIES> expand to 'foo.dll', while I need '/r:foo.dll').
>>
>> Not sure, but did you set CMAKE_LINK_LIBRARY_FLAG ?
>
> My current solution is to use:
>
> CMAKE_LINK_LIBRARY_FILE_FLAG
>
> However it always add a space, which is not ideal for my case (but
> works for mono implementation).
>

CMAKE_LINK_LIBRARY_FLAG is only used in :
cmComputeLinkInformation::AddUserItem.

Which is not used in:

ADD_LIBRARY(foo SHARED foo.c)
ADD_EXECUTABLE(bla bla.c)
TARGET_LINK_LIBRARIES(bla foo) # foo is a the name of a CMake target

2cts
-- 
Mathieu


More information about the CMake mailing list