[CMake] Not sure how to list C# files in the generated Visual Studio project

David Cole david.cole at kitware.com
Mon Oct 3 10:23:11 EDT 2011


On Mon, Oct 3, 2011 at 10:22 AM, David Cole <david.cole at kitware.com> wrote:

> On Sat, Oct 1, 2011 at 4:08 PM, Stephen Torri <stephen.torri at gmail.com>wrote:
>
>> On Sat, 2011-10-01 at 13:50 -0400, David Cole wrote:
>> > On Mon, Sep 26, 2011 at 11:37 AM, Stephen Torri
>> > <stephen.torri at gmail.com> wrote:
>> >         I am using CMake to run SWIG to generate C# wrapper files for
>> >         a
>> >         project. While the attached CMakeLists.txt file produces a
>> >         Visual
>> >         Studio solutions that builds the C++ library, C# wrapper
>> >         library and
>> >         C# prototype executable I don't know first if I am using CMake
>> >         correctly in this case.
>> >
>> > If it works, then it is not incorrect. :-)
>> >
>> > add_custom_command is the "right" way to build C# files driven by a
>> > CMakeLists.txt file at present.
>> >
>> > We've had feature requests before to add better C# support, but no
>> > serious funders to back a full implementation of generating *.csproj
>> > files for C# libs and executables. See this bug report (and related
>> > ones) for more info, specifically, this bug note:
>> > http://public.kitware.com/Bug/view.php?id=7918#c22170
>>
>> David,
>>
>> I think I am just going to generate the files for now and build a
>> separate C# project in Visual Studio by hand. The reason for doing that
>> is I am trying to make it easy to maintain this project. I figure I can
>> do it by hand for now and make it easy to read.
>>
>> Your point about having this feature request before makes me wonder.
>> What does it take to implement support for a new language?
>
>
> Please keep the discussion on-list, so others may also participate in the
> discussion. (thx)
>
> Support for a new language is not terribly difficult to implement, provided
> it has a compilation model similar to C/C++, and there is support for the
> language in all of the back-end build systems that CMake targets. It's quite
> easy actually, with the Makefile generators, to support C# even as a full
> featured CMake-supported language.
>
> But it is non-trivial to support Visual Studio C# *.csproj project files
> such that they'll work like Visual Studio C# developers are accustomed to.
> Hence my comments in the bug reports...
>
>
> Taking C#
>> sharp as an example what parts of CMake does someone have to implement?
>>
>
> C# related language module files, as documented in Chapter 11 of Mastering
> CMake. Specifically section 11.4, "Adding a New Language."
>
> And *.csproj file generation support in many (all except for v6?) of the
> Visual Studio generator classes.
>
>
> HTH,
> David
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20111003/3605b204/attachment.htm>


More information about the CMake mailing list