summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/VsDotnetSdk/VsDotnetSdkXamlFiles.cmake
blob: 8faf3a7c75cc7f4662ba71b7de7bec179b890357 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
enable_language(CSharp)

if(NOT CMAKE_CSharp_COMPILER)
    return()
endif()

include(CSharpUtilities)

add_executable(dotNetSdkWpfApp)
target_sources(dotNetSdkWpfApp
    PRIVATE
    App.xaml
    App.xaml.cs
    MainWindow.xaml
    MainWindow.xaml.cs
    Resources.Designer.cs
    Resources.resx)

csharp_set_xaml_cs_properties(
    App.xaml
    App.xaml.cs
    MainWindow.xaml
    MainWindow.xaml.cs)

csharp_set_designer_cs_properties(
    Resources.Designer.cs
    Resources.resx)

set_target_properties(dotNetSdkWpfApp
    PROPERTIES
      DOTNET_SDK "Microsoft.NET.Sdk"
      DOTNET_TARGET_FRAMEWORK "net5.0")

set_property(SOURCE App.xaml PROPERTY VS_XAML_TYPE "ApplicationDefinition")

set_property(TARGET dotNetSdkWpfApp PROPERTY VS_DOTNET_REFERENCES
    "Microsoft.CSharp"
    "PresentationCore"
    "PresentationFramework"
    "System"
    "System.Core"
    "System.Data"
    "System.Data.DataSetExtensions"
    "System.Net.Http"
    "System.Xaml"
    "System.Xml"
    "System.Xml.Linq"
    "WindowsBase")