mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-08 07:10:12 -05:00
1edf138506
For policy-specific tests, use the version before the policy was introduced. Otherwise, use 3.5 where possible. Also, remove `cmake_minimum_required()` and `project()` calls from individual cases where they are handled by `CMakeLists.txt`.
26 lines
696 B
CMake
26 lines
696 B
CMake
# a simple CSharp only test case
|
|
enable_language(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)
|