[cmake-developers] C# support ready for review

Brad King brad.king at kitware.com
Mon Mar 7 14:12:12 EST 2016


On 02/25/2016 05:51 AM, Stuermer, Michael  SP/HZA-ZSEP wrote:
> The part that probably needs most additional work is all the
> C# detection and configuration part in the module scripts.

In your branch Modules/CMakeDetermineCSharpCompiler.cmake currently
has a lot of logic and environment checks for this.  It shouldn't
need to be that complicated.  Anything requiring deep introspection
of the system (especially the registry) should be something done
in the C++ generator implementation and provided to CMake platform
files as a variable.

For example, the VS generators always provide msbuild:

 https://cmake.org/cmake/help/v3.5/variable/CMAKE_VS_MSBUILD_COMMAND.html

For the path to the compiler tool, take a look at

 Modules/CompilerId/VS-10.vcxproj.in

and use of it by Modules/CMakeDetermineCompilerId.cmake.  That all
runs while detecting the compiler id using a small test project.
It has a custom command that searches the PATH in the IDE project
build environment to print out the path to the compiler.  You should
create one like this for CSharp too.

We'll also need to define behavior when CSharp is enabled by projects
under a non-VS generator.  Other generators should reject any such
attempt with an error message.

Thanks,
-Brad



More information about the cmake-developers mailing list