summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/VsDotnetSdk/VsDotnetSdk.cmake
blob: bd914f821e5417f32cec0b094ce8a50f9ff487ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
cmake_minimum_required(VERSION 3.22)

# a simple CSharp only test case
project (DotNetSdk CSharp)

set(CMAKE_DOTNET_TARGET_FRAMEWORK net472)
set(CMAKE_DOTNET_SDK "Microsoft.NET.Sdk")

if(CMAKE_VS_PLATFORM_NAME STREQUAL "ARM64")
    set(VS_RT_IDENTIFIER arm64)
else()
    set(VS_RT_IDENTIFIER win10-x64)
endif()

add_library(dotNetSdkLib1 SHARED lib1.cs)
set_target_properties(dotNetSdkLib1
    PROPERTIES
        VS_GLOBAL_RuntimeIdentifier ${VS_RT_IDENTIFIER})

add_executable(DotNetSdk csharponly.cs)
target_link_libraries(DotNetSdk dotNetSdkLib1)
set_target_properties(DotNetSdk
    PROPERTIES
        VS_GLOBAL_RuntimeIdentifier ${VS_RT_IDENTIFIER}

        VS_DOTNET_REFERENCE_SomeDll
            ${PROJECT_SOURCE_DIR}/SomeDll.dll)