CMake issueshttps://gitlab.kitware.com/cmake/cmake/-/issues2018-11-09T10:56:57-05:00https://gitlab.kitware.com/cmake/cmake/-/issues/18572POST_BUILD not running even though always fails for C# Visual Studio 20172018-11-09T10:56:57-05:00juggswordPOST_BUILD not running even though always fails for C# Visual Studio 2017The problem is that the project "Test" isn't being rebuilt, instead the program is being run even though the POST_BUILD command has never succeeded.
Steps to reproduce:
1) Start with a fresh project using the below CMake and main....The problem is that the project "Test" isn't being rebuilt, instead the program is being run even though the POST_BUILD command has never succeeded.
Steps to reproduce:
1) Start with a fresh project using the below CMake and main.cs files.
2) Configure project for a Visual Studio 2017 Win64 solution.
3) Open project and press the "Start" button at the top beside the green play icon.
The build should fail as the POST_BUILD command will always fail
4) Run again by pressing the "Start" button again.
The build will continue to fail as expected.
5) Close Visual Studio 2017 and reopen the project.
Note: this behavior also happens if you edit the CMakeLists.txt file
and the Visual Studio projects are reloaded. Basically anything that
causes the project to be closed and reopened.
6) Press the "start" button again, and now the program will be run instead of being built.
7) Delete the outputted executable file.
8) Press the "start" button again more than once and now the
expected bahavior occurs. It seems that the Test.exe being present
makes CMake think the POST_BUILD script has succeeded or it doesn't
check that the command has succeeded.
This is different than the behavior for an equivalent C++ project. When Visual Studio is closed and reopened with a C++ project the project is rebuilt if the POST_BUILD command has not succeeded.
```CMake
cmake_minimum_required(VERSION 3.12.4)
project(Test CSharp)
ADD_EXECUTABLE(${PROJECT_NAME} main.cs)
ADD_CUSTOM_COMMAND(TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${PROJECT_NAME})
```
```C#
class Test
{
public static int Main(string[] args)
{
return -1; // Never succeed
}
}
```https://gitlab.kitware.com/cmake/cmake/-/issues/18516CMake creates incorrect references in CSharp projects2018-11-02T11:41:01-04:00Stefan BattmerCMake creates incorrect references in CSharp projectsHi,
CMake 3.10.2 as well as CMake 3.13.0-rc2 creates invalid assembly references that result in compile time warnings when using the 'add_dependency' command for a CSharp target. In addition to that each CSharp target always gets an ass...Hi,
CMake 3.10.2 as well as CMake 3.13.0-rc2 creates invalid assembly references that result in compile time warnings when using the 'add_dependency' command for a CSharp target. In addition to that each CSharp target always gets an assembly reference to the 'ZERO_CHECK' target which also results in a compilation warning. To me this seems incorrect as 'add_dependency' should only result in a build dependency not a linking requirement.
Regards,
Stefanhttps://gitlab.kitware.com/cmake/cmake/-/issues/18016C# library targets generated in "Windows Store" system are not recognized as UWP2018-05-25T00:16:44-04:00jmoreiC# library targets generated in "Windows Store" system are not recognized as UWPI'm attempting to generate a C# library VS project which targets Universal Windows. However, it appears that the generated configuration lacks the following items, causing it to not show up as "Universal Windows" in the IDE:
Properties...I'm attempting to generate a C# library VS project which targets Universal Windows. However, it appears that the generated configuration lacks the following items, causing it to not show up as "Universal Windows" in the IDE:
Properties:
* TargetPlatformIdentifier ( = UAP )
* TargetPlatformVersion
* TargetPlatformMinVersion
* ProjectTypeGuids ( = {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} )
Other:
`<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />`
I was able to work around the missing properties using VS_GLOBAL_<PropName>, but I can't find a workaround for the custom targets file import. It looks like work was begun on this here but then abandoned:
https://gitlab.kitware.com/cmake/cmake/commit/db6bf1f14f9a699594b807ed2549f1d1c8bba036
Would love to see this addressed if possible. It's pretty tricky to figure out how to generate UWP stuff (libraries or otherwise) in general right now.https://gitlab.kitware.com/cmake/cmake/-/issues/17772How to solve the Warning problem after the c# project references ZERO_CHECK p...2018-05-08T12:25:51-04:00luotyHow to solve the Warning problem after the c# project references ZERO_CHECK project?![ZeroCheck1](/uploads/66130341ecb7f1912c63253b15e6f36e/ZeroCheck1.png)![ZeroCheck2](/uploads/e0a6bef8f8fd7f395e9fb67f9bbe8df4/ZeroCheck2.png)![ZeroCheck1](/uploads/66130341ecb7f1912c63253b15e6f36e/ZeroCheck1.png)![ZeroCheck2](/uploads/e0a6bef8f8fd7f395e9fb67f9bbe8df4/ZeroCheck2.png)https://gitlab.kitware.com/cmake/cmake/-/issues/17675C# Support: Need COM Reference support2023-10-22T13:01:02-04:00Robert DaileyC# Support: Need COM Reference supportMy old hand-built C# project had this:
```xml
<ItemGroup>
<COMReference Include="Shell32">
<Guid>{50A7E9B0-70EF-11D1-B75A-00A0C90564FE}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid...My old hand-built C# project had this:
```xml
<ItemGroup>
<COMReference Include="Shell32">
<Guid>{50A7E9B0-70EF-11D1-B75A-00A0C90564FE}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
</ItemGroup>
```
I do not see a mechanism to allow these to be added. I'd be fine investigating this and implementing it, but what would the team like to see in terms of design? Should this use a property similar to `VS_DOTNET_REFERENCES`? maybe `VS_DOTNET_COMREFERENCES`? If any of the other metadata (which I'm unfamiliar with) is important and must be configurable, this looks too complex for target properties. Might need a whole new command that has 1 argument per property.
Thoughts?https://gitlab.kitware.com/cmake/cmake/-/issues/17615Cannot Sign C# Assembly with a Strong Name2018-01-12T04:09:06-05:00Benito Palacios SánchezCannot Sign C# Assembly with a Strong NameAccording to the Microsoft documentation ([ref](https://docs.microsoft.com/en-us/dotnet/framework/app-domains/how-to-sign-an-assembly-with-a-strong-name)), to sign an assembly you need to specify the `/keyfile:path` compiler argument. Ad...According to the Microsoft documentation ([ref](https://docs.microsoft.com/en-us/dotnet/framework/app-domains/how-to-sign-an-assembly-with-a-strong-name)), to sign an assembly you need to specify the `/keyfile:path` compiler argument. Adding this option from the IDE, it will add the following tags to the .csproj:
```
<AssemblyOriginatorKeyFile>path</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
```
CMake fails to add these tags for two reasons:
* It detects the `keyfile` compiler option and try to generate the `AssemblyOriginatorKeyFile`, but in _cmVS11CSharpFlagTable.h_, it says that it doesn't have any user value (constant is `0x00` instead of `0x20`), so the tag is empty. We can't specify where is the key file.
* It doesn't parse or add the `SignAssembly` tag.
Trying to use the format `/keyfile:path` won't match and it will go to the `AdditionalOptions` tag that it's ignored by the C# compiler.
The workaround is to use the property `VS_GLOBAL_tag` for instance:
```
set_target_properties(target PROPERTIES
VS_GLOBAL_SignAssembly "true"
VS_GLOBAL_AssemblyOriginatorKeyFile "${SIGN_KEY}"
)
```https://gitlab.kitware.com/cmake/cmake/-/issues/17521How to create a 64-bit build and AnyCPU build of a c# project through CMake2023-12-08T16:14:55-05:00shaguftaHow to create a 64-bit build and AnyCPU build of a c# project through CMakeHow to build a C# solution in x86 and AnyCPU architecture ?
How to change the platform target of a project/target through CMake ?
Even if the build platform of the solution is changed to example:x86 the platform target of the project/t...How to build a C# solution in x86 and AnyCPU architecture ?
How to change the platform target of a project/target through CMake ?
Even if the build platform of the solution is changed to example:x86 the platform target of the project/target remains x64 as default .Michael StürmerMichael Stürmerhttps://gitlab.kitware.com/cmake/cmake/-/issues/17495Is it possibe to build a c# project using Ninja Generator in CMake or it only...2021-10-18T19:19:49-04:00shaguftaIs it possibe to build a c# project using Ninja Generator in CMake or it only supports C/C++ projects for nowWhile trying to build a C# project its throws the follwing error :
CMake Error at C:/cmake-3.9.1-win64-x64/share/cmake-3.9/Modules/CMakeDetermineCSharpCompiler.cmake:5 (message):
C# is currently only supported for Microsoft Visual Stu...While trying to build a C# project its throws the follwing error :
CMake Error at C:/cmake-3.9.1-win64-x64/share/cmake-3.9/Modules/CMakeDetermineCSharpCompiler.cmake:5 (message):
C# is currently only supported for Microsoft Visual Studio 2010 and later.
Call Stack (most recent call first):
CMakeLists.txt:6 (project)
CMake Error: CMAKE_CSharp_COMPILER not set, after EnableLanguagehttps://gitlab.kitware.com/cmake/cmake/-/issues/16865C#/Mono support for linux2022-12-06T03:49:31-05:00RomanC#/Mono support for linuxAt the moment I get the message "`C# is currently only supported for Microsoft Visual Studio 2010 and later.
CMake Error: CMAKE_CSharp_COMPILER not set, after EnableLanguage.` "
Since under linux C# / Mono can be used, it would be nice...At the moment I get the message "`C# is currently only supported for Microsoft Visual Studio 2010 and later.
CMake Error: CMAKE_CSharp_COMPILER not set, after EnableLanguage.` "
Since under linux C# / Mono can be used, it would be nice to get it working under linux too.
https://gitlab.kitware.com/cmake/cmake/-/issues/16632VS_DOTNET_TARGET_FRAMEWORK_VERSION client profile2020-01-16T23:43:34-05:00QbProgVS_DOTNET_TARGET_FRAMEWORK_VERSION client profileAdding a CSharp project should support the possibility to use client profile
i.e.
```
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
```Adding a CSharp project should support the possibility to use client profile
i.e.
```
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
```