<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hello Gerhard,<div><br></div><div>With the SimpleITK project I am working on we are using C#, SWIG and a lot of C++ ( along with a variety of other languages). We are using Swig to generate C# libraries, and compile a large number of C# executables to test our interface. We have quite a bit of CMake code, but I hope that you'll be able to wade through it to find the bits you may need. Here is a summary of some of the interesting bits that you may find useful:</div><div><br></div><div>CMake Find and Use files:</div><div><div><br></div><div><a href="https://github.com/SimpleITK/SimpleITK/blob/master/CMake/FindCSharp.cmake">https://github.com/SimpleITK/SimpleITK/blob/master/CMake/FindCSharp.cmake</a></div><div><a href="https://github.com/SimpleITK/SimpleITK/blob/master/CMake/UseCSharp.cmake">https://github.com/SimpleITK/SimpleITK/blob/master/CMake/UseCSharp.cmake</a></div><div><a href="https://github.com/SimpleITK/SimpleITK/blob/master/CMake/FindMono.cmake">https://github.com/SimpleITK/SimpleITK/blob/master/CMake/FindMono.cmake</a></div><div><a href="https://github.com/SimpleITK/SimpleITK/blob/master/CMake/UseMono.cmake">https://github.com/SimpleITK/SimpleITK/blob/master/CMake/UseMono.cmake</a></div></div><div><br></div><div>Here is macro we use for testing:</div><div><a href="https://github.com/SimpleITK/SimpleITK/blob/master/Testing/Unit/CMakeLists.txt#L326">https://github.com/SimpleITK/SimpleITK/blob/master/Testing/Unit/CMakeLists.txt#L326</a></div><div><br></div><div>And here is the code that we use to run SWIG and generate the managed library:</div><div><a href="https://github.com/SimpleITK/SimpleITK/blob/master/Wrapping/CMakeLists.txt#L206">https://github.com/SimpleITK/SimpleITK/blob/master/Wrapping/CMakeLists.txt#L206</a></div><div><br></div><div><br></div><div>Most of the CMake code has been contributed by another developer, so I am not an expert of C#. &nbsp;While this is a rather complicated build process, &nbsp;it may give an indication of what would be needed for cmake to build the C# targets.</div><div><br></div><div>Hope this helps,</div><div>Brad</div><div><br></div><div><br></div><div><div><div>On Aug 22, 2012, at 7:03 AM, Gerhard den Hollander wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>We have a large code base, that consists of a large number of C++ file<br>and a smaller number of C# files.<br><br>Most fo the C++ code is being build using CMake,<br>the C# code is build using the msbuild tools.<br><br>I know that currently there is no C# support planned in CMake,<br>but reading through the google results, it sounds like people have had<br>various degrees of success using custom_command(..) or other CMake<br>tricks to kick of C# builds using msbuild/devenv.<br><br>For those who have succesfully build mixed code projects (so C# and<br>C/C++ ), would you mind explainign how this is done ?<br><br>Preferably with some example CMake files ?<br><br>Thanks<br><br>--<br><br>Powered by <a href="http://www.kitware.com">www.kitware.com</a><br><br>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br><br>Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ">http://www.cmake.org/Wiki/CMake_FAQ</a><br><br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.cmake.org/mailman/listinfo/cmake">http://www.cmake.org/mailman/listinfo/cmake</a><br></div></blockquote></div><br><div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; font-size: 12px; "><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">========================================================</font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">Bradley Lowekamp<span class="Apple-converted-space">&nbsp;</span><span class="Apple-converted-space">&nbsp;</span></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">Medical Science and Computing for</font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">Office of High Performance Computing and Communications</font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">National Library of Medicine<span class="Apple-converted-space">&nbsp;</span></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; "><a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a></font></p><br class="Apple-interchange-newline"></div><br class="Apple-interchange-newline">
</div>
<br></div></body></html>