[CMake] C# and cmake ?

Yuri Timenkov yuri at timenkov.ru
Wed Aug 22 07:20:37 EDT 2012


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 <
gdenhollander at 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120822/cd3d897f/attachment.htm>


More information about the CMake mailing list