Re: [CMake] C# and cmake ?
Hello Gerhard, 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: CMake Find and Use files: https://github.com/SimpleITK/SimpleITK/blob/master/CMake/FindCSharp.cmake https://github.com/SimpleITK/SimpleITK/blob/master/CMake/UseCSharp.cmake https://github.com/SimpleITK/SimpleITK/blob/master/CMake/FindMono.cmake https://github.com/SimpleITK/SimpleITK/blob/master/CMake/UseMono.cmake Here is macro we use for testing: https://github.com/SimpleITK/SimpleITK/blob/master/Testing/Unit/CMakeLists.txt#L326 And here is the code that we use to run SWIG and generate the managed library: https://github.com/SimpleITK/SimpleITK/blob/master/Wrapping/CMakeLists.txt#L206 Most of the CMake code has been contributed by another developer, so I am not an expert of C#. While this is a rather complicated build process, it may give an indication of what would be needed for cmake to build the C# targets. Hope this helps, Brad On Aug 22, 2012, at 7:03 AM, Gerhard den Hollander wrote: > We have a large code base, that consists of a large number of C++ file > and a smaller number of C# files. > > Most fo the C++ code is being build using CMake, > the C# code is build using the msbuild tools. > > I know that currently there is no C# support planned in CMake, > but reading through the google results, it sounds like people have had > various degrees of success using custom_command(..) or other CMake > tricks to kick of C# builds using msbuild/devenv. > > For those who have succesfully build mixed code projects (so C# and > C/C++ ), would you mind explainign how this is done ? > > Preferably with some example CMake files ? > > Thanks > > -- > > 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 Bradley Lowekamp Medical Science and Computing for Office of High Performance Computing and Communications National Library of Medicine blowek...@mail.nih.gov -- 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
Re: [CMake] C# and cmake ?
Generator expressions are special placeholders $<> used in custom commands and targets. If external project weren't of "utility" type in CMake (e.g. executable) it would be possible to associate imported location with it and use in other custom commands and targets as any other target. This allows CMake to automatically substitute configuration and handle dependencies where necessary. For example if you have code generator or test runner written in C#. Now it's still possible but you have to use CMAKE_CFG_INTDIR. On Wed, Aug 22, 2012 at 4:08 PM, Gerhard den Hollander < gdenhollan...@fugro-jason.com> wrote: > * Yuri Timenkov (Wed, Aug 22, 2012 at 01:20:37PM +0200) > > It's better to use include_external_msproject with C# projects. After > fixing bug http://public.kitware.com/Bug/view.php?id=13120 it's possible > to use: > > > > include_external_msproject(Configurator > ${CMAKE_SOURCE_DIR}/MyCSProject.csproj > > TYPE FAE04EC0-301F-11D3-BF4B-00C04F79EFBC > > PLATFORM "Any CPU" > > ) > > > According to the 2.8.9 changelog, this bugfix is part of 2.8.9. > > > > > > Additionally you can use configure_file to create file in $(SolutionDir) > to pass information (like paths, configuration options, etc.) to msbuild > and VS IDE. > > > The only drawback is that CMake sees these project as utility projects, > so you can't use them in generator expressions. However you can link to > them by adding dependencies. > > Im not sure what you mean with the above. What are generator > expressions ? > > > > -- 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
Re: [CMake] C# and cmake ?
* Yuri Timenkov (Wed, Aug 22, 2012 at 01:20:37PM +0200) > It's better to use include_external_msproject with C# projects. After fixing > bug http://public.kitware.com/Bug/view.php?id=13120 it's possible to use: > > include_external_msproject(Configurator ${CMAKE_SOURCE_DIR}/MyCSProject.csproj > TYPE FAE04EC0-301F-11D3-BF4B-00C04F79EFBC > PLATFORM "Any CPU" > ) According to the 2.8.9 changelog, this bugfix is part of 2.8.9. > > Additionally you can use configure_file to create file in $(SolutionDir) to > pass information (like paths, configuration options, etc.) to msbuild and VS > IDE. > The only drawback is that CMake sees these project as utility projects, so > you can't use them in generator expressions. However you can link to them by > adding dependencies. Im not sure what you mean with the above. What are generator expressions ? -- 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
Re: [CMake] C# and cmake ?
It's better to use include_external_msproject with C# projects. After fixing bug http://public.kitware.com/Bug/view.php?id=13120 it's possible to use: include_external_msproject(Configurator ${CMAKE_SOURCE_DIR}/MyCSProject.csproj TYPE FAE04EC0-301F-11D3-BF4B-00C04F79EFBC PLATFORM "Any CPU" ) Additionally you can use configure_file to create file in $(SolutionDir) to pass information (like paths, configuration options, etc.) to msbuild and VS IDE. The only drawback is that CMake sees these project as utility projects, so you can't use them in generator expressions. However you can link to them by adding dependencies. On Wed, Aug 22, 2012 at 3:03 PM, Gerhard den Hollander < gdenhollan...@fugro-jason.com> wrote: > We have a large code base, that consists of a large number of C++ file > and a smaller number of C# files. > > Most fo the C++ code is being build using CMake, > the C# code is build using the msbuild tools. > > I know that currently there is no C# support planned in CMake, > but reading through the google results, it sounds like people have had > various degrees of success using custom_command(..) or other CMake > tricks to kick of C# builds using msbuild/devenv. > > For those who have succesfully build mixed code projects (so C# and > C/C++ ), would you mind explainign how this is done ? > > Preferably with some example CMake files ? > > Thanks > > -- > > 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 > -- 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
[CMake] C# and cmake ?
We have a large code base, that consists of a large number of C++ file and a smaller number of C# files. Most fo the C++ code is being build using CMake, the C# code is build using the msbuild tools. I know that currently there is no C# support planned in CMake, but reading through the google results, it sounds like people have had various degrees of success using custom_command(..) or other CMake tricks to kick of C# builds using msbuild/devenv. For those who have succesfully build mixed code projects (so C# and C/C++ ), would you mind explainign how this is done ? Preferably with some example CMake files ? Thanks -- 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