<div class="gmail_quote">On Mon, Sep 26, 2011 at 11:37 AM, Stephen Torri <span dir="ltr"><<a href="mailto:stephen.torri@gmail.com">stephen.torri@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I am using CMake to run SWIG to generate C# wrapper files for a<br>
project. While the attached CMakeLists.txt file produces a Visual<br>
Studio solutions that builds the C++ library, C# wrapper library and<br>
C# prototype executable I don't know first if I am using CMake<br>
correctly in this case.</blockquote><div><br>If it works, then it is not incorrect. :-)<br><br>add_custom_command is the "right" way to build C# files driven by a CMakeLists.txt file at present.<br><br>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: <a href="http://public.kitware.com/Bug/view.php?id=7918#c22170">http://public.kitware.com/Bug/view.php?id=7918#c22170</a><br>
<br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Secondly I am not sure what to do to list the<br>
C# files in the visual studio project so that I can quickly go to a<br>
the definition of a C# type for example. I would appreciate any<br>
feedback on how to improve the CMakeLists.txt file.<br></blockquote><div><br>You probably should not try to list the *.cs files in a *.vcproj file... Not sure what Visual Studio will do with such a condition. But you can try: simply add the *.cs files as "SOURCES" for the custom target and they should show up. If VS tries to compile them when you do that, in addition to the custom build rules you're already specifying, then we may have to find a way to avoid that... Give it a shot and let us know.<br>
<br>See the documentation on SOURCES in the add_custom_target help:<br><br><a href="http://cmake.org/cmake/help/cmake-2-8-docs.html#command:add_custom_target">http://cmake.org/cmake/help/cmake-2-8-docs.html#command:add_custom_target</a><br>
<br><br>HTH,<br>David C.<br><br></div></div>