CMakeLists.txt 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. cmake_minimum_required(VERSION 3.8)
  2. include(CSharpUtilities)
  3. project("ZeroTierOneUI" VERSION 1.4.0 LANGUAGES CSharp)
  4. add_executable(
  5. ${PROJECT_NAME}
  6. app.manifest
  7. App.config
  8. App.xaml
  9. App.xaml.cs
  10. AboutView.xaml
  11. AboutView.xaml.cs
  12. APIHandler.cs
  13. CentralAPI.cs
  14. CentralLogin.cs
  15. CentralNetwork.cs
  16. CentralServer.cs
  17. CentralToken.cs
  18. CentralUser.cs
  19. ISwitchable.cs
  20. JoinNetworkView.xaml
  21. JoinNetworkView.xaml.cs
  22. NetworkInfoView.xaml
  23. NetworkInfoView.xaml.cs
  24. NetworkListView.xaml
  25. NetworkListView.xaml.cs
  26. NetworkMonitor.cs
  27. NetworkNameGenerator.cs
  28. NetworkRoute.cs
  29. NetworksPage.xaml
  30. NetworksPage.xaml.cs
  31. PeersPage.xaml
  32. PeersPage.xaml.cs
  33. PreferencesView.xaml
  34. PreferencesView.xaml.cs
  35. "Simple Styles.xaml"
  36. ToolbarItem.xaml
  37. ToolbarItem.xaml.cs
  38. ZeroTierNetwork.cs
  39. ZeroTierPeer.cs
  40. ZeroTierPeerPhysicalPath.cs
  41. ZeroTierStatus.cs
  42. packages.config
  43. "Properties/AssemblyInfo.cs"
  44. "Properties/Resources.Designer.cs"
  45. "Properties/Resources.resx"
  46. "Properties/Settings.Designer.cs"
  47. "Properties/Settings.settings"
  48. "Resources/ZeroTierIcon.ico"
  49. ZeroTierIcon.ico
  50. )
  51. csharp_set_designer_cs_properties(
  52. "Properties/AssemblyInfo.cs"
  53. "Properties/Resources.Designer.cs"
  54. "Properties/Resources.resx"
  55. "Properties/Settings.Designer.cs"
  56. "Properties/Settings.settings"
  57. )
  58. csharp_set_xaml_cs_properties(
  59. App.xaml
  60. App.xaml.cs
  61. AboutView.xaml
  62. AboutView.xaml.cs
  63. JoinNetworkView.xaml
  64. JoinNetworkView.xaml.cs
  65. NetworkInfoView.xaml
  66. NetworkInfoView.xaml.cs
  67. NetworkListView.xaml
  68. NetworkListView.xaml.cs
  69. NetworksPage.xaml
  70. NetworksPage.xaml.cs
  71. PeersPage.xaml
  72. PeersPage.xaml.cs
  73. PreferencesView.xaml
  74. PreferencesView.xaml.cs
  75. ToolbarItem.xaml
  76. ToolbarItem.xaml.cs
  77. )
  78. set_property(SOURCE App.xaml PROPERTY VS_XAML_TYPE "ApplicationDefinition")
  79. set_property(SOURCE ZeroTierIcon.ico PROPERTY VS_TOOL_OVERRIDE "Resource")
  80. set_target_properties(${PROJECT_NAME} PROPERTIES
  81. VS_GLOBAL_ROOTNAMESPACE "WinUI"
  82. VS_DOTNET_TARGET_FRAMEWORK_VERSION "v4.5.2"
  83. WIN32_EXECUTABLE TRUE
  84. )
  85. set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DOTNET_REFERENCES
  86. "Microsoft.CSharp"
  87. "PresentationCore"
  88. "PresentationFramework"
  89. "System"
  90. "System.Core"
  91. "System.Data"
  92. "System.Data.DataSetExtensions"
  93. "System.Drawing"
  94. "System.Net.Http"
  95. "System.Xaml"
  96. "System.Xml"
  97. "System.Xml.Linq"
  98. "WindowsBase"
  99. "Newtonsoft.Json"
  100. )
  101. set(CMAKE_CSharp_FLAGS "/langversion:6")
  102. target_compile_options(${PROJECT_NAME} PRIVATE "/win32icon:${CMAKE_CURRENT_SOURCE_DIR}/ZeroTierIcon.ico")
  103. set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DOTNET_REFERENCE_Hardcodet.Wpf.TaskbarNotification "${CMAKE_CURRENT_BINARY_DIR}/packages/Hardcodet.NotifyIcon.Wpf.1.0.8/lib/net45/Hardcodet.Wpf.TaskbarNotification.dll")
  104. find_program(NUGET nuget)
  105. add_custom_target(nuget-restore
  106. COMMAND ${NUGET} restore ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.sln
  107. )
  108. configure_file(${CMAKE_CURRENT_SOURCE_DIR}/packages.config
  109. ${CMAKE_CURRENT_BINARY_DIR}/packages.config COPYONLY)
  110. add_dependencies(${PROJECT_NAME} nuget-restore)