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 49 50 51 52 53 54 55 56 57
| cmake_minimum_required(VERSION 3.14)
set(MY_PROJECT_NAME CSharpLib)
project(${MY_PROJECT_NAME} LANGUAGES CSharp)
message ("cmake:${PROJECT_NAME}")
set(MY_SOURCE_LIB_DIR "${PROJECT_SOURCE_DIR}/../lib/")
if (NOT CMAKE_BUILD_TYPE) set (CMAKE_BUILD_TYPE "Release") message ( STATUS "${PROJECT_NAME} no CMAKE_BUILD_TYPE selected, defaulting to ${CMAKE_BUILD_TYPE} " ) endif()
SET(CMAKE_CSharp_FLAGS "/platform:AnyCPU")
SET(CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION "v4.6.1")
add_library(${PROJECT_NAME} SHARED Properties/AssemblyInfo.cs LockscreenWin10.cs )
LIST(APPEND VS_DOTNET_REFERENCES "Microsoft.CSharp") LIST(APPEND VS_DOTNET_REFERENCES "System") LIST(APPEND VS_DOTNET_REFERENCES "System.Core") LIST(APPEND VS_DOTNET_REFERENCES "System.Data") LIST(APPEND VS_DOTNET_REFERENCES "System.Data.DataSetExtensions") LIST(APPEND VS_DOTNET_REFERENCES "System.Net.Http") LIST(APPEND VS_DOTNET_REFERENCES "System.Xml") LIST(APPEND VS_DOTNET_REFERENCES "System.Xml.Linq") LIST(APPEND VS_DOTNET_REFERENCES "System.Threading.Tasks") LIST(APPEND VS_DOTNET_REFERENCES "System.IO")
set_target_properties(${PROJECT_NAME} PROPERTIES VS_DOTNET_REFERENCES "${VS_DOTNET_REFERENCES}" VS_DOTNET_REFERENCE_WindowsRuntime "System.Runtime.WindowsRuntime.dll" VS_DOTNET_REFERENCE_Windows "Windows.winmd" )
if (WIN32) add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<$<CONFIG:Debug>:Debug/${PROJECT_NAME}.dll>" "$<$<CONFIG:Release>:Release/${PROJECT_NAME}.dll>" "../CSharpMiddle/") endif()
|